-
Notifications
You must be signed in to change notification settings - Fork 10
ci: add automatic git hooks installation #468
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: meomnzak The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #468 +/- ##
=======================================
Coverage 55.77% 55.77%
=======================================
Files 58 58
Lines 8757 8757
=======================================
Hits 4884 4884
Misses 3525 3525
Partials 348 348 🚀 New features to boost your workflow:
|
pfeifferj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally, you raise some good points. I have some questions/concerns regarding the implementation
|
|
||
| ## Development | ||
|
|
||
| ### Git Hooks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding this now is fine, but generally I'd like to keep the readme as lean as possible.
cleaning up the readme/moving various bits of info to ./docs would be a nice followup ticket to create but I think it would be something I need to work on.
| - id: go-test | ||
| name: go test | ||
| entry: go test ./... | ||
| language: system | ||
| pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that the long runtime of tests is annoying but I don't want us to remove this entirely.
would moving them to a pre-push hook be a sensible compromise?
|
|
||
| .PHONY: build | ||
| build: generate ## Build binary for current platform | ||
| build: ensure-hooks generate ## Build binary for current platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is an intuitive way to install the hooks and neither is the test target.
the ci target might make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally fair point that this is not the most Intuitive place, but this is actually the reason behind this pr haha.
I always forgot make lint, and I saw other contributors miss that too. And I was like, why not make a pre-commit, but I actually found we have one. So the point was to document that we have it somewhere. And to make the developers install it in a "sneaky" way, since we always make build and make test.
I’m open to adjusting where the auto-install happens if there’s a better onboarding target, as long as we keep the hooks easy to discover and hard to miss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a point in being "sneaky" about it when the people who would benefit from it would probably also never think of running any of the make commands. but that's just my $0.02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah makes sense, appreciate you sharing your perspective
| install-git-hooks: ## Install git hooks (pre-commit + gitlint) | ||
| pre-commit install | ||
| gitlint install-hook | ||
| @echo "Git hooks installed successfully." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this redundant if we have the ensure-hooks target?
Description
Pre-commit hooks are now automatically installed when running
make buildormake test. This ensures all contributors run linting checks before commits without manual setup.Also removes the
go test ./...hook from pre-commit config since running the full test suite on every commit is too slow.Type of change
Testing
helm lintand template validation)Checklist
Additional context