Skip to content

Remove lock generation from pre-commit - #59

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
SeanMooney:split/pr14-remove-lock-precommit
Aug 13, 2026
Merged

Remove lock generation from pre-commit#59
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
SeanMooney:split/pr14-remove-lock-precommit

Conversation

@SeanMooney

Copy link
Copy Markdown
Contributor

Summary

  • remove lock-file regeneration from the pre-commit hook set
  • remove the staged-file detection wrapper used only by that hook
  • retain tox -e update-lockfiles -- <targets> as the explicit interface

Rationale

Lock generation can clone external repositories and rewrite many tracked files. It is network-dependent maintenance work rather than a fast, predictable commit-time hygiene check.

Validation

  • uvx --python 3.13 tox c -e update-lockfiles
  • uvx --python 3.13 tox -e linters -- check-yaml
  • git diff --check
  • verified no tracked references to update-lockfiles-checker remain

The complete linter environment could not install hadolint because its binary download was rejected by the local proxy with HTTP 403. The configuration's YAML hook passes independently.

The update-lockfiles hook can clone external repositories and regenerate
many tracked dependency files. This makes a routine pre-commit invocation
network-dependent, slow, and unexpectedly mutating.

Remove the hook and its dedicated staged-file detection wrapper. Lock files
remain available through the explicit tox update-lockfiles environment.

Assisted-By: Pi gpt-5.6-sol
Signed-off-by: Sean Mooney <work@seanmooney.info>
@rebtoor

rebtoor commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rebtoor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@amoralej

Copy link
Copy Markdown
Contributor

As agreed in last meeting, I'm implementing a update-lockfiles which will not clone anything. Instead of using the requirements.txt from packages in sources.txt + extra deps from pythondeps.txt and pythonbuilddeps.txt as entry for the pip-compile, it will use the existing requirements.lock + pythondeps.txt and pythonbuilddeps.txt and using the existing upper-constraints.txt as constraints file. That's exactly what we need when we just want to adjust dependencies in bindeps, pythondeps, etc...

With this new implementation, would it be appropiate to keep the update-lockfiles as pre-commit?. It will be a much lighter script that would ensure that update-lockfiles is not forgotten.

@SeanMooney

Copy link
Copy Markdown
Contributor Author

in general i would avoid pre-commit hooks iwht network sideeffect its a lot more resonable if its updated like that but still not ideal. you can skip hook when they cause issues but would that approch need to hit pypi or similar to resolve things?

@amoralej

Copy link
Copy Markdown
Contributor

in general i would avoid pre-commit hooks iwht network sideeffect its a lot more resonable if its updated like that but still not ideal. you can skip hook when they cause issues but would that approch need to hit pypi or similar to resolve things?

Sent in #71

It doesn't access the network directly but pip-compile and pybuild-deps do to resolve deps.

Yep, I tend to agree that it's probably good to remove it from pre-commit and add a new gha job to run tox -e update-lockfiles and fail if anything changed.

@SeanMooney

Copy link
Copy Markdown
Contributor Author

in general i would avoid pre-commit hooks iwht network sideeffect its a lot more resonable if its updated like that but still not ideal. you can skip hook when they cause issues but would that approch need to hit pypi or similar to resolve things?

Sent in #71

It doesn't access the network directly but pip-compile and pybuild-deps do to resolve deps.

Yep, I tend to agree that it's probably good to remove it from pre-commit and add a new gha job to run tox -e update-lockfiles and fail if anything changed.

ya that would be my approch, you can run it locally via tox if you want too but ci can actully enforce it outside of pre-commit

@openshift-ci openshift-ci Bot added the lgtm label Aug 13, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit a606310 into openstack-k8s-operators:main Aug 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants