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

[git-webkit] Force pre-push hooks to be up-to-date #11563

Conversation

JonWBedard
Copy link
Member

@JonWBedard JonWBedard commented Mar 15, 2023

57dd97a

[git-webkit] Force pre-push hooks to be up-to-date
https://bugs.webkit.org/show_bug.cgi?id=253972
rdar://106760739

Reviewed by Aakash Jain and Ryan Haddad.

If a checkout defines a pre-push hook, prevent users from running commands
which invoke `git push` without first installing the hook.

* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/install_hooks.py:
(InstallHooks.version_for): Extract version from a hook template file.
(InstallHooks.hook_needs_update): Compare the checked in hook template to the installed
hook template.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/land.py:
(Land.main): Exit program if our pre-push hook is out of date.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/publish.py:
(Publish.main): Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
(PullRequest.main): Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/install_hooks_unittest.py: Added.
(TestInstallHooks):

Canonical link: https://commits.webkit.org/261970@main

4f6f658

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitpy   πŸ§ͺ api-ios   πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ§ͺ services   πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  watch-sim
βœ… πŸ›  πŸ§ͺ unsafe-merge

@JonWBedard JonWBedard self-assigned this Mar 15, 2023
@JonWBedard JonWBedard added the Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases label Mar 15, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 15, 2023
@JonWBedard JonWBedard removed the merging-blocked Applied to prevent a change from being merged label Mar 15, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 16, 2023
@JonWBedard JonWBedard removed the merging-blocked Applied to prevent a change from being merged label Mar 17, 2023
@JonWBedard JonWBedard force-pushed the eng/git-webkit-Force-pre-push-hooks-to-be-up-to-date branch from 2340f6a to a9f47f1 Compare March 17, 2023 19:13
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 18, 2023
@JonWBedard JonWBedard removed the merging-blocked Applied to prevent a change from being merged label Mar 22, 2023
Copy link
Member

@aj062 aj062 left a comment

Choose a reason for hiding this comment

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

rs=me

Copy link
Contributor

@ryanhaddad ryanhaddad left a comment

Choose a reason for hiding this comment

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

LGTM

@JonWBedard JonWBedard force-pushed the eng/git-webkit-Force-pre-push-hooks-to-be-up-to-date branch from a9f47f1 to 4f6f658 Compare March 22, 2023 17:13
@JonWBedard JonWBedard added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 22, 2023
https://bugs.webkit.org/show_bug.cgi?id=253972
rdar://106760739

Reviewed by Aakash Jain and Ryan Haddad.

If a checkout defines a pre-push hook, prevent users from running commands
which invoke `git push` without first installing the hook.

* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/install_hooks.py:
(InstallHooks.version_for): Extract version from a hook template file.
(InstallHooks.hook_needs_update): Compare the checked in hook template to the installed
hook template.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/land.py:
(Land.main): Exit program if our pre-push hook is out of date.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/publish.py:
(Publish.main): Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
(PullRequest.main): Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/install_hooks_unittest.py: Added.
(TestInstallHooks):

Canonical link: https://commits.webkit.org/261970@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/git-webkit-Force-pre-push-hooks-to-be-up-to-date branch from 4f6f658 to 57dd97a Compare March 22, 2023 17:28
@webkit-commit-queue
Copy link
Collaborator

Committed 261970@main (57dd97a): https://commits.webkit.org/261970@main

Reviewed commits have been landed. Closing PR #11563 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 22, 2023
@webkit-commit-queue webkit-commit-queue merged commit 57dd97a into WebKit:main Mar 22, 2023
@JonWBedard JonWBedard deleted the eng/git-webkit-Force-pre-push-hooks-to-be-up-to-date branch March 22, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases
Projects
None yet
6 participants