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

CI: Put pre-commit cache under CI_PROJECT_DIR #11929

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Jan 27, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:
Apparently gitlab-runner can't cache stuff outside of the project
directory.

Put the cache under CI_PROJECT_DIR to make it work.

Also update the pre-commit image while we're at it.

Link: https://gitlab.com/gitlab-org/gitlab/-/issues/14151

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
/label ci-short

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. ci-short Run a quick CI pipeline cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 27, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 27, 2025
@VannTen
Copy link
Contributor Author

VannTen commented Jan 27, 2025

/retest

Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MrFreezeex, VannTen

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

The pull request process is described here

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

@VannTen VannTen force-pushed the fix/pre_commit_cache branch from c6b39b5 to 8c28ca0 Compare January 27, 2025 15:12
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@VannTen VannTen force-pushed the fix/pre_commit_cache branch from 8c28ca0 to 1d92ffe Compare January 27, 2025 15:23
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 27, 2025
@VannTen VannTen force-pushed the fix/pre_commit_cache branch 2 times, most recently from d8f2ccf to c52b93d Compare January 27, 2025 16:15
@VannTen
Copy link
Contributor Author

VannTen commented Jan 27, 2025

https://gitlab.com/gitlab-org/gitlab-runner/-/issues/28139

Hum. Apparently this break pre-commit caching (CI_PROJECT_DIR is not stable, pre-commit stores full path in it's db)

@VannTen VannTen force-pushed the fix/pre_commit_cache branch from c52b93d to 94f82b4 Compare January 27, 2025 16:33
@VannTen
Copy link
Contributor Author

VannTen commented Jan 28, 2025

There is a workaround (noted in the link above) but it requires changes to the runner config. Will work on that

@VannTen VannTen force-pushed the fix/pre_commit_cache branch from 94f82b4 to 54a83e0 Compare January 29, 2025 13:30
Apparently gitlab-runner can't cache stuff outside of the project
directory.

Put the cache under CI_PROJECT_DIR to make it work (which also means we
need to ignore it from ansible-lint).

Also update the pre-commit image while we're at it.

Link: https://gitlab.com/gitlab-org/gitlab/-/issues/14151
@VannTen VannTen force-pushed the fix/pre_commit_cache branch from 54a83e0 to 59a885e Compare January 29, 2025 14:03
@VannTen
Copy link
Contributor Author

VannTen commented Jan 29, 2025

So the cache finally works, but pre-commit ansible-lint is quirky since #11831 for some reasons...
(it does not fail consistently fail in CI, but it does on my env at least)
Maybe some python version 🤔

@yankay
Copy link
Member

yankay commented Feb 6, 2025

It needs to rebase the master branch to pass the CI.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 6, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. ci-short Run a quick CI pipeline cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants