Open Bug 1863629 Opened 1 year ago Updated 18 days ago

[meta] Implement Mercurial commit hook checks in Lando

Categories

(Conduit :: Lando, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: sheehan, Assigned: sheehan)

References

(Depends on 2 open bugs, Blocks 2 open bugs)

Details

(Keywords: meta)

Lando commit hooks

As part of the hg->git migration we will need to re-implement our Mercurial commit checks in Lando.

Hooks to port

  • Treeclosure hook (completed as bug 1771695, migrate all of Treestatus into Lando).
  • Commit message check (various commit message structure validation checks) (completed as bug 1902545).
  • Prevent NSPR NSS changes (block direct updates to vendored libraries NSPR and NSS). (completed as bug 1903456).
  • Merge day (assert the merge day push doesn't contain unexpected changes).
  • Prevent cross-channel messages (block lines with X-Channel- in commit message, TBD). Edit: Can be dropped according to flod.
  • Check bug references (block commit messages referencing non-public bugs from try).
  • Prevent symlinks. (completed as bug 1895762)
  • Prevent WPTSync changes (block changes to files outside of testing/web-platform by the wptsync bot). (completed as bug 1903130).
  • Try task config (block try's try_task_config.json from landing outside of try) (completed as bug 1895931).

Hooks to convert to Herald rule

  • Prevent sync IPC changes (block changes to sync-messages.init without IPC peer review).
  • Prevent WedIDL changes (block changes to WebIDL files without DOM peer review).

New checks to add

Looks like we already have H279 to check for sync-messages.init changes.

For completeness, these are the hooks we intend to deprecate/not carry forward into Lando, with reasoning as to why:

Hooks to deprecate

  • push_printurls: Print URLs to Treeherder, hgweb on push. No longer required since direct pushing is not supported, URLs will be sent in emails and elsewhere.
  • prevent_bookmarks: Prevent pushing bookmarks to the repositories. No longer required since direct pushing will be disabled, bookmarks are an hg-only feature, and the equivalent (git branches) will be managed via Github.
  • single_head_per_branch: Enforce a single head commit per Mercurial branch. Git branches can only point to a single commit by definition, so this is no longer required.
  • advertise_upgrade: Display a message when the Mercurial version on the client is sufficiently old. No longer required since we are moving to Git.
  • single_root: Block multiple repository roots. No longer required as we can disable this in Git.
  • try_warning: Print a warning when patches are pushed to try that will not schedule any jobs. Not required as we can warn on the client side.
Assignee: nobody → sheehan
Depends on: 1888188
Depends on: 1895762
Depends on: 1895931
Depends on: 1896501
Depends on: 1899584

I did some experimenting with Herald rules, and confirmed that the "Add each time the rule matches" specifier for Herald actions does cause the review to be re-applied immediately upon removal. We should be able to convert hooks to Herald rules such that they are enforced by Lando before landing.

Depends on: 1902545
See Also: → 1902230
Depends on: 1903130
Depends on: 1903456
Depends on: 1903462
Duplicate of this bug: 1888192
Depends on: 1915671
Depends on: 1917884

Hi Connor, I noticed that the WebIDL task doesn't have a bug yet. Is that still planned or was it work incorporated in some other issue? If it's still planned can you file the bug? Thanks!

Flags: needinfo?(sheehan)

We just need to tweak the existing Herald rule, no need for a bug. :)

Flags: needinfo?(sheehan)
Blocks: 1920087

Just checking, is this meant to block or be blocked by bug 1920087?

Flags: needinfo?(sheehan)

It blocks that bug, since we will be fixing it after this bug is resolved. :)

Flags: needinfo?(sheehan)
Depends on: 1926351
You need to log in before you can comment on or make changes to this bug.