-
Notifications
You must be signed in to change notification settings - Fork 83
fix(ci): Correctly update and restore cache for lint:check-cpp-lint-static-full
's generated files (fixes #1419):
#1430
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
…plicit value (fixes #xxx).
(cherry picked from commit d3cb782)
(cherry picked from commit 5972e08)
(cherry picked from commit 8ab2a05)
(cherry picked from commit 98ce1de)
(cherry picked from commit ba3843d)
(cherry picked from commit 0d22350)
(cherry picked from commit 71fcbd1)
(cherry picked from commit a4d60d7)
(cherry picked from commit 7e7a7dd)
This reverts commit 40e55ad.
WalkthroughGitHub Actions workflows updated to change lint cache restore/save behavior: scheduled runs no longer restore lint caches (forcing full lint), cache keys made OS- and configuration-specific, and save keys use hashFiles-based prefixes that must stay in sync with restore prefixes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Scheduler as "Scheduled run"
participant CI as "GitHub Actions job"
participant Cache as "actions/cache"
participant Lint as "lint:check-cpp-static-full"
rect #E8F0FE
Note over Scheduler,CI: Scheduled run (cron)
end
Scheduler->>CI: trigger job
CI->>Cache: restore keys (skip for scheduled run)
Cache-->>CI: no cache restored
CI->>Lint: run full lint on all files
Lint-->>CI: lint results
CI->>Cache: save with hashFiles-based key (cannot rely on restore output)
sequenceDiagram
autonumber
participant Push as "Push/PR run"
participant CI as "GitHub Actions job"
participant Cache as "actions/cache"
participant Lint as "lint:check-cpp-static-full"
Push->>CI: trigger job
CI->>Cache: restore using OS/config prefix (may match saved hash-prefix)
Cache-->>CI: cache restored (if keys match)
alt cache hit
CI->>Lint: run lint (incremental/fast)
else cache miss
CI->>Lint: run full lint
end
Lint-->>CI: lint results
CI->>Cache: save using hashFiles-based key (must match restore prefix format)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
actions/cache/save
with explicit value (fixes #1419).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.
Other than we could update the pinned action sha to the latest v4.3.0 release, i don't have other comments. Logic looks correct but there's no way to test until we merge to main
.
0057852bfaa89a56745cba8c7296529d2fc39830
For title, how about:
|
How about a multi-line PR title & body:
|
I'd prefer to do this in another PR so that future readers don't think this was a necessary change for this PR. |
just some suggestions. otherwise lgtm |
lint:check-cpp-lint-static-full
's generated files (fixes #1419):
restore
task.Description
#815 added caching for the input and output of
lint:check-cpp-lint-static-full
, but two issues were preventing the cache from being updated correctly:main
. Specifically, cache entries are immutable for a given key, so every new entry needs to have a new key. I mistakenly set the cache key to be the same for every entry, so no new entries could be written.This PR resolves the issues as follows:
actions/cache/restore
will automatically select the newest entry.Note
Although the
action/cache
docs imply that cache entries are stored in different namespaces determined by the OS used, runninggh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/y-scope/clp/actions/caches
shows that cache entries for different OSes have the same version. So we still must use a different cache key prefix per OS and build configuration.action/cache/save
, we specify the cache key manually rather than trying to rely on the value fromaction/cache/restore
.This fix should reduce clp-core-build-macos workflow runtimes from 2-3 hours to ~20 minutes.
Checklist
breaking change.
Validation performed
main
in my fork.Note
clang-tidy violations are not being detected correctly, so we can't test if violations will be detected by the workflow. This will be resolved in another PR.
Summary by CodeRabbit