fix(ci): Correctly update and restore cache for lint:check-cpp-lint-static-full's generated files (fixes #1419):#1430
Conversation
…plicit value (fixes #xxx).
(cherry picked from commit d3cb7823504098b613dbad2461d44066b0bed2d0)
(cherry picked from commit 5972e08345e0ba5f692ca19c89efb205df7eedb2)
(cherry picked from commit 8ab2a05a0a7de46f134bfc42aed4c30b3a087f24)
This reverts commit 5972e08345e0ba5f692ca19c89efb205df7eedb2. (cherry picked from commit 0d3b4108f3985f95dc0eec900413573a81410ec5)
(cherry picked from commit 98ce1de6d33b57def441f00964fc997d58124d53)
(cherry picked from commit ba3843db1db970e6af513b0a478726782a59e0ba)
(cherry picked from commit 0d2235023282393cd920750d588137121d7a7c73)
This reverts commit 0d3b4108f3985f95dc0eec900413573a81410ec5. (cherry picked from commit 623d7c3eec613d7427fc03dece143a58fe61bfd2)
This reverts commit 623d7c3eec613d7427fc03dece143a58fe61bfd2. (cherry picked from commit 3b977078db2845053a45f538c090b0c945a70f7a)
(cherry picked from commit 71fcbd10076355ca44648c663e126ac377a1b00f)
(cherry picked from commit a4d60d70b20360d416bb307e261cc63b0883f223)
(cherry picked from commit 7e7a7dddfaef6f03748ffe4dda37725bc57c5221)
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).
Bill-hbrhbr
left a comment
There was a problem hiding this comment.
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):
|
Bypassing the remaining workflows since they will take hours to run, they shouldn't fail based on tests on my fork, and the effort of running them will be wasted unless they're run on |
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. * Stupid fix --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
…tatic-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task.
restoretask.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/restorewill automatically select the newest entry.Note
Although the
action/cachedocs 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/cachesshows 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
mainin 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