fix(ci): add path-aware PR checks #255

Merged
jwilger merged 4 commits from fix/path-aware-ci into main 2026-05-18 12:20:14 -07:00
Owner

Why:

  • Opencode and developer-harness-only changes should not require the full Rust application gate suite, but they should still run relevant opencode checks and receive semantic review.
  • See issue #252.

What:

  • Add a path-classification PR job that emits separate app_ci and opencode_ci routing outputs.
  • Gate Rust application jobs on application-path changes and gate opencode-test on opencode configuration/harness changes.
  • Classify .opencode/** and root opencode.json as opencode inputs, while defaulting to application CI when path detection is empty or uncertain.
  • Keep semantic-review available for PRs after path classification instead of requiring the full application gate set for opencode-only PRs.
  • Add ar-gateway workflow contract coverage for the path-aware CI behavior.

Validation:

  • cargo nextest run -p ar-gateway pr_ci_classifies_changed_paths_before_expensive_gates
  • cargo nextest run -p ar-gateway pr_ci_classifier_treats_root_opencode_json_as_opencode_and_fails_closed_to_app_ci_on_uncertain_diff
  • cargo nextest run -p ar-gateway --test ci_workflow_contract
  • just fmt
  • just ci

Closes #252

Why: - Opencode and developer-harness-only changes should not require the full Rust application gate suite, but they should still run relevant opencode checks and receive semantic review. - See issue #252. What: - Add a `path-classification` PR job that emits separate `app_ci` and `opencode_ci` routing outputs. - Gate Rust application jobs on application-path changes and gate `opencode-test` on opencode configuration/harness changes. - Classify `.opencode/**` and root `opencode.json` as opencode inputs, while defaulting to application CI when path detection is empty or uncertain. - Keep `semantic-review` available for PRs after path classification instead of requiring the full application gate set for opencode-only PRs. - Add ar-gateway workflow contract coverage for the path-aware CI behavior. Validation: - `cargo nextest run -p ar-gateway pr_ci_classifies_changed_paths_before_expensive_gates` - `cargo nextest run -p ar-gateway pr_ci_classifier_treats_root_opencode_json_as_opencode_and_fails_closed_to_app_ci_on_uncertain_diff` - `cargo nextest run -p ar-gateway --test ci_workflow_contract` - `just fmt` - `just ci` Closes #252
Why:\n- Opencode-only developer harness changes should not require the full Rust application CI suite, but PRs still need semantic review coverage.\n\nWhat:\n- Add a PR path-classification job and gate app/opencode checks from its outputs.\n- Cover the workflow contract with a focused ar-gateway test.\n\nValidation:\n- cargo nextest run -p ar-gateway pr_ci_classifies_changed_paths_before_expensive_gates
Why:\n- Root opencode.json changes should follow the same lightweight developer-harness path as .opencode changes, while uncertain diffs should remain conservative.\n\nWhat:\n- Classify opencode.json as opencode CI input.\n- Default app CI to true when changed-path detection cannot prove a lightweight route.\n\nValidation:\n- cargo nextest run -p ar-gateway pr_ci_classifier_treats_root_opencode_json_as_opencode_and_fails_closed_to_app_ci_on_uncertain_diff
Why:\n- The CI workflow contract additions should satisfy the repository formatting gate before PR review.\n\nWhat:\n- Apply cargo fmt to the workflow contract test file.\n\nValidation:\n- just fmt\n- cargo nextest run -p ar-gateway --test ci_workflow_contract
fix(test): satisfy workflow contract clippy
All checks were successful
CI / Classify changed paths (pull_request) Successful in 3s
CI / Format check (pull_request) Successful in 5s
CI / opencode plugin tests (pull_request) Has been skipped
CI / Build (pull_request) Successful in 33s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
CI / Clippy (pull_request) Successful in 41s
CI / Dependency policy (pull_request) Successful in 11s
CI / Test (pull_request) Successful in 54s
CI / Request auto_review semantic review (pull_request) Successful in 2s
auto_review auto_review: no findings
c0ca773631
Why:\n- The workflow contract test should pass the repository clippy gate with warnings denied.\n\nWhat:\n- Replace a constant-false assertion with an equivalent panic.\n\nValidation:\n- just fmt\n- cargo nextest run -p ar-gateway --test ci_workflow_contract
auto-review left a comment

This PR introduces a path-classification job to optimize CI checks by routing based on changed paths. It ensures that only relevant checks run for opencode and application changes, potentially reducing unnecessary CI load. The changes appear well-structured, but ensure that the path classification logic is thoroughly tested.

Walkthrough

  • .forgejo/workflows/ci.yml:
    • Introduced a path-classification job to determine which CI checks to run based on changed paths.
    • Updated existing jobs (fmt, clippy, test, deny, build, opencode-test) to depend on the path-classification job and run conditionally based on its outputs.
    • The semantic-review job now only depends on path-classification, which may affect its execution timing.
  • crates/ar-gateway/tests/ci_workflow_contract.rs:
    • Added tests to verify the behavior of the path-classification job and its integration with other CI jobs.
    • Ensured that the path-classification job correctly identifies opencode paths and defaults to application CI when uncertain.
This PR introduces a `path-classification` job to optimize CI checks by routing based on changed paths. It ensures that only relevant checks run for opencode and application changes, potentially reducing unnecessary CI load. The changes appear well-structured, but ensure that the path classification logic is thoroughly tested. ## Walkthrough - **.forgejo/workflows/ci.yml**: - Introduced a `path-classification` job to determine which CI checks to run based on changed paths. - Updated existing jobs (`fmt`, `clippy`, `test`, `deny`, `build`, `opencode-test`) to depend on the `path-classification` job and run conditionally based on its outputs. - The `semantic-review` job now only depends on `path-classification`, which may affect its execution timing. - **crates/ar-gateway/tests/ci_workflow_contract.rs**: - Added tests to verify the behavior of the `path-classification` job and its integration with other CI jobs. - Ensured that the `path-classification` job correctly identifies opencode paths and defaults to application CI when uncertain.
jwilger deleted branch fix/path-aware-ci 2026-05-18 12:20:15 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!255
No description provided.