Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Peer Review transition #106

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

andrewnicols
Copy link
Contributor

I've tried to write this such that the state changes can be abstracted, but I'm not sure how best this will work for fields updated at the same time.

@andrewnicols andrewnicols force-pushed the pr branch 3 times, most recently from a9bae55 to 9c5d070 Compare December 11, 2014 02:43
These will need to be tweaked a bit, but currently offer:
* start peer review; and
* fail peer review.

This change does not incorporate an --end-review, or -pass-review phase.
The end-review should be a meta for comment as per our new PR guideliens
The pass-review should be identical to the fail review, except that it
should transition to "Waiting for integration review" if possible.
@FMCorz
Copy link
Owner

FMCorz commented Dec 24, 2014

Thanks Andrew,

That's a nice improvement, just a couple of points before I integrate it:

  • This should be rebased on top of master, there are already included commits
  • This is not necessary andrewnicols@fcc96ca
  • In general the help message of the arguments does not start with a capital, I just followed the style of the default help messages defined by argparse.
  • The dest property of the arguments are a mix of camelCase and not, I think they are always lowercase, let's stick to that.
  • When I integrated your other pull request I changed the code so that we do not display what changes were made to the issue, we will throw an exception if it did not work. Also at the end of the process we display the issue info so that should confirm that it worked. Can you adapt the code to just apply the transitions, etc... without keeping track of the changes?
  • I did not find an instance where you are using issue['namedmappding'], is that required? Is should be enough to have the named fields and raw fields. We can also use the config file to track specific fields.
  • Minor but I generally order the methods alphabetically.
  • In getTransitions() you could use the function parameter params to set the expand value. See getIssue().
  • makeTransition() exception does not need to include the status, but it could say something like "Could not transition the issue to '...'".
  • makeTransition() can now only return True
  • I often forget that, but when defining the arguments of makeTransition() it's preferrable to leave fields/update as None otherwise the objects will stick to the function. Say you set update['test'], next call it will still be set. I don't think this is causing any issue in your patch, it's just something that I noticed and very often forget.
  • getComment() does not belong to the Jira API as it invokes an editor, I would suggest asking for a comment when --comment is set, or when we are changing the transition (but from the command file, not the API).
  • In reviewStart() you could make the existing peer reviewer check happen before requesting the transitions, it saves a call if the PR is already defined. I was considering placing that check in the command itself, but it's probably find there, we could add a parameter safe=false to the function later. (Same applies to reviewFail()). I just noticed that we could only request the peer reviewer field rather than all, though we would need to know the custom name of it so it's fine.
  • reviewStart() could support a comment, but let's leave that for later.
  • reviewFail() should use a comment parameter rather than getComment().
  • reviewFail() does not seem to use namedMappings.
  • In general can we rename the methods reviewStart/Fail to peerReviewStart/Fail? That's more specific.
  • Can you isolate the commit fixing tools.launchEditor?
  • addComment() also should not use getNewComment() or return something else than True. The exception does not need to include more information about the issue and status.
  • Wrong comment in developmentStart/Stop(), it mentions reviewer.
  • In what circumstances is it useful to use --list-transitions? I'd assume that you should know what transitions are available by just looking at the status of the issue.

Thanks Andrew, this looks like many comments but they are all pretty minor really. Cheers for working that, that is going to be fun to use.

Nice work!
Fred

@FMCorz
Copy link
Owner

FMCorz commented Mar 6, 2015

Hi Andrew,

are you able to extract the commits for Peer review and Dev and rebase them on master?

Cheers,
Fred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants