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

Improve Pre-commit UX #5318

Open
nawazkh opened this issue Dec 3, 2024 · 4 comments · Fixed by #5320
Open

Improve Pre-commit UX #5318

nawazkh opened this issue Dec 3, 2024 · 4 comments · Fixed by #5320
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@nawazkh
Copy link
Member

nawazkh commented Dec 3, 2024

/kind cleanup

What needs cleanup:
Pre-commit UX can be improved.

Describe the solution you'd like

  • As of this issue creation, pre-commit does not run unit tests and linter locally.
  • While running local unit tests and linter on every commit hindered the commit speed, I have noticed that I would rather have them run locally than discovering them as a blocker on a PR after an hour of raising the PR.
  • So upon exploring pre-commit documentation, I came across "Confining hooks to run at certain stages" where we can potentially configure make verify and make test to run either stage:manually or on stage: pre-push.
    • Setting the make verify test at stage:manual will not trigger it from running it locally on git commands. Instead it will only get triggered on pre-commit run <my-hook> --hook-stage manual
    • Setting make verify test at stage:pre-push will trigger the hook on running git push. This seems more helpful and a good trade off between dev speed and optimal coverage.
  • Considering that we stick with stage:pre-push we want to ensure we can skip running make test verify by appending --no-verify to git push command.
@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Dec 3, 2024
@nawazkh nawazkh added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Dec 3, 2024
@bryan-cox
Copy link
Contributor

Hey @nawazkh 👋🏻 - I can take a look at this one.

/assign

@bryan-cox bryan-cox mentioned this issue Dec 4, 2024
4 tasks
@nawazkh nawazkh moved this from Todo to In Progress in CAPZ Planning Dec 9, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in CAPZ Planning Dec 10, 2024
@nawazkh
Copy link
Member Author

nawazkh commented Jan 3, 2025

Reopening this because pre-push stage is crashing my local. Something is happening, need to investigate.
Is anyone else seeing this behavior in their local ?

Until this is fixed, if using pre-commit framework, please use git push --no-verify to push changes to origin.

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Jan 3, 2025
@k8s-ci-robot
Copy link
Contributor

@nawazkh: Reopened this issue.

In response to this:

Reopening this because pre-push stage is crashing my local. Something is happening, need to investigate.
Is anyone else seeing this behavior in their local ?

Until this is fixed, if using pre-commit framework, please use git push --no-verify to push changes to origin.

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@nawazkh nawazkh moved this from Done to Todo in CAPZ Planning Jan 3, 2025
@nawazkh
Copy link
Member Author

nawazkh commented Jan 3, 2025

Hi @bryan-cox , since you were already assigned to this issue, reopening this issue must have pinged you. Please feel free to un-assign yourself in case you don't wanna pick this up. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants