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

Teach scc merge to parse comments for labels #125

Merged
merged 10 commits into from
Nov 15, 2013

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented Nov 13, 2013

All merge commands, e.g. scc merge should be able to parse --exclude in the comments/description. Such comments will exclude the PR during the merge operation.

@ghost ghost assigned sbesson Nov 12, 2013
@@ -49,6 +49,14 @@ def tearDown(self):
self.sandbox.push_branch(":%s" % self.branch, remote=self.user)
super(TestMerge, self).tearDown()

def create_status(self, state):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the move of this block? To keep it alphabetical?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Primarily to separate setup/helper methods from proper test methods. But it doesn't matter that much so I can restore the old behaviour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. Just wondering if there was a new policy.

@joshmoore
Copy link
Member

How is it intended to remove labels via --label?

@sbesson
Copy link
Member Author

sbesson commented Nov 14, 2013

What do you mean by remove labels? Unlink label from the issue?

@joshmoore
Copy link
Member

Well, if one comment allows: --add-label exclude should a later --del-label exclude not also be possible?

@sbesson
Copy link
Member Author

sbesson commented Nov 14, 2013

After discussion with @joshmoore, the next steps for this PR are:

  • replacing --label LABEL by a simple --exclude parsing
  • adding some whitelisting for the --exclude comment (and adding tests if possible)
  • display digest of excluded PRs (as for status excluded)

All the dynamic action labelling (--add-label…) will be handled in future versions of scc.

- run_filter() now returns a reason together with the filter status
- unit tests have been fixed accordingly
- status-excluded PRs are now included as part of the excluded PRs section
@sbesson
Copy link
Member Author

sbesson commented Nov 14, 2013

NB: with the three last commits, the output of scc merge should now look like:

sebastien@sbesson:openmicroscopy (clitest_group) $ python ~/code/ome/snoopycrimecop/scc/main.py merge develop --info -S success-only -E pr:1633 -E exclude
2013-11-14 12:58:24,147 [   scc.merge] INFO  Finding PR based on develop opened by any public member of the organization
2013-11-14 12:58:24,147 [   scc.merge] INFO  Including PR labelled as: include
2013-11-14 12:58:24,147 [   scc.merge] INFO  Excluding PR: 1633
2013-11-14 12:58:24,147 [   scc.merge] INFO  Excluding PR labelled as: exclude
2013-11-14 12:58:24,147 [   scc.merge] INFO  Excluding PR without successful status
2013-11-14 13:00:02,587 [   scc.merge] INFO  Repository: openmicroscopy/openmicroscopy
2013-11-14 13:00:02,587 [   scc.merge] INFO  Excluded PRs:
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1712 rleigh-dundee 'Create release source artifact containing all submodules' (status: error)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1708 cneves 'Improving big image birds eye view behaviour on IE8+' (status: error)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1633 rleigh-dundee 'Upgrade ICE jars to version 3.5.1' (pr: 1633)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1646 knabar 'OmeroWeb Django upgrade from 1.3.1 to 1.5.4' (label: exclude)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1742 aleksandra-tarkowska '11591 user ip' (label: exclude)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1733 aleksandra-tarkowska 'Preventing system users being removed from system groups' (status: pending)
2013-11-14 13:00:02,587 [   scc.merge] INFO    # PR 1753 jburel 'Edit user' (status: pending)
2013-11-14 13:00:02,587 [   scc.merge] INFO  Candidate PRs:
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1385 manics 'Update the OMERO VirtualBox image'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1647 cneves 'Fixing the drag behaviour on tiled images for IE (see #11555)'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1698 snoopycrimecop 'Update develop submodules'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1719 aleksandra-tarkowska '#9058 Unit support'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1743 mtbc 'accommodate PL/pgSQL that logs deletes'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1756 jburel 'Exclude the import log from the list of files.'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1759 ximenesuk 'fix #10581: getTile byte-ordering issue'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1760 will-moore 'Ie8 fixes 8713 develop'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1761 will-moore 'Blitz param types 11637 develop'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1762 jburel 'Remove rollover option'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1764 jburel 'Remove Description'
2013-11-14 13:00:02,588 [   scc.merge] INFO    # PR 1765 jburel 'Related nodes'
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 1766 jburel 'Add roi intensity results view'
2013-11-14 13:00:02,589 [   scc.merge] INFO  
2013-11-14 13:00:02,589 [   scc.merge] INFO  Repository: openmicroscopy/bioformats
2013-11-14 13:00:02,589 [   scc.merge] INFO  Excluded PRs:
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 762 qidane 'New annotation' (label: exclude)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 763 qidane 'New map' (label: exclude)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 760 qidane 'Schema release 2013-10-dev-1' (label: exclude)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 775 melissalinkert 'Add JWlz to Ivy dependencies' (status: error)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 774 tinevez 'A reader for the Yokagawa Cellvoyager automated microscope.' (user: tinevez)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 783 melissalinkert 'Leica LIF: do not set the 'rgb' flag for 16-bit multi-channel data' (status: pending)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 761 qidane 'Update timestamp docs and add samples' (label: exclude)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 764 qidane 'New lightsource' (label: exclude)
2013-11-14 13:00:02,589 [   scc.merge] INFO    # PR 766 qidane 'Updating Color to store as 4 floats' (label: exclude)
2013-11-14 13:00:02,590 [   scc.merge] INFO  Candidate PRs:
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 528 melissalinkert 'Tile performance improvements for VMS and NDPI'
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 767 melissalinkert 'Fix Channel.Color interpretation in ImageJ'
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 781 melissalinkert 'Add modulo annotation support for Zeiss CZI data'
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 788 melissalinkert 'Do not prompt to update to the latest stable version if Fiji is used'
2013-11-14 13:00:02,590 [   scc.merge] INFO  
2013-11-14 13:00:02,590 [   scc.merge] INFO  Repository: ome/scripts
2013-11-14 13:00:02,590 [   scc.merge] INFO  
2013-11-14 13:00:02,590 [   scc.merge] INFO  Repository: openmicroscopy/ome-documentation
2013-11-14 13:00:02,590 [   scc.merge] INFO  Candidate PRs:
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 533 hflynn 'Removing BF anchor until it exists'
2013-11-14 13:00:02,590 [   scc.merge] INFO    # PR 551 manics 'Change var/logs/FSServer.log to var/log/FileServer.log'
2013-11-14 13:00:02,591 [   scc.merge] INFO  
sebastien@sbesson:openmicroscopy (clitest_group) $ 

Add unit test with a whitelisting function checking organization members
- Check for exclude comments ahead of  PR filters and fail-fast if found
- Mark comment-excluded PRs separately
- Reuse the default filter mode for whitelisting PR comments
- Fix documentation of default mode in the command help
@sbesson
Copy link
Member Author

sbesson commented Nov 14, 2013

With the last two comments, whitelisting should be turned on for parsing --exclude comments:

sebastien@sbesson:sphinx (master) $ python ~/code/ome/snoopycrimecop/scc/main.py merge --info develop -D all 
2013-11-14 14:16:41,783 [   scc.merge] INFO  Finding PR based on develop opened by any user
2013-11-14 14:16:41,783 [   scc.merge] INFO  Including PR labelled as: include
2013-11-14 14:16:41,783 [   scc.merge] INFO  Excluding PR labelled as: exclude
2013-11-14 14:16:45,269 [   scc.merge] INFO  Repository: openmicroscopy/ome-documentation
2013-11-14 14:16:45,269 [   scc.merge] INFO  Excluded PRs:
2013-11-14 14:16:45,269 [   scc.merge] INFO    # PR 533 hflynn 'Removing BF anchor until it exists' (exclude comment)
2013-11-14 14:16:45,269 [   scc.merge] INFO  Candidate PRs:
2013-11-14 14:16:45,269 [   scc.merge] INFO    # PR 551 manics 'Change var/logs/FSServer.log to var/log/FileServer.log'
2013-11-14 14:16:45,269 [   scc.merge] INFO  
sebastien@sbesson:sphinx (master) $ python ~/code/ome/snoopycrimecop/scc/main.py merge --info develop -D org
2013-11-14 14:16:51,281 [   scc.merge] INFO  Finding PR based on develop opened by any public member of the organization
2013-11-14 14:16:51,281 [   scc.merge] INFO  Including PR labelled as: include
2013-11-14 14:16:51,281 [   scc.merge] INFO  Excluding PR labelled as: exclude
2013-11-14 14:16:57,237 [   scc.merge] INFO  Repository: openmicroscopy/ome-documentation
2013-11-14 14:16:57,237 [   scc.merge] INFO  Candidate PRs:
2013-11-14 14:16:57,237 [   scc.merge] INFO    # PR 533 hflynn 'Removing BF anchor until it exists'
2013-11-14 14:16:57,238 [   scc.merge] INFO    # PR 551 manics 'Change var/logs/FSServer.log to var/log/FileServer.log'
2013-11-14 14:16:57,238 [   scc.merge] INFO  

@joshmoore
Copy link
Member

Travis is green and changes look good. Only other verification we wanted was SCC-self-merge, correct?
http://hudson.openmicroscopy.org.uk/view/Mgmt/job/SCC-self-merge/180/testReport/

@sbesson
Copy link
Member Author

sbesson commented Nov 15, 2013

@joshmoore
Copy link
Member

👍

joshmoore added a commit that referenced this pull request Nov 15, 2013
Teach `scc merge` to parse comments for labels
@joshmoore joshmoore merged commit cd36d8b into ome:master Nov 15, 2013
@sbesson sbesson deleted the 125_label_comments branch November 15, 2013 10:53
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