-
Notifications
You must be signed in to change notification settings - Fork 15
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
Merge filters #39
Merge filters #39
Conversation
The include and exclude filter are now parsed and stored in a dictionary with 3 keys: label (default), pr & user. Each filter can be attributed to the corresponding key using the key:value syntax in the command line.
For each filter (include or exclude), labels, user and pull request number are successively tested against the values of the filter dictionary. If the intersection is not null, it is logged in DEBUG.
@sbesson: see b62f51ed6777661ea328d for the beginnings of unit tests. |
If a specific PR is given I think it's reasonable to automatically add the user, though we're not exactly snowed under by external PRs so a warning message would also do.
Granularity would be nice but I don't think it's necessary for now, especially if the defaults are reasonable, e.g. |
On 21 Dec 2012, at 17:15, Simon Li wrote:
will merge any PR opened against develop by a member of openmicroscopy. Having
merge only PR 24 would imply changing this default behaviour to merging no PR (for consistency else specifying an include filter would effectively decrease the number of merged PRs).
|
With @sbesson's changes, it now should be fairly straight-forward to write mocked tests. This is currently done using mox. Like Sandbox.py, Mocks.py provides a base class which should be used by all mocked tests.
These overloaded functions (for mox testins) do break the instantiation of real repositories.
Example of filter that was not working properly with lstrip(): "user:sbesson". In this case, s.lstrip(key + ":") will also strip the first "s" character.
Define 4 default modes: none, mine, org and alls. Allow better granularity and potentially any possibility when combined with include/exclude filters.
@manics, @joshmoore: the last commit should add an optional parameter to control the default PRs to include. Thus, while Default mode is currently set to org (only PRs opened by public members of the organisation) for consistency with existing behavior until now. |
@joshmoore: the last commit should allow to renable the mox tests without breaking existing behaviour. Can be tested with:
|
@sbesson +1 |
@joshmoore: fixed the Travis build |
Looks quite nice. I can imagine us wanted to add more defaults, but I can't think of any off-hand. ("followers", etc.) And eventually having a shortcut (e.g. Otherwise, if this has been tested in a job, I think we should get it merged and configure it across the board. |
Improve INFO log message to specify default mode
@joshmoore: added the |
The one last thing ( 😇 ) I remember us discussing is whether to have "-E a b c" or "-E a -E b -E c". Since that's a fairly substantial departure, I'd say let's make a choice and stick with it (and I'll promise to never bring it up again, etc.) |
self.filters["base"] = args.base | ||
self.filters["default"] = args.default | ||
if args.default == "org": | ||
default_user = "any public member of the organgization" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: organgization
Command for including/excluding multiple filters should be now formatted as: scc merge master -Dnone -Iuser:user1 -Iuser:user2 -Itest -Ilabel:test2 -Ipr:42 -Ipr:23 -Epr:39
Are you referring to:
Individual arguments means you can mix up the order of |
There definitely shouldn't be a warning if multiple are passed, that's the point (as I understand it). But I can see how having |
I meant there should be a warning if we stayed with the |
After reflexion, I don't think we should be too concerned about my comment above until we reach a concrete situation where having the filters applied in the input order is critical. That being said, the current selection order (1- default, 2- include, 3- exclude) with the extra filtering options (label, user, pr number, default types) of this PR should already give us a lot of flexibility. The last 2 commits implemented the switch to |
Merging for now. @manics, if in practice any of the choices causes a problem, another PR will certainly be called for. |
This PR enhances the
include/exclude
filters used in theMerge
command by allowing key:value filters to be passed. Three keys are currently defined:label
,pr
,user
.pr
filters are not propagated across submodules.This allows to use the following syntax
Couple of questions:
include/exclude
e.g./cc @manics for discussion