Repository navigation
feat(clustertool): support custom pre-commit.local hooks - #781
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🚀 HelmRelease CI ReportOverall Status
🧪 HelmReleases Tested⏭️ HelmReleases SkippedResultℹ️ No HelmReleases required testing |
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
Custom checks added directly to the generated Git pre-commit hook are lost when ClusterTool regenerates it.
The generated hook now runs an optional
.git/hooks/pre-commit.localafter the encryption check succeeds. ClusterTool never creates or overwrites this file, so custom checks survive hook regeneration byinit,genconfig, andgithook.Encryption failures prevent the local hook from running. A failing local hook aborts the commit. When no local hook exists, the existing encryption-only workflow remains unchanged.
The
githookcommand help documents the behavior and the executable permission required on Linux.Partially addresses #774.
⚙️ Type of change
🧪 How Has This Been Tested?
Validated using test build
test-b63beeb5974f.git commitexecution was also tested manually.No live cluster bootstrap or cluster state changes were performed.
📃 Notes:
Users must put their custom checks in
.git/hooks/pre-commit.local. On Linux, make it executable withchmod +x .git/hooks/pre-commit.local.The local hook is not tracked by Git and must be configured for each clone. Any tools it invokes must be available in the environment where the commit runs.
Support for
core.hooksPathand protection of existing foreign hooks are outside this change. The generatedpre-commitfile is still replaced.No new runtime dependencies are introduced by this change.
🤖 This PR is AI generated.
✔️ Checklist:
feat(clustertool):fix(clustertool):chore(clustertool):