Merged
Conversation
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Reviewer's GuideEnhances the CI pipeline by introducing npm and Rust caches across backend, frontend, and e2e jobs, and by parameterizing the cache job matrix to improve build performance. Flow diagram for CI job caching stepsflowchart TD
Checkout["Checkout repository"] --> SetupNode["Set up Node.js"]
SetupNode --> NpmCacheStep["Restore NPM cache"]
NpmCacheStep --> NodeModulesCacheStep["Restore node_modules cache"]
NodeModulesCacheStep --> RustCacheStep["Restore Rust dependencies cache (if applicable)"]
RustCacheStep --> InstallDeps["Install dependencies"]
InstallDeps --> Build["Build/Run job"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The caching steps are highly repetitive across multiple jobs—consider extracting them into a reusable workflow or composite action to DRY up the CI configuration.
- You’re using both setup-node’s cache option and separate actions/cache for npm installs; consolidating to a single caching approach (e.g., relying on setup-node’s built-in npm cache) could simplify the workflow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The caching steps are highly repetitive across multiple jobs—consider extracting them into a reusable workflow or composite action to DRY up the CI configuration.
- You’re using both setup-node’s cache option and separate actions/cache for npm installs; consolidating to a single caching approach (e.g., relying on setup-node’s built-in npm cache) could simplify the workflow.
## Individual Comments
### Comment 1
<location> `.github/workflows/ci.yml:51-56` </location>
<code_context>
run: echo "::set-output name=toolchain::$(cat ./rust/gbt/rust-toolchain)"
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}
+ - name: Cache Rust dependencies
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ ${{ matrix.node }}/${{ matrix.flavor }}/rust/gbt/target/
+ key: ${{ runner.os }}-cargo-${{ matrix.flavor }}-${{ hashFiles('${{ matrix.node }}/${{ matrix.flavor }}/rust/gbt/**/Cargo.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-cargo-${{ matrix.flavor }}-
+ ${{ runner.os }}-cargo-
</code_context>
<issue_to_address>
**suggestion:** Rust cache includes ~/.cargo/bin/, which may not be necessary.
Caching ~/.cargo/bin/ may cause conflicts if global binaries change or if jobs need different versions. It may be safer to cache only the registry and target directories.
```suggestion
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ matrix.node }}/${{ matrix.flavor }}/rust/gbt/target/
```
</issue_to_address>
### Comment 2
<location> `.github/workflows/ci.yml:323-326` </location>
<code_context>
cache: "npm"
cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json
+ - name: Cache node modules for e2e
+ uses: actions/cache@v4
+ with:
+ path: ${{ matrix.module }}/frontend/node_modules
+ key: ${{ runner.os }}-e2e-${{ matrix.module }}-node-22-${{ hashFiles('${{ matrix.module }}/frontend/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-e2e-${{ matrix.module }}-node-22-
+ ${{ runner.os }}-e2e-${{ matrix.module }}-
</code_context>
<issue_to_address>
**suggestion:** E2E node_modules cache key is hardcoded to node version 22.
Parameterizing the node version in the cache key will help prevent issues if the version changes or if tests are run on multiple versions.
```suggestion
key: ${{ runner.os }}-e2e-${{ matrix.module }}-node-${{ matrix.node }}-${{ hashFiles('${{ matrix.module }}/frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-e2e-${{ matrix.module }}-node-${{ matrix.node }}-
${{ runner.os }}-e2e-${{ matrix.module }}-
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add caching for Node.js and Rust dependencies across CI jobs to speed up builds and configure a fixed node matrix for assets builds
CI: