Fix version bump pre-commit hook#33
Merged
Merged
Conversation
swarup-padhi-glean
approved these changes
Jun 30, 2026
Pros: - Forces update of the hook when a manifest is deleted. Cons: - Forces multiple PRs when a manifest is created. The first PR will create the manifest, the second will update the hook. The CI check is unaffected.
Contributor
Author
|
Addressed @swarup-padhi-glean's comments. The hook now errors on missing manifests in both Deleting a manifest: When deleting a manifest, the hook's Adding a manifest: The manifest must be added and the change committed and merged to |
…o that which deletes a manifest
swarup-padhi-glean
approved these changes
Jun 30, 2026
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.
What
Update the pre-commit hook for automatic version bump (
.githooks/pre-commit.d/02-auto-bump-version.sh) to updateplugins/glean/.codex-plugin/plugin.jsonandplugins/glean/.cursor-plugin/plugin.jsonas well.Why
The pre-commit hook was previously updating only
plugins/glean/.codex-plugin/plugin.json.Details
The script keeps the versions across the plugin manifests in lockstep. The larger number of possible cases here makes determining the target version complex. The target version is computed as follows:
Let$V_\rm{main}$ be the set of all valid versions (across all manifests) in the $V_\rm{current}$ be the set of all valid version strings taking into consideration the staged changes. Then,
mainbranch andwhere
Versions are assumed to be of the form$x.y.z$ (no pre-release tags/build metadata).
Missing plugin manifests do not fail the hook; however, malformed JSON in the plugin manifests does.Missing plugin manifests and malformed JSON in the plugin manifests fail the hook.
Code changes
02-auto-bump-version.sh.01-rebuild-dist.sh,02-auto-bump-version.sh,check-version-bump.sh,pack-plugin.sh) to use the environment Bash instead of the system Bash. (start.shhas been omitted.)