Skip to content

ci: select only affected jobs by Cargo scope - #329

Merged
proerror77 merged 1 commit into
mainfrom
codex/ci-job-scope-316
Jul 24, 2026
Merged

ci: select only affected jobs by Cargo scope#329
proerror77 merged 1 commit into
mainfrom
codex/ci-job-scope-316

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

Select Monorepo and Prediction Markets CI jobs from changed paths plus Cargo dependency identity while preserving fail-closed required checks and complete Research image validation for relevant main pushes.

Out of scope

Compiler caches, Docker image contents, ACR publication behavior, Rust/research/collector behavior, and branch-protection policy.

Dependencies and merge order

None.

Focused validation

  • .github/scripts/test-select-rust-ci-scope.sh
  • bash -n .github/scripts/select-rust-ci-scope.sh .github/scripts/test-select-rust-ci-scope.sh
  • shellcheck .github/scripts/select-rust-ci-scope.sh .github/scripts/test-select-rust-ci-scope.sh
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 .github/workflows/ci.yml .github/workflows/ploy-ci.yml
  • Live Cargo-metadata evaluator selection matched the expected exact job set.
  • Legacy job display-name comparison against origin/main was unchanged.
  • Counterexamples cover docs-only, frontend-only, collector-only, evaluator-only, shared Rust, Cargo.lock, Dockerfile, unknown Docker, unknown Prediction paths, mixed inputs, selector failure fallback, substring-safe job identity, and relevant main ACR/research-deployment image validation.
  • Matt Standards review: PASS. Matt Spec review: PASS.

Rollout and rollback

Rollout changes CI scheduling only; no runtime or publication behavior changes. Revert this PR to restore the prior workflow-wide scheduling and image-only selector.

Scope exception

None. The change is 20 files / 664 changed lines, below the repository split threshold.

Closes #316

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 053b0e25-dd7b-4e4f-9d10-2b04ad3d10a1

📥 Commits

Reviewing files that changed from the base of the PR and between 3b61804 and 7333ee8.

📒 Files selected for processing (20)
  • .github/scripts/fixtures/rust-ci-scope/acr-workflow.txt
  • .github/scripts/fixtures/rust-ci-scope/backtest.txt
  • .github/scripts/fixtures/rust-ci-scope/docs.txt
  • .github/scripts/fixtures/rust-ci-scope/evaluator.txt
  • .github/scripts/fixtures/rust-ci-scope/frontend.txt
  • .github/scripts/fixtures/rust-ci-scope/metadata.fixture
  • .github/scripts/fixtures/rust-ci-scope/mixed-prediction.txt
  • .github/scripts/fixtures/rust-ci-scope/prediction-lock.txt
  • .github/scripts/fixtures/rust-ci-scope/prediction-workflow.txt
  • .github/scripts/fixtures/rust-ci-scope/research-deployment.txt
  • .github/scripts/fixtures/rust-ci-scope/research-dockerfile.txt
  • .github/scripts/fixtures/rust-ci-scope/shared-prediction.txt
  • .github/scripts/fixtures/rust-ci-scope/unknown-docker.txt
  • .github/scripts/fixtures/rust-ci-scope/unknown-prediction.txt
  • .github/scripts/select-prediction-image-smoke.sh
  • .github/scripts/select-rust-ci-scope.sh
  • .github/scripts/test-select-prediction-image-smoke.sh
  • .github/scripts/test-select-rust-ci-scope.sh
  • .github/workflows/ci.yml
  • .github/workflows/ploy-ci.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-job-scope-316

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.

Comment thread .github/workflows/ci.yml
working-directory: rust_hft
steps:
- name: Checkout
uses: actions/checkout@v4

@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: 82c7f8e343

ℹ️ 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".

done

if [[ $needs_metadata == false ]]; then
[[ $toolchain == true ]] && select_job ci/rust

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the repository-wide safety scan

For changes that do not set toolchain—for example .github/workflows/docker-publish.yml, or the explicitly handled .github/workflows/acr-publish.yml—this emits no ci/rust job. The repository-wide Enforce Rust-only research and runtime source check in ci.yml is inside that job and previously ran on every Monorepo CI event, so such a PR can now add a prohibited Python runtime or workflow command while the selector and scope jobs pass. Keep ci/rust selected for these paths, or move the policy scan into an unconditional job.

AGENTS.md reference: AGENTS.md:L50-L54

Useful? React with 👍 / 👎.

Comment on lines +175 to +176
rust_hft/prediction-markets/*.md)
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Run policy tests for guarded Markdown changes

Because a Bash case pattern's * also spans /, this branch ignores every Markdown file anywhere under rust_hft/prediction-markets. However, tests/workspace_runtime_retirement.rs:1410-1427 explicitly rejects retired write commands in existing OpenClaw Markdown, and that test runs in ploy/integration-regressions; editing examples/openclaw/README.md to advertise one of those commands now produces jobs=,, and bypasses the counterexample. Do not blanket-ignore .md; select the integration policy test for guarded operational documents.

AGENTS.md reference: AGENTS.md:L50-L54

Useful? React with 👍 / 👎.

Comment on lines 219 to 223
deployment/aliyun/*)
control=true
toolchain=true
[[ $path == deployment/aliyun/research/* ]] && research_image_relevant=true
;;

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 Keep commit hygiene active for deployment PRs

For a pull request changing a non-Kubernetes path under deployment/aliyun/research/**, the Ploy workflow's path filter starts the workflow, but this case only sets legacy flags and never selects ploy/commit-hygiene; consequently all Ploy validation can skip that check. Before this commit, commit-hygiene was conditioned only on github.event_name == 'pull_request', so every such deployment PR rejected WIP, fixup, and squash commit subjects. Select commit hygiene for these admitted PR paths or leave that job unconditional.

Useful? React with 👍 / 👎.

Comment on lines +110 to +111
# Manual runs retain the complete build/package contract.
if [[ $event == workflow_dispatch ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Propagate push changed-file discovery failures

By limiting the unconditional full run to workflow_dispatch, branch pushes now enter the git diff process-substitution path. When github.event.before is unavailable locally—for example, it is all zeros on the first push creating develop, or an old pre-force-push commit was not fetched—git diff prints a fatal error, but the process substitution's status does not fail the outer shell; the selector exits 0 with jobs=,,. The scope job therefore treats selection as successful instead of applying its all-jobs fallback, leaving that main/develop push unvalidated. Capture and check the diff command's status before continuing, and handle an all-zero base explicitly.

AGENTS.md reference: AGENTS.md:L50-L54

Useful? React with 👍 / 👎.

Comment on lines +169 to +173
rust_hft/prediction-markets/ploy-frontend/*)
[[ $event == pull_request ]] && select_job ploy/commit-hygiene
select_job ploy/safety-scans
select_job ploy/frontend
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Run the execution-surface guard for frontend changes

For a frontend-only PR this branch selects the route scan and frontend build but not ploy/integration-regressions. That omitted job runs active_compatibility_source_has_no_authenticated_venue_execution_surface in tests/workspace_runtime_retirement.rs:1601-1645, which recursively scans active TypeScript, JavaScript, and Rust files for authenticated venue/order surfaces that the route scan does not cover. A direct authenticated order client added under ploy-frontend can therefore lint and build while the test designed to reject this authority bypass is skipped; select that guard for every active frontend execution-surface change or move it into the unconditional safety job.

AGENTS.md reference: AGENTS.md:L50-L54

Useful? React with 👍 / 👎.

@proerror77
proerror77 force-pushed the codex/ci-job-scope-316 branch from 82c7f8e to 7333ee8 Compare July 24, 2026 03:19
@proerror77
proerror77 merged commit 2b7a69e into main Jul 24, 2026
36 checks passed
@proerror77
proerror77 deleted the codex/ci-job-scope-316 branch July 24, 2026 08:44
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.

Select only affected CI jobs while preserving relevant release validation

2 participants