Fix the pre-push hook base resolution and align its PHPStan level with CI [no_release] - #637
Open
snake14 wants to merge 7 commits into
Open
Fix the pre-push hook base resolution and align its PHPStan level with CI [no_release]#637snake14 wants to merge 7 commits into
snake14 wants to merge 7 commits into
Conversation
A higher level in the pre-push hook than in CI blocks pushes on pre-existing errors in touched files that CI accepts.
New files carry no pre-existing debt, so hold them to the strictest level.
…lease] Touched files are ratcheted up to level 5 even where the CI base is lower; pre-existing findings in a touched file get fixed with the change that touches it.
Uncommitted local changes were analyzed and could block a push for files the push doesn't contain. Also corrects the hook's log label.
Pushing another local branch, or several refs at once, analysed the checked-out branch instead of what was actually pushed.
A plugin cloned outside a Matomo checkout cannot be checked, which is no reason to block its pushes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #636: the pre-push hook now diffs against the merge base with
origin/5.x-devinstead of the local5.x-devbranch, which could be stale or missing and silently widened the analysis to files the push doesn't touch. It now fails with a clear message when the merge base can't be resolved.The modified-files hook level is set to the plugin-wide goal of level 5 (the CI base stays at level 1), so files a push touches ratchet toward that goal rather than staying at the level CI enforces.
Tooling-only change: no version bump or changelog entry (no_release).
Issue No
Related to PG-4897 (JIRA)
Steps to Replicate the Issue
5.x-devis stale or missing.Checklist