From 0f973193d68c57f171dcf9b7f520dea12d8037f9 Mon Sep 17 00:00:00 2001 From: Toni Bergholm Date: Fri, 20 Nov 2026 08:47:01 +0200 Subject: [PATCH 1/2] Pin CI actions and sidecar base images by digest Pin every third-party action in .github/workflows to a full commit SHA with a trailing tag comment, so a moved tag or branch cannot change what CI executes. dtolnay/rust-toolchain reads the toolchain from its ref name, so each use now passes toolchain: 1.95.0 explicitly. In Dockerfile.sidecar, pin both base images by multi-arch index digest and build agenticd with --locked so Cargo.lock is enforced. --- .github/workflows/ci.yml | 49 ++++++++++++++++------------ .github/workflows/codeql.yml | 14 ++++---- .github/workflows/deploy-website.yml | 8 ++--- .github/workflows/release-sdk.yml | 6 ++-- crates/agenticd/Dockerfile.sidecar | 6 ++-- 5 files changed, 47 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e67da20..e8e892e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ jobs: run: working-directory: website steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "22" cache: npm @@ -41,11 +41,12 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head with: + toolchain: 1.95.0 components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: fmt run: cargo fmt --all -- --check - name: clippy @@ -59,8 +60,8 @@ jobs: name: python sdk runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" - name: install @@ -80,9 +81,11 @@ jobs: name: gcs integration (fake-gcs) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head + with: + toolchain: 1.95.0 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: start fake-gcs run: | docker run -d --name fake-gcs -p 54323:4443 \ @@ -135,9 +138,11 @@ jobs: env: DATABASE_URL: postgres://agentic:agentic@localhost:54322/agentic steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head + with: + toolchain: 1.95.0 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: start postgres (pgvector) with logical decoding enabled run: | docker run -d --name agentic-ci-pg -p 54322:5432 \ @@ -190,9 +195,11 @@ jobs: name: release build (macos) runs-on: macos-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head + with: + toolchain: 1.95.0 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: build release binaries run: cargo build --release -p agenticd -p agentic-cli - name: smoke-run binaries @@ -213,10 +220,12 @@ jobs: env: CONTAINER_RUNTIME: docker steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 - - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head + with: + toolchain: 1.95.0 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" - name: install postgres client diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b14e70e4..562b4d88 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,20 +21,22 @@ jobs: matrix: language: [rust, python] steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.95.0 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head if: ${{ matrix.language == 'rust' }} - - uses: actions/setup-python@v5 + with: + toolchain: 1.95.0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 if: ${{ matrix.language == 'python' }} with: python-version: "3.12" - name: initialize codeql - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3 with: languages: ${{ matrix.language }} - name: autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3 - name: perform analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9 # v3.39.3 with: category: /language:${{ matrix.language }} diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 895945d7..fae8f225 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -17,8 +17,8 @@ jobs: run: working-directory: website steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22 cache: npm @@ -36,8 +36,8 @@ jobs: run: working-directory: website steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22 cache: npm diff --git a/.github/workflows/release-sdk.yml b/.github/workflows/release-sdk.yml index 849e130b..8657dbf8 100644 --- a/.github/workflows/release-sdk.yml +++ b/.github/workflows/release-sdk.yml @@ -23,8 +23,8 @@ jobs: id-token: write # OIDC trust handshake with TestPyPI contents: read steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" - name: install build @@ -42,7 +42,7 @@ jobs: exit 1 fi - name: publish to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1 branch head with: repository-url: https://test.pypi.org/legacy/ packages-dir: sdk/python/dist diff --git a/crates/agenticd/Dockerfile.sidecar b/crates/agenticd/Dockerfile.sidecar index ff0f2c9c..55f8acd7 100644 --- a/crates/agenticd/Dockerfile.sidecar +++ b/crates/agenticd/Dockerfile.sidecar @@ -2,7 +2,7 @@ # Build (from repo root): # docker build -f crates/agenticd/Dockerfile.sidecar -t agenticd:sidecar . -FROM rust:1.95-slim-bookworm AS builder +FROM rust:1.95-slim-bookworm@sha256:d7482085ff5b415f84dba5647ae71606650bdef00db7aeb69f4b3d170c3e4082 AS builder WORKDIR /src # rustls-tls only — no OpenSSL anywhere in the workspace (workspace # Cargo.toml pins reqwest with default-features=false + rustls-tls; @@ -13,9 +13,9 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* COPY Cargo.toml Cargo.lock rust-toolchain.toml ./ COPY crates ./crates -RUN cargo build --release -p agenticd && strip target/release/agenticd +RUN cargo build --locked --release -p agenticd && strip target/release/agenticd -FROM debian:bookworm-slim +FROM debian:bookworm-slim@sha256:734a72b3d6142a71993b4bc580ca01d8ca687f77a2c422d96a961d3376b179bc # No libssl runtime — the whole stack is rustls. ca-certificates is # still required so rustls' webpki resolver can validate the GCS # endpoint's cert chain via the system trust store. From 4a984cab4ae4fb3a96a5a6db7f7b585aa04cd31b Mon Sep 17 00:00:00 2001 From: Toni Bergholm Date: Fri, 20 Nov 2026 09:13:54 +0200 Subject: [PATCH 2/2] Drop the explicit toolchain input for rust-toolchain The pinned commit of the 1.95.0 branch hardcodes the toolchain and declares no toolchain input, so the extra input only produced warnings. --- .github/workflows/ci.yml | 9 --------- .github/workflows/codeql.yml | 2 -- 2 files changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8e892e5..89ec0541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,6 @@ jobs: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head with: - toolchain: 1.95.0 components: rustfmt, clippy - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: fmt @@ -83,8 +82,6 @@ jobs: steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head - with: - toolchain: 1.95.0 - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: start fake-gcs run: | @@ -140,8 +137,6 @@ jobs: steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head - with: - toolchain: 1.95.0 - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: start postgres (pgvector) with logical decoding enabled run: | @@ -197,8 +192,6 @@ jobs: steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head - with: - toolchain: 1.95.0 - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: build release binaries run: cargo build --release -p agenticd -p agentic-cli @@ -222,8 +215,6 @@ jobs: steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head - with: - toolchain: 1.95.0 - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 562b4d88..feb1934f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,8 +24,6 @@ jobs: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@1961bfc0c4a8bf07e0a0c98e1e2459c642ea70a0 # 1.95.0 branch head if: ${{ matrix.language == 'rust' }} - with: - toolchain: 1.95.0 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 if: ${{ matrix.language == 'python' }} with: