Skip to content

fix(ci): add npm cache to backend/frontend jobs, drop unused wasm target, cache stellar-cli binary. - #489

Open
Kureszn wants to merge 1 commit into
Stellar-Ecosystem:mainfrom
Kureszn:fix/ci-workflow-cache
Open

fix(ci): add npm cache to backend/frontend jobs, drop unused wasm target, cache stellar-cli binary.#489
Kureszn wants to merge 1 commit into
Stellar-Ecosystem:mainfrom
Kureszn:fix/ci-workflow-cache

Conversation

@Kureszn

@Kureszn Kureszn commented Jul 29, 2026

Copy link
Copy Markdown

All necessary files have been set up and every other issue resolved adhering to the acceptance criteria.
Closes #402

Summary by CodeRabbit

  • Documentation

    • Added a security policy with private vulnerability reporting guidance.
    • Clarified required report details, response timelines, scope, exclusions, and supported release versions.
  • Chores

    • Streamlined contract builds to use the required WebAssembly target.
    • Improved CI caching for Rust tooling and Node.js dependencies to support faster builds.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Kureszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request narrows the Rust CI target, expands Rust and npm caching, and adds a security policy covering private vulnerability reporting, response timelines, supported versions, and vulnerability scope.

Changes

CI optimization

Layer / File(s) Summary
Build targets and dependency caching
.github/workflows/ci.yml
The Soroban build uses wasm32v1-none; Rust caching includes the stellar CLI, while backend and frontend Node jobs cache npm dependencies using their lockfiles.

Security policy

Layer / File(s) Summary
Vulnerability disclosure policy
SECURITY.md
Documents private reporting, required vulnerability details, response milestones, supported-version handling, and in-scope and out-of-scope categories.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: 10xwhoman, naninu123

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The CI cache and WASM target changes are unrelated to issue #402's security disclosure work. Move the CI workflow updates to a separate PR or tie them to a CI issue; they are not part of #402.
Linked Issues check ❓ Inconclusive SECURITY.md satisfies the disclosure policy text, but the diff can't confirm GitHub private vulnerability reporting is actually enabled. Enable GitHub private vulnerability reporting in repository settings, or provide evidence that it is already on.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and summarizes the CI/cache changes, though it omits the SECURITY.md addition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
SECURITY.md (1)

21-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify support for released versions.

“Only the latest commit on main” is a moving target and does not tell users whether tagged or released versions receive security fixes. Enumerate supported release lines, or explicitly state that released versions are unsupported.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` at line 21, Clarify the security support policy in SECURITY.md
by explicitly stating whether tagged or released versions receive security
fixes. Replace the ambiguous “latest commit on main” wording with either the
supported release lines or a clear statement that released versions are
unsupported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Line 38: Update the CI cache configuration around the Stellar CLI installation
to include Cargo install metadata (~/.cargo/.crates2.json and
~/.cargo/.crates.toml) along with the relevant registry and git cache paths. Pin
the stellar-cli installation to an explicit version and include that version in
the cache key so cache entries are invalidated when the CLI version changes.

---

Nitpick comments:
In `@SECURITY.md`:
- Line 21: Clarify the security support policy in SECURITY.md by explicitly
stating whether tagged or released versions receive security fixes. Replace the
ambiguous “latest commit on main” wording with either the supported release
lines or a clear statement that released versions are unsupported.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a2fd147a-261f-4a14-b166-cb841a8c114b

📥 Commits

Reviewing files that changed from the base of the PR and between a3fd824 and 3362fa2.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • SECURITY.md

Comment thread .github/workflows/ci.yml
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/stellar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "### workflows"
git ls-files .github/workflows || true

echo "### ci.yml relevant lines"
if [ -f .github/workflows/ci.yml ]; then
  nl -ba .github/workflows/ci.yml | sed -n '1,120p'
fi

echo "### stellar/cargo cache references"
rg -n "cargo install|stellar|cache|~/\.cargo|/\.cargo" .github workflow . --glob '!**/node_modules/**' || true

echo "### rust toolchain/version pins near ci"
rg -n "toolchain|stellar-cli|stellar|cargo install" .github workflow . --glob '!**/node_modules/**' || true

Repository: Stellar-Ecosystem/lodestar

Length of output: 156


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "### workflows"
find .github/workflows -maxdepth 1 -type f 2>/dev/null | sort || true

echo "### ci.yml line count and relevant lines"
if [ -f .github/workflows/ci.yml ]; then
  wc -l .github/workflows/ci.yml
  nl -ba .github/workflows/ci.yml | sed -n '1,140p'
fi

echo "### targeted searches for install/cache paths"
rg -n "cargo install|stellar-cli|stellar|cache|cargo cache|target/action|~/\.cargo|/\.cargo/.crates2.json|/\.cargo/.crates.toml|\.crates2\.json" .github . 2>/dev/null \
  | head -n 200 || true

Repository: Stellar-Ecosystem/lodestar

Length of output: 156


🌐 Web query:

docs.rs cargo metadata .crates2.json cargo install caching installed packages

💡 Result:

Cargo uses the.crates2.json and.crates.toml files located in the installation root directory (by default $CARGO_HOME, which is usually $HOME/.cargo) to track packages installed via cargo install [1][2][3][4]. These files are essential metadata for Cargo to identify which packages are already installed, their versions, features, and associated binaries [5][3][6]. If you are using Continuous Integration (CI) and want to cache binaries installed with cargo install to avoid re-downloading and re-compiling them, you must include the following files and directories in your cache [1][7]: -.crates.toml -.crates2.json - bin/ - registry/index/ - registry/cache/ - git/db/ Failing to cache the.crates2.json and.crates.toml files while caching the bin/ folder can lead to errors where Cargo is unaware of the existing binaries and may attempt to re-install them or fail due to conflicts [5][8]. These files should not be edited manually [1][7]. For more information on configuring the installation root and cache behavior, you can refer to the official Cargo documentation regarding the Cargo home directory [1][7].

Citations:


🌐 Web query:

GitHub actions cache Rust Cargo install ~./cargo/.crates2.json ~/.cargo/registry/src

💡 Result:

To cache Rust Cargo dependencies in GitHub Actions, it is standard practice to cache specific directories within ~/.cargo/ and the local target/ directory [1][2][3]. While you can manually configure actions/cache, many developers prefer using specialized community actions like Swatinem/rust-cache to manage complex caching logic and avoid common issues like cache bloat [4][5][6]. Standard Caching Paths If using actions/cache, typically include the following paths [1][2][3]: ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db target/ Regarding your specific query about ~/.cargo/registry/src: Generally, it is not recommended to cache ~/.cargo/registry/src [4]. Cargo is designed to efficiently recreate the contents of this directory from the compressed crate archives stored in ~/.cargo/registry/cache [4]. Caching the src directory is typically unnecessary and can increase the time required to upload and download the cache [4]. Best Practices Use a lockfile for keys: Always include the hash of your Cargo.lock file in your cache key to ensure the cache is invalidated when dependencies change [2][7][3]. Example: key: ${{ runner.os }}-cargo-${{ hashFiles('/Cargo.lock') }} [2][3]. Consider specialized actions: Community actions like Swatinem/rust-cache are often recommended because they handle "smart" caching, such as pruning unnecessary build artifacts from target/ that change every commit and would otherwise bloat your cache [4][8][6]. Use restore-keys: Provide restore-keys to allow for partial cache matches, which helps speed up builds even when an exact lockfile match is not found [7][3][9]. Example using actions/cache: - name: Cache cargo uses: actions/cache@v4 with: path: | ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db target/ key: ${{ runner.os }}-cargo-${{ hashFiles('/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-

Citations:


🌐 Web query:

Cargo install --version caching crate source ~/.cargo source git crates2.json

💡 Result:

Cargo uses its home directory ($HOME/.cargo/ by default) to manage a cache of crates, sources, and registry indices [1]. When you use cargo install, Cargo tracks the installed binaries and their metadata in hidden files within this directory [2][1]. Key components of Cargo's caching mechanism include: Crate Source Caching: Cargo maintains a local registry index and a cache of downloaded crate tarballs (.crate files) in $CARGO_HOME/registry/cache/ [1][3]. When a crate is needed, it is downloaded and then unpacked into $CARGO_HOME/registry/src/ [1][4]. If a version is already present in these locations, Cargo skips the download and extraction steps to save time [4]. Git Source Caching: For crates installed via the --git flag, Cargo clones the remote git repository into $CARGO_HOME/git/db/ and checks out the required commit, branch, or tag into $CARGO_HOME/git/checkouts/ [1]. Tracking Installations (.crates2.json): The file $CARGO_HOME/.crates2.json (along with .crates.toml) is a critical metadata file used by Cargo to track which packages are installed via cargo install [2][1]. It records details about the installed binaries and their sources [1]. Important Note: You should never edit these files manually [1]. If you need to cache binaries installed with cargo install for CI/CD environments, you must preserve the following components of your $CARGO_HOME: * bin/ *.crates.toml *.crates2.json * registry/index/ * registry/cache/ * git/db/ Using cargo install --version allows you to pin to a specific version or range [5][6], but note that build artifacts generated during installation (the actual compiled binaries) are often placed in a temporary directory by default [5][7]. If you are concerned about build performance in CI, you can influence where these build artifacts are placed by setting the CARGO_TARGET_DIR environment variable [5][7].

Citations:


Cache Cargo install metadata and pin the Stellar CLI version.

GitHub actions/cache restores cache paths before cargo install runs, but unless it includes Cargo’s install metadata (~/.cargo/.crates2.json, ~/.cargo/.crates.toml) and the relevant registry/git cache paths, later cargo install --version invocations can still reinstall or fail over installed binaries. Add the missing home-directory paths to the cache and use a pinned stellar-cli version plus a cache key component for that version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 38, Update the CI cache configuration
around the Stellar CLI installation to include Cargo install metadata
(~/.cargo/.crates2.json and ~/.cargo/.crates.toml) along with the relevant
registry and git cache paths. Pin the stellar-cli installation to an explicit
version and include that version in the cache key so cache entries are
invalidated when the CLI version changes.

@ritik4ever

Copy link
Copy Markdown
Collaborator

Hi @Kureszn,

This PR could not be merged because it has merge conflicts with the target branch.

Please resolve the merge conflicts, push the updated changes, and the PR can be reviewed and merged.

Thank you!

@Kureszn

Kureszn commented Jul 31, 2026

Copy link
Copy Markdown
Author

This might be a little error, It states here from my end that there are no conflicts and it can be cleanly merged

@Kureszn

Kureszn commented Jul 31, 2026

Copy link
Copy Markdown
Author

There are no conflicts with base branch on my end, it says changes can be cleanly merged.
Kindly check again when less busy thank you. @ritik4ever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repo: no SECURITY.md or vulnerability disclosure process

2 participants