Skip to content

ci: speed up PR test workflow#473

Merged
carrion256 merged 9 commits into
devfrom
codex/ci-speed-pr472
Jun 17, 2026
Merged

ci: speed up PR test workflow#473
carrion256 merged 9 commits into
devfrom
codex/ci-speed-pr472

Conversation

@carrion256

@carrion256 carrion256 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • split the Test workflow into always-on fast lib tests and path-gated NEAR/workspace integration tests
  • gate coverage to push, scheduled, merge queue, manual opt-in, or workflow-call contexts instead of every direct PR
  • add path detection for NEAR integration, Soroban, and feature-matrix surfaces plus a final required gate
  • install stellar-cli from the official release binary by default instead of compiling it from source in CI
  • allow same-repo pull_request Rust cache writes and use job-scoped cache keys that do not include comma-separated target/component inputs

Timing evidence

Baseline PR #472 Test workflow, run 27627445976:

  • workflow wall clock: about 37m
  • Tests: 37m21s, with Run tests at 35m35s
  • Coverage: 20m56s
  • Soroban: 16m33s, with Install stellar CLI source compile at about 12m39s
  • feature matrix ran all entries

This PR, cold cache, run 27632640884 before rerun:

  • workflow wall clock: about 9m44s
  • Fast Tests: 9m34s
  • Code Linter: 6m08s
  • Soroban: 4m06s
  • Coverage, Feature Matrix, and NEAR / Workspace Integration Tests: skipped for this PR-shaped diff
  • Full Required Gate: success

Same commit rerun after caches were saved, run 27632640884 rerun:

  • workflow wall clock: about 5m42s
  • Fast Tests: 3m53s
  • Code Linter: 1m57s
  • Soroban: 1m47s
  • cache logs show full cache hits and successful restores for Fast Tests, Code Linter, and Soroban

Verification

  • /data/tmp/actionlint-bin/actionlint -color=false .github/workflows/test.yml
  • YAML parse for .github/workflows/test.yml and .github/actions/rust/action.yml
  • bash -n script/soroban/install-stellar-cli.sh script/test.sh script/prebuild-test-contracts.sh
  • git diff --check
  • post-commit Soroban size hook: 128902 bytes
  • GitHub Actions Test workflow green on PR context

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

GitHub Actions Test Workflow Optimization

Workflow restructuring (fast vs. surface-gated full tests)

  • fast-tests always runs: cargo nextest run --workspace --lib (with disk cleanup).
  • near-integration-tests runs only when gated: ./script/test.sh --workspace.
  • soroban runs only when gated.
  • feature-matrix runs only when gated.
  • full-required-gate always runs and enforces that:
    • changes, code-formatting, code-linter, and fast-tests are success
    • NEAR/Soroban/Feature Matrix/Coverage are required only when changes computed the corresponding run_* == true (otherwise skipped jobs won’t fail the gate).

Path-based gating (surface detection)

  • changes job uses dorny/paths-filter to detect changes for:
    • NEAR integration (near_integration) via common/src/**, specific contract/**/near/** and related tests/scripts, plus script/test.sh.
    • Soroban (soroban) via contract/**/soroban/**, kernel/vault soroban paths, script/soroban/**, and tools/soroban-vault-cli/**.
    • Feature matrix (feature_matrix) via contract/proxy-oracle/{governance-kernel,kernel}/** and primitives/**.
  • plan CI surface computes:
    • run_near_integration, run_soroban, run_feature_matrix from both event type and path matches.
    • run_coverage based on event/input gating (below).

Coverage gating (reduced CI load)

  • Coverage runs only when needs.changes.outputs.run_coverage == 'true'.
  • Computation rules in plan CI surface:
    • push / schedule / merge_group: coverage_required=true
    • pull_request: coverage remains opt-in (path changes don’t enable it)
    • workflow_dispatch: enabled only when run_coverage=true (default false)
    • workflow_call: enabled unless skip_coverage=true (default false)
  • coverage job uses id-token: write and runs:
    • cargo llvm-cov nextest --workspace --lib --lcov --output-path coverage.lcov

Soroban CI optimization

  • Rust toolchain + WASM targets use the repo’s local composite action (.github/actions/rust) with:
    • wasm32-unknown-unknown, wasm32v1-none
  • Installs Rust 1.89.0 via rustup toolchain install ....
  • stellar-cli is installed via the pinned stellar/stellar-cli action:
    • version: 26.0.0 (prebuilt binary approach vs compiling in CI)

Rust cache improvements (composite action)

Updated .github/actions/rust/action.yml:

  • Same-repo PR cache writes allowed: cache saving is conditional so forks don’t write caches:
    • save-if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
  • Job-scoped cache key to improve reuse and avoid key formatting pitfalls:
    • shared-key: "rust-${{ runner.os }}-${{ github.job }}"
  • Comments updated to document the constraint that rust-cache rejects keys containing commas and to avoid embedding comma-separated target lists in the key.

Workflow permissions hardening

  • Top-level workflow permissions reduced to:
    • contents: read
    • pull-requests: read
  • coverage job explicitly grants id-token: write for Codecov OIDC.

Performance results

  • Baseline PR workflow: ~37 minutes.
  • This PR:
    • cold cache: 9m44s (coverage + feature-matrix + NEAR integration skipped for non-matching changes)
    • warm cache rerun: 5m42s
    • Soroban improvement: stellar-cli setup dropped from ~12m39s (source compile) to ~1m47s (prebuilt binary on warm cache).

Critical aspects for human review

  1. Cache write condition for PRs: confirm head.repo.full_name == github.repository matches the intended “same-repo only” cache behavior.
  2. Coverage security posture: codecov/[email protected] still passes token: ${{ secrets.CODECOV_TOKEN }} while also using id-token: write—verify this is intentional (OIDC-only vs token usage).
  3. Supply-chain risk in NEAR integration: cargo-near installed via curl ... | sh; consider pinning/validating the installer or using a safer installation mechanism.
  4. full-required-gate semantics: validate the “required vs skipped” behavior for NEAR/Soroban/Feature Matrix/Coverage aligns with desired correctness (it currently treats skipped as non-failing but fails on failure/cancelled when required).
  5. Path filters completeness: ensure the dorny/paths-filter patterns fully cover every code path that should trigger NEAR/Soroban/Feature Matrix tests (especially scripts and contract subtrees).

Walkthrough

Updates the Rust cache action with per-job shared keys and conditional saves. Restructures the test workflow with run_full_tests and run_coverage inputs, a changes path-filter job, a new fast-tests job, conditional Soroban/feature-matrix jobs, updated coverage gating with OIDC, and a full-required-gate enforcement job.

Changes

CI Gating and Test Restructuring

Layer / File(s) Summary
Rust cache action: per-job shared key and conditional save
.github/actions/rust/action.yml
save-if now only saves cache on PRs where the head repo matches the base repo; shared-key changed from "rust-cache" to "rust-${{ runner.os }}-${{ github.job }}".
Workflow inputs, permissions, changes path-filter job, and clippy update
.github/workflows/test.yml
Adds run_full_tests (both triggers) and run_coverage (dispatch); restricts top-level permissions to contents: read and pull-requests: read; introduces the changes job producing near_integration, soroban, and feature_matrix outputs via dorny/paths-filter; updates cargo clippy to use --all-features and enforce warnings as errors.
Soroban and feature-matrix job gating and toolchain setup
.github/workflows/test.yml
Both jobs gain needs: changes and if: guards on event type, run_full_tests, and the corresponding change-detection outputs. Soroban toolchain setup switches from the dedicated rust-toolchain action to the local Rust composite action with WASM targets plus rustup install 1.89.0.
fast-tests job and NEAR integration rewiring
.github/workflows/test.yml
New fast-tests job runs cargo nextest run --workspace --lib after disk cleanup. NEAR integration job (renamed to near-integration-tests) gains needs: changes and an if: gate based on event type, run_full_tests, and the near_integration output; its execution step is simplified to ./script/test.sh --workspace with a reduced env block.
Coverage job conditions, cleanup, and scoped llvm-cov command
.github/workflows/test.yml
Job-level permissions added with id-token: write for Codecov OIDC; if: condition updated to gate on run_coverage, skip_coverage, and event type; disk cleanup expanded; coverage command changed to cargo llvm-cov nextest --workspace --lib --lcov --output-path coverage.lcov with extended post-run artifact cleanup.
full-required-gate enforcement job
.github/workflows/test.yml
New job derives requires_full_ci and requires_coverage from event type and inputs, then checks result fields of NEAR integration, Soroban, feature-matrix, and coverage jobs against changes outputs to pass or fail the gate.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Templar-Protocol/contracts#469: Both PRs modify .github/workflows/test.yml's CI orchestration—especially the Soroban and coverage/test gating logic/toolchain setup—so the main PR's CI refactor is directly related to the retrieved PR's Soroban/toolchain unification changes.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-speed-pr472

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

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

@carrion256
carrion256 force-pushed the codex/ci-speed-pr472 branch from 21e0403 to 420a684 Compare June 16, 2026 16:17
@carrion256
carrion256 force-pushed the codex/ci-speed-pr472 branch from 420a684 to fa634e4 Compare June 16, 2026 16:31
@carrion256
carrion256 requested a review from peer2f00l June 17, 2026 08:22
@carrion256
carrion256 marked this pull request as ready for review June 17, 2026 08:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b883233eb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +541 to +543
require_success "Code Formatting" "$FORMAT_RESULT"
require_success "Code Linter" "$LINTER_RESULT"
require_success "Fast Tests" "$FAST_TEST_RESULT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require change detection before trusting path outputs

In this required gate, the job runs after failed dependencies via if: always(), but the mandatory checks never validate needs.changes.result. If checkout or dorny/paths-filter fails on a PR, the path-gated jobs are skipped because their outputs are unavailable, fail_if_failed accepts those skipped results, and the required gate can still pass without running the integration jobs that the changed paths would have required; add a require_success for Change Detection before trusting its outputs.

Useful? React with 👍 / 👎.

Comment on lines +90 to +95
soroban:
- 'contract/proxy-oracle/soroban/**'
- 'contract/vault/curator-primitives/**'
- 'contract/vault/soroban/**'
- 'script/soroban/**'
- 'tools/soroban-vault-cli/**'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include Soroban kernel dependencies in path gate

For PRs touching only shared Soroban kernel crates, this filter remains false because it watches contract/proxy-oracle/soroban/** and contract/vault/soroban/** but not the kernels those contracts compile. I checked contract/vault/soroban/Cargo.toml:19 and contract/proxy-oracle/soroban/contract/Cargo.toml:22 plus governance at contract/proxy-oracle/soroban/governance-contract/Cargo.toml:20; those packages depend on contract/vault/kernel, contract/proxy-oracle/kernel, and contract/proxy-oracle/governance-kernel, so kernel-only PRs skip the Soroban build/size gates that should catch ABI and wasm-size regressions.

Useful? React with 👍 / 👎.

@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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 6

🤖 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/test.yml:
- Around line 40-43: Remove the id-token: write permission from the
workflow-level permissions block, keeping only contents: read and pull-requests:
read at that level. Then add a permissions section to the coverage job
definition that includes id-token: write to scope this sensitive permission only
to the job that requires it for Codecov OIDC authentication.
- Around line 59-61: Replace the version tag `@v3` in the dorny/paths-filter
action with a pinned commit hash to improve supply chain security. Change the
action reference from `dorny/paths-filter@v3` to
`dorny/paths-filter@6852f92c20ea7fd3b0c25de3b5112db3a98da050` to ensure the
workflow always uses the specific verified commit rather than allowing the
maintainer to modify code under the tag.
- Around line 486-569: The gate script does not verify that the changes job
succeeded before proceeding with other validations. To fix this, add
CHANGES_RESULT variable to the env section to capture the result of
needs.changes.result, then call require_success with "Changes Detection" and the
CHANGES_RESULT variable at the beginning of the validation checks (after the
full_ci and coverage_required variables are set but before any other
require_success calls). Additionally, add explicit handling for the pull_request
event in the case statement that evaluates EVENT_NAME to ensure consistent
behavior across all event types.

In `@script/soroban/install-stellar-cli.sh`:
- Line 25: The INSTALL_MODE variable assignment currently silently defaults to
binary mode if an invalid STELLAR_CLI_INSTALL_MODE value is provided, which
masks configuration errors. After assigning INSTALL_MODE on line 25, add
explicit validation to check if the STELLAR_CLI_INSTALL_MODE environment
variable (when set) contains a valid value. If the value is invalid, immediately
exit the script with a clear error message. Apply the same validation logic to
the other location mentioned at lines 134-138 to ensure consistent validation
throughout the script.
- Around line 126-128: The issue is that the stellar-cli installation via cargo
install at line 126 doesn't ensure the stellar binary is accessible in the PATH
during verification at line 142. In shells where the Cargo bin directory isn't
automatically exported, the verification fails despite successful installation.
Fix this by explicitly adding the Cargo bin directory to PATH after the cargo
install command completes, ensuring that the subsequent verification check (the
stellar command) can locate the installed binary and prevent false failures from
occurring.
- Around line 121-123: Remove the error suppression mechanism `|| true` and
stderr redirection `2>/dev/null` from the rustup toolchain install command so
that failures are properly propagated. The success message using the `ok`
function should only be printed when the rustup toolchain install command
actually succeeds, not unconditionally. Modify the rustup toolchain install
invocation to allow the script to detect and handle actual installation failures
appropriately.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a4394d3d-e35e-4da6-9fdf-b5c8f6a628ea

📥 Commits

Reviewing files that changed from the base of the PR and between f2aede7 and b883233.

📒 Files selected for processing (3)
  • .github/actions/rust/action.yml
  • .github/workflows/test.yml
  • script/soroban/install-stellar-cli.sh

Comment thread .github/workflows/test.yml Outdated
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml Outdated
Comment thread script/soroban/install-stellar-cli.sh Outdated
Comment thread script/soroban/install-stellar-cli.sh Outdated
Comment on lines +121 to +123
info "Installing Rust ${RUST_TOOLCHAIN} toolchain (for CLI build only)..."
rustup toolchain install "${RUST_TOOLCHAIN}" --profile minimal 2>/dev/null || true
ok "Rust ${RUST_TOOLCHAIN} ready"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Do not mask Rust toolchain installation failures.

Line 122 uses || true, then Line 123 prints success unconditionally. This can hide the real failure cause and mislead troubleshooting.

Suggested fix
-    rustup toolchain install "${RUST_TOOLCHAIN}" --profile minimal 2>/dev/null || true
+    rustup toolchain install "${RUST_TOOLCHAIN}" --profile minimal
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
info "Installing Rust ${RUST_TOOLCHAIN} toolchain (for CLI build only)..."
rustup toolchain install "${RUST_TOOLCHAIN}" --profile minimal 2>/dev/null || true
ok "Rust ${RUST_TOOLCHAIN} ready"
info "Installing Rust ${RUST_TOOLCHAIN} toolchain (for CLI build only)..."
rustup toolchain install "${RUST_TOOLCHAIN}" --profile minimal
ok "Rust ${RUST_TOOLCHAIN} ready"
🤖 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 `@script/soroban/install-stellar-cli.sh` around lines 121 - 123, Remove the
error suppression mechanism `|| true` and stderr redirection `2>/dev/null` from
the rustup toolchain install command so that failures are properly propagated.
The success message using the `ok` function should only be printed when the
rustup toolchain install command actually succeeds, not unconditionally. Modify
the rustup toolchain install invocation to allow the script to detect and handle
actual installation failures appropriately.

Comment thread script/soroban/install-stellar-cli.sh Outdated
Comment on lines +126 to +128
RUSTUP_TOOLCHAIN="${RUST_TOOLCHAIN}" cargo install --locked "stellar-cli@${STELLAR_CLI_VERSION}"
ok "stellar-cli v${STELLAR_CLI_VERSION} installed"
}

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Source mode can fail verification even after a successful install.

Line 126 installs via Cargo, but verification at Line 142 depends on stellar being on PATH. In shells where Cargo bin isn’t pre-exported, this exits with failure despite install success.

Suggested fix
 install_source() {
@@
     info "Building stellar-cli v${STELLAR_CLI_VERSION} from source..."
     RUSTUP_TOOLCHAIN="${RUST_TOOLCHAIN}" cargo install --locked "stellar-cli@${STELLAR_CLI_VERSION}"
+    export PATH="$(install_dir):${PATH}"
     ok "stellar-cli v${STELLAR_CLI_VERSION} installed"
 }

Also applies to: 142-148

🤖 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 `@script/soroban/install-stellar-cli.sh` around lines 126 - 128, The issue is
that the stellar-cli installation via cargo install at line 126 doesn't ensure
the stellar binary is accessible in the PATH during verification at line 142. In
shells where the Cargo bin directory isn't automatically exported, the
verification fails despite successful installation. Fix this by explicitly
adding the Cargo bin directory to PATH after the cargo install command
completes, ensuring that the subsequent verification check (the stellar command)
can locate the installed binary and prevent false failures from occurring.

Comment thread .github/workflows/test.yml Outdated
Comment on lines +488 to +501
EVENT_NAME: ${{ github.event_name }}
RUN_FULL_TESTS: ${{ inputs.run_full_tests || 'false' }}
RUN_COVERAGE: ${{ inputs.run_coverage || 'false' }}
SKIP_COVERAGE: ${{ inputs.skip_coverage || 'false' }}
NEAR_CHANGED: ${{ needs.changes.outputs.near_integration }}
SOROBAN_CHANGED: ${{ needs.changes.outputs.soroban }}
FEATURE_MATRIX_CHANGED: ${{ needs.changes.outputs.feature_matrix }}
FORMAT_RESULT: ${{ needs['code-formatting'].result }}
LINTER_RESULT: ${{ needs['code-linter'].result }}
FAST_TEST_RESULT: ${{ needs['fast-tests'].result }}
NEAR_TEST_RESULT: ${{ needs['near-integration-tests'].result }}
SOROBAN_RESULT: ${{ needs.soroban.result }}
FEATURE_MATRIX_RESULT: ${{ needs['feature-matrix'].result }}
COVERAGE_RESULT: ${{ needs.coverage.result }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this part seems especially brittle, but idk, it might be fine if we just "throw AI at it" when we want to update it...?

Comment thread script/soroban/install-stellar-cli.sh Outdated

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/test.yml (2)

513-577: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Undefined variable EVENT_NAME in final echo statement.

Line 577 references ${EVENT_NAME} but this variable is not defined in the step's env block (lines 514-526). The echo will output an incomplete message.

🐛 Proposed fix

Add EVENT_NAME to the env block:

       - name: Evaluate required CI surface
         env:
+          EVENT_NAME: ${{ github.event_name }}
           NEAR_REQUIRED: ${{ needs.changes.outputs.run_near_integration }}
           SOROBAN_REQUIRED: ${{ needs.changes.outputs.run_soroban }}
🤖 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/test.yml around lines 513 - 577, The final echo statement
in the "Evaluate required CI surface" step references the undefined variable
EVENT_NAME, which will result in an incomplete output message. Add EVENT_NAME to
the env block at the beginning of the step by defining it using the GitHub
Actions context variable that provides the event name (typically
github.event_name), so it can be properly referenced in the final echo statement
that currently outputs "Full required gate passed for ${EVENT_NAME}".

489-497: ⚠️ Potential issue | 🟡 Minor

Pin codecov/codecov-action to a commit hash for supply chain consistency.

All other third-party actions in this workflow are pinned to commit hashes (e.g., actions/checkout@34e..., dorny/paths-filter@d1c..., taiki-e/install-action@cde...), but codecov/[email protected] uses a version tag. For consistent supply chain security posture, pin to the commit hash: e53489f4d376d79066609109e7a95a29eb3740b1.

🤖 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/test.yml around lines 489 - 497, The
codecov/codecov-action step uses a version tag reference (v7.0.0) instead of a
commit hash for supply chain security consistency, while all other third-party
actions in this workflow are pinned to commit hashes. Replace the version tag in
the codecov/codecov-action uses statement with the commit hash
e53489f4d376d79066609109e7a95a29eb3740b1 to match the security posture of other
actions in the workflow.
🤖 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.

Outside diff comments:
In @.github/workflows/test.yml:
- Around line 513-577: The final echo statement in the "Evaluate required CI
surface" step references the undefined variable EVENT_NAME, which will result in
an incomplete output message. Add EVENT_NAME to the env block at the beginning
of the step by defining it using the GitHub Actions context variable that
provides the event name (typically github.event_name), so it can be properly
referenced in the final echo statement that currently outputs "Full required
gate passed for ${EVENT_NAME}".
- Around line 489-497: The codecov/codecov-action step uses a version tag
reference (v7.0.0) instead of a commit hash for supply chain security
consistency, while all other third-party actions in this workflow are pinned to
commit hashes. Replace the version tag in the codecov/codecov-action uses
statement with the commit hash e53489f4d376d79066609109e7a95a29eb3740b1 to match
the security posture of other actions in the workflow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5c3f443b-6908-48e7-a139-0db75720f717

📥 Commits

Reviewing files that changed from the base of the PR and between 7f0aa79 and 8da7174.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/test.yml (1)

66-105: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a global CI/toolchain surface to the path filters.

Right now, changes to .github/workflows/test.yml, .github/actions/rust/**, root Cargo.toml/Cargo.lock, .cargo/**, or Rust toolchain files do not match any gated surface. On PRs, that lets NEAR/Soroban/feature-matrix jobs skip and the required gate pass even though the CI/toolchain contract changed.

Suggested fix
       - name: Detect changed surfaces
         uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590
         id: filter
         with:
           filters: |
+            global_ci:
+              - '.github/workflows/test.yml'
+              - '.github/actions/rust/**'
+              - '.cargo/**'
+              - 'Cargo.toml'
+              - 'Cargo.lock'
+              - 'rust-toolchain'
+              - 'rust-toolchain.toml'
             near_integration:

Then expose global_ci and force all gated surfaces on when it is true:

     outputs:
+      global_ci: ${{ steps.filter.outputs.global_ci }}
       near_integration: ${{ steps.filter.outputs.near_integration }}
           NEAR_CHANGED: ${{ steps.filter.outputs.near_integration }}
           SOROBAN_CHANGED: ${{ steps.filter.outputs.soroban }}
           FEATURE_MATRIX_CHANGED: ${{ steps.filter.outputs.feature_matrix }}
+          GLOBAL_CI_CHANGED: ${{ steps.filter.outputs.global_ci }}
           [ "$NEAR_CHANGED" = "true" ] && run_near_integration=true
           [ "$SOROBAN_CHANGED" = "true" ] && run_soroban=true
           [ "$FEATURE_MATRIX_CHANGED" = "true" ] && run_feature_matrix=true
+          if [ "$GLOBAL_CI_CHANGED" = "true" ]; then
+            run_near_integration=true
+            run_soroban=true
+            run_feature_matrix=true
+          fi
🤖 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/test.yml around lines 66 - 105, Add a new filter entry
called global_ci within the filters section that includes all CI and
toolchain-related file paths such as .github/workflows/test.yml,
.github/actions/rust/**, root Cargo.toml and Cargo.lock, .cargo/**, and Rust
toolchain configuration files. Then modify the conditional logic for the
near_integration, soroban, and feature_matrix jobs so that they run not only
when their respective filter conditions are met, but also when the global_ci
filter is triggered, ensuring that changes to CI/toolchain infrastructure force
all gated test surfaces to execute.
🤖 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.

Outside diff comments:
In @.github/workflows/test.yml:
- Around line 66-105: Add a new filter entry called global_ci within the filters
section that includes all CI and toolchain-related file paths such as
.github/workflows/test.yml, .github/actions/rust/**, root Cargo.toml and
Cargo.lock, .cargo/**, and Rust toolchain configuration files. Then modify the
conditional logic for the near_integration, soroban, and feature_matrix jobs so
that they run not only when their respective filter conditions are met, but also
when the global_ci filter is triggered, ensuring that changes to CI/toolchain
infrastructure force all gated test surfaces to execute.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 999be786-2fbf-4e2f-99c3-5fbdab897242

📥 Commits

Reviewing files that changed from the base of the PR and between 8da7174 and 3d87dd7.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

@carrion256
carrion256 merged commit a0fc180 into dev Jun 17, 2026
15 checks passed
@carrion256
carrion256 deleted the codex/ci-speed-pr472 branch June 17, 2026 13:40
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.

2 participants