Add a push hook to try that rejects pushes that contain bug numbers for security bugs
Categories
(Developer Services :: Mercurial: hg.mozilla.org, enhancement)
Tracking
(Not tracked)
People
(Reporter: Gijs, Assigned: zeid)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
(probably the wrong prod/comp, please move as appropriate) If you don't know about https://wiki.mozilla.org/Security/Bug_Approval_Process and this is your first sec bug, and you just wrote a patch, you ask for review and... you push to try. It would be nice if we rejected such pushes before they got published on the server, and: a) linked to https://wiki.mozilla.org/Security/Bug_Approval_Process b) provided some TL;DR rationale for blocking the push. (and obviously, (c) had some way to override this. Not sure what that should be without giving people a trivial way of querying try for "trypushes that are for security bugs :-( )
| Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
| Reporter | ||
Comment 1•4 years ago
|
||
(In reply to :Gijs from comment #0) > (and obviously, (c) had some way to override this. Not sure what that should > be without giving people a trivial way of querying try for "trypushes that > are for security bugs :-( ) I mean, the obvious solution here would be to suggest pushing without any bug numbers if people really really need to push to try, I guess? Rewriting commit messages should be relatively straightforward in 2017 hg/git. Hopefully/maybe?
Comment 2•4 years ago
|
||
Since we're working towards requiring `mach try`, we could build this functionality into `mach try`. Then if we ever have "private" Try infrastructure (bug 1136954), `mach try` could redirect to that automatically if the bug summary referenced a private bug, the pushed changesets are private, the user requested it, etc. Anyway, hooking this up to the "require `mach try`" bug dependencies so we don't lose track of the potential feature.
Comment 3•2 years ago
|
||
I've started work on this and came up with the following. I haven't tested it (I'll need to set up a local mercurial server I think, and I won't get to that until next week) but I think it's reasonably put together enough to request feedback.
Comment 4•2 years ago
|
||
Comment on attachment 9112128 [details]
hook.py
This looks pretty good! I'm going to pass this along to Zeid for reference. It uses the old hooks format so we will have to convert to the new one, but the error message and flow looks mostly correct.
Comment 5•2 years ago
|
||
Zeid is going to be working on this as his first bug.
| Assignee | ||
Comment 6•2 years ago
|
||
DO NOT LAND - WORK IN PROGRESS
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Are we going to be able to differentiate between sec bugs and moco-confidential bugs or is this hook going to treat both the same?
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 9•2 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #8)
NI for comment 7.
As far as I can tell the status code and error code are the same for both types of bugs when trying to access them via the API, so with the current implementation the hook will reject both.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Pushed by cosheehan@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/0471a6491e0e
hooks: adding push hook for security bugs r=sheehan
Comment 11•2 years ago
|
||
This has landed and will be deployed soon. We can close the bug once we've rolled it out successfully.
| Assignee | ||
Updated•2 years ago
|
Turned off in bug 1607003.
Description
•