Closed Bug 1228358 Opened 9 years ago Closed 9 years ago

Further improvements of pushlog_client

Categories

(Developer Services :: Mercurial: Pushlog, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sabergeass, Assigned: sabergeass)

Details

Attachments

(2 files, 1 obsolete file)

After talk with :AutomatedTester on irc,  there are still a lot of places we could been improved for pushlog client. one of them which can be sure is we could change 'query_revisions_range_from_revision_before_and_after' function name to reasonable length. And the other one is we may need to make pushlog_client return a python object which can represent a push.

So I would like to ask his opinion in here and anyone who would like to give suggestion for pushlog_client can leave comment in here :)
Flags: needinfo?(dburns)
I think that there needs to be a python object, that allows easier documentation of what is returned to users from using the API. See https://github.com/AutomatedTester/Bugsy/blob/master/bugsy/bug.py#L14 as an example.

I also think the API names need to be revisited. As mentioned in comment 0, that call is hard to mentally parse to understand what it does. It feels like there are methods that could be combined and default params help guide someone using it.
Flags: needinfo?(dburns)
(In reply to David Burns :automatedtester from comment #1)
Ok, I will make it happened within today :)
Assignee: nobody → sabergeass
Status: NEW → ASSIGNED
Side note: we should look at what there is in vct wrt to classes.
For instance a PushInfo class:
https://hg.mozilla.org/hgcustom/version-control-tools/file/default/pylib/mozautomation/mozautomation/repository.py#l226

I think coming up with a draft with gps which we can review would help us do things right from the beginning.

gps: do you have any classes which represent pushes?
Flags: needinfo?(gps)
The mozautomation package is more or less a catch all of random utilities and many of them are half baked and only implement features necessary to support something else. The pushlog-related code in there should probably be deleted and consumers should be switched to the new pushlog client package you just released.

The pushlog classes you found are currently the best there are. You are probably best reinventing the wheel.
Flags: needinfo?(gps)
Attached file in progress PR (obsolete) —
Hi Armen and David, here is the progress I had achieved for now. We return a list of push object rather than return revision list directly now. Actually, I always wondering if I'm on the right direction for this issue. Could you give some advice about it? Thank you!

BTW, I think those function name may changed from eg. query_revision_ to query_*push*_by_revision, which will make function name become more longer ;)
Attachment #8695752 - Flags: feedback?(dburns)
Attachment #8695752 - Flags: feedback?(armenzg)
commented directly on the PR
Attachment #8695752 - Flags: feedback?(dburns)
What David mentions in the PR is in the right direction
Attachment #8695752 - Flags: feedback?(armenzg)
Attached file PR for bug 1228358
Maybe this PR is good to go? Let's just forget the test part, we will need rewrite the whole tests in bug 1227531 :)
Attachment #8695752 - Attachment is obsolete: true
Attachment #8696582 - Flags: review?(dburns)
Attachment #8696582 - Flags: review?(armenzg)
Comment on attachment 8696582 [details] [review]
PR for bug 1228358

This is significantly better from what it was. The API now allows more people to use python idioms to build out what they might need. 

For me this is good enough to go (after the nits have been looked at).
Attachment #8696582 - Flags: review?(dburns) → review+
Comment on attachment 8696582 [details] [review]
PR for bug 1228358

Given feedback in the PR.
A bit more work is required.
Attachment #8696582 - Flags: review?(armenzg)
Attachment #8696582 - Flags: review+ → review?(armenzg)
Comment on attachment 8696582 [details] [review]
PR for bug 1228358

I've landed this! Thanks MikeLing :)

I replaced though **kwargs for push_info. If we ever really needed we can add it back but for now I decided we really don't need it.

I also made the mistake of not specifying -u "MikeLing" in the commit message. My apologies about this.

I also released a 0.2.0 version. You can now make changes to mozci to use this package :D
Attachment #8696582 - Flags: review?(armenzg) → review+
(In reply to Armen Zambrano Gasparnian [:armenzg] from comment #12)
> Comment on attachment 8696582 [details] [review]
> PR for bug 1228358
> 
> I've landed this! Thanks MikeLing :)
It's my pleasure :) BTW, could we close that PR if we had landed it?

> I also made the mistake of not specifying -u "MikeLing" in the commit
> message. My apologies about this.

np, I had learn a ton of things from this issue. So I'm ok with it :)

> I also released a 0.2.0 version. You can now make changes to mozci to use
> this package :D

Great! I will start my work right now!
I can't close the PR. Only the person who started it can (plus admins).

Could you check if you can close it?
Flags: needinfo?(sabergeass)
Yes, I can close it. But I add some more code in that branch in (https://github.com/mozilla/version-control-tools/pull/2/files), maybe we could close it after merge that :)
Flags: needinfo?(sabergeass)
I saw that you pushed more code into the PR.
In general, start a new PR if there is some follow up work.

I will close this bug for now. We can open new ones.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
More changes from MikeLing:
https://github.com/mozilla/version-control-tools/pull/3
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: further improve of pushlog_client → Further improvements of pushlog_client
https://hg.mozilla.org/hgcustom/version-control-tools/rev/8a0940aacdb60fadf27d29c81101423fd19fcdfe
Bug 1228358 - Add query_pushes_by_specified_revision_range() to pushlog client. r=armenzg
My apologies for the delayed release :/
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: