Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 57 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,22 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90
toolchain: 1.95.0
components: clippy, rustfmt

- name: Install tmux
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y tmux
sudo apt-get update && sudo apt-get install -y tmux unzip
tmux new-session -d
# The flatbuffers-generated code only compiles against a matching
# flatc; the apt package is too old. Install the flatc release that
# matches the `flatbuffers` crate version pinned in Cargo.lock.
flatc_version="$(sed -nE '/name = "flatbuffers"/{n;s/^version = "(.*)"$/\1/p;}' crates/wisp-embers/Cargo.lock)"
[ -n "$flatc_version" ] || { echo "could not determine flatbuffers version from Cargo.lock" >&2; exit 1; }
curl -fsSL -o /tmp/flatc.zip \
"https://github.com/google/flatbuffers/releases/download/v${flatc_version}/Linux.flatc.binary.g++-13.zip"
sudo unzip -o /tmp/flatc.zip -d /usr/local/bin
flatc --version
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Cache cargo artifacts
uses: swatinem/rust-cache@v2
Expand All @@ -46,3 +55,48 @@ jobs:

- name: Run tests
run: cargo test --workspace --all-targets

embers:
name: Embers Backend
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Comment on lines +64 to +68

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify unpinned action refs and checkout credential persistence in workflows.
rg -n 'uses:\s*[^@]+@(?:v[0-9]+|stable|main|master)$' .github/workflows
rg -n -A4 -B2 'uses:\s*actions/checkout@' .github/workflows

Repository: Pajn/wisp

Length of output: 3576


🏁 Script executed:

cat -n .github/workflows/ci.yml | sed -n '50,95p'

Repository: Pajn/wisp

Length of output: 2214


Pin third-party actions to commit SHAs and disable checkout credential persistence in the embers job.

Lines 64, 67, and 86 use mutable tags (@v4, @stable, @v2). The checkout action should pin to a commit SHA and set persist-credentials: false unless a later step requires git authentication. For example:

Example fix
- name: Checkout
  uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871  # v4.2.1
  with:
    persist-credentials: false

- name: Install Rust toolchain
  uses: dtolnay/rust-toolchain@1482605baf5caebd8b2feb1143f460cce50e0a94  # stable
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 63-64: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 64-64: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 67-67: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[info] 67-67: action functionality is already included by the runner (superfluous-actions): use rustup and/or cargo in a script step

(superfluous-actions)

🤖 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 around lines 63 - 67, Replace the mutable action
version tags with pinned commit SHAs in the workflow. For the Checkout action,
change from `@v4` to the full commit SHA
(eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871) and add a with section containing
persist-credentials: false, followed by a comment showing the version. For the
Install Rust toolchain action, change from `@stable` to its commit SHA
(1482605baf5caebd8b2feb1143f460cce50e0a94) and add a comment showing the
version. Repeat this pattern for any other mutable tags referenced on lines 86
and elsewhere in the workflow file.

Source: Linters/SAST tools

with:
toolchain: 1.95.0
components: clippy

- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y tmux unzip
tmux new-session -d
# The flatbuffers-generated code only compiles against a matching
# flatc; the apt package is too old. Install the flatc release that
# matches the `flatbuffers` crate version pinned in Cargo.lock.
flatc_version="$(sed -nE '/name = "flatbuffers"/{n;s/^version = "(.*)"$/\1/p;}' crates/wisp-embers/Cargo.lock)"
[ -n "$flatc_version" ] || { echo "could not determine flatbuffers version from Cargo.lock" >&2; exit 1; }
curl -fsSL -o /tmp/flatc.zip \
"https://github.com/google/flatbuffers/releases/download/v${flatc_version}/Linux.flatc.binary.g++-13.zip"
sudo unzip -o /tmp/flatc.zip -d /usr/local/bin
flatc --version

- name: Cache cargo artifacts
uses: swatinem/rust-cache@v2

# The wisp-embers crate is excluded from the workspace (it needs flatc and
# is gated behind the optional `embers` feature), so the `rust` job's
# `--workspace` commands skip it. Build, lint, and run its tests here.
- name: Run clippy (wisp-embers)
run: cargo clippy --manifest-path crates/wisp-embers/Cargo.toml --all-targets -- -D warnings

- name: Run tests (wisp-embers)
run: cargo test --manifest-path crates/wisp-embers/Cargo.toml --all-targets

# Exercise the embers-gated integration code in the binary and app crates,
# which the default-feature `rust` job never compiles or runs.
- name: Run tests (embers feature)
run: cargo test -p wisp -p wisp-app --features embers --all-targets
24 changes: 21 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Validate version input
env:
VERSION: ${{ inputs.version }}
run: |
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version '$VERSION'; expected X.Y.Z (digits and dots only)" >&2
exit 1
fi

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -31,13 +40,22 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90
toolchain: 1.95.0
components: clippy, rustfmt

- name: Install tmux
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y tmux
sudo apt-get update && sudo apt-get install -y tmux unzip
tmux new-session -d
# The flatbuffers-generated code only compiles against a matching
# flatc; the apt package is too old. Install the flatc release that
# matches the `flatbuffers` crate version pinned in Cargo.lock.
flatc_version="$(sed -nE '/name = "flatbuffers"/{n;s/^version = "(.*)"$/\1/p;}' crates/wisp-embers/Cargo.lock)"
[ -n "$flatc_version" ] || { echo "could not determine flatbuffers version from Cargo.lock" >&2; exit 1; }
curl -fsSL -o /tmp/flatc.zip \
"https://github.com/google/flatbuffers/releases/download/v${flatc_version}/Linux.flatc.binary.g++-13.zip"
sudo unzip -o /tmp/flatc.zip -d /usr/local/bin
Comment thread
coderabbitai[bot] marked this conversation as resolved.
flatc --version

- name: Cache cargo artifacts
uses: swatinem/rust-cache@v2
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90
toolchain: 1.95.0
components: clippy, rustfmt

- name: Install tmux
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y tmux
sudo apt-get update && sudo apt-get install -y tmux unzip
tmux new-session -d
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# The flatbuffers-generated code only compiles against a matching
# flatc; the apt package is too old. Install the flatc release that
# matches the `flatbuffers` crate version pinned in Cargo.lock.
flatc_version="$(sed -nE '/name = "flatbuffers"/{n;s/^version = "(.*)"$/\1/p;}' crates/wisp-embers/Cargo.lock)"
[ -n "$flatc_version" ] || { echo "could not determine flatbuffers version from Cargo.lock" >&2; exit 1; }
curl -fsSL -o /tmp/flatc.zip \
"https://github.com/google/flatbuffers/releases/download/v${flatc_version}/Linux.flatc.binary.g++-13.zip"
sudo unzip -o /tmp/flatc.zip -d /usr/local/bin
flatc --version

- name: Cache cargo artifacts
uses: swatinem/rust-cache@v2
Expand Down Expand Up @@ -95,7 +104,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90
toolchain: 1.95.0
targets: ${{ matrix.target }}

- name: Upload release archive
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/.DS_Store

/crates/wisp-embers/target
Loading
Loading