-
Notifications
You must be signed in to change notification settings - Fork 103
feat(dispatch): route /fs-plan-tests to the qualityflow stage #6284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| # lint-workflow-size: max-lines=610 | ||
| # lint-workflow-size: max-lines=625 | ||
| # Dispatcher workflow that routes events to agent workflows based on stage. | ||
| # Routing logic determines the stage from event context — the shim only | ||
| # forwards the raw event. Adding a new stage requires only a case branch | ||
|
|
@@ -163,6 +163,15 @@ jobs: | |
| STAGE="prioritize" | ||
| fi | ||
| ;; | ||
| /fs-plan-tests) | ||
| # QualityFlow custom agent. Mirrors its harness CEL trigger | ||
| # (change_proposal, non-fork); fork gate is in "Resolve PR | ||
| # head" below. Interim until CEL dispatch is primary (#2902). | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM — Because bash Suggestion: reorder to check |
||
| && [[ "${ISSUE_HAS_PR}" == "true" ]]; then | ||
| STAGE="qualityflow" | ||
| fi | ||
|
Comment on lines
+166
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. /fs-plan-tests routing out-of-sync internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml adds routing for /fs-plan-tests to STAGE="qualityflow", but .github/workflows/reusable-dispatch.yml does not implement the same routing (and related stage handling), violating the requirement to keep the per-org and per-repo dispatch workflows in sync. This drift makes /fs-plan-tests behave differently across install modes and can result in per-repo dispatch being skipped when STAGE remains empty. Agent Prompt
|
||
| ;; | ||
| *) | ||
| # Intentionally weaker gate: allows external reporters to | ||
| # re-trigger triage by providing clarification on needs-info | ||
|
|
@@ -423,7 +432,9 @@ jobs: | |
| set -euo pipefail | ||
| STAGE_ROLE="$STAGE" | ||
| case "$STAGE" in | ||
| code|fix) STAGE_ROLE="coder" ;; | ||
| # qualityflow declares "role: coder" in its harness — it commits | ||
| # generated tests to the PR branch, same trust level as code/fix. | ||
| code|fix|qualityflow) STAGE_ROLE="coder" ;; | ||
| esac | ||
|
|
||
| ROLES=$(yq '.defaults.roles[]' config.yaml 2>/dev/null || echo "") | ||
|
|
@@ -477,18 +488,19 @@ jobs: | |
| --jq '{number, html_url, | ||
| head: {ref: .head.ref, sha: .head.sha, repo: {full_name: .head.repo.full_name}}, | ||
| base: {ref: .base.ref, repo: {full_name: .base.repo.full_name}}}') || { | ||
| if [[ "${STAGE}" =~ ^(fix|review)$ ]]; then | ||
| if [[ "${STAGE}" =~ ^(fix|review|qualityflow)$ ]]; then | ||
| echo "::error::Failed to fetch PR #${PR_NUMBER} head info" | ||
| exit 1 | ||
| fi | ||
| echo "::warning::Failed to fetch PR #${PR_NUMBER} head info — continuing without PR context" | ||
| exit 0 | ||
| } | ||
| if [[ "${STAGE}" == "fix" ]]; then | ||
| # Mutating agents that push to the PR branch must not run on forks. | ||
| if [[ "${STAGE}" =~ ^(fix|qualityflow)$ ]]; then | ||
| HEAD_REPO=$(printf '%s' "${PR_JSON}" | jq -r '.head.repo.full_name') | ||
| BASE_REPO=$(printf '%s' "${PR_JSON}" | jq -r '.base.repo.full_name') | ||
| if [[ "${HEAD_REPO}" != "${BASE_REPO}" ]]; then | ||
| echo "::error::Fork PR detected (head=${HEAD_REPO}, base=${BASE_REPO}) — fix agent blocked" | ||
| echo "::error::Fork PR detected (head=${HEAD_REPO}, base=${BASE_REPO}) — ${STAGE} agent blocked" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEDIUM — No test coverage added for the new
/fs-plan-testsrouting or its gatesThe diff only touches dispatch.yml and the lint-workflow-size max-lines directive;
internal/scaffold/workflow_call_alignment_test.gogains no new test cases. The PR description substitutes an ad hoc, out-of-repo script run (a manual verification table) for actual in-repo coverage, and offers to port it into the behaviour-test harness later. As-is, nothing in the Go test suite asserts/fs-plan-testsroutes to stagequalityflow, requires write-level (not triage) auth, requiresISSUE_HAS_PR, fails closed on PR-head fetch failure for the qualityflow stage, or is blocked on fork PRs by the extended regex.Suggestion: add unit test cases mirroring existing
/fs-fix/-reviewcoverage inworkflow_call_alignment_test.go: assert/fs-plan-testsrequires write-level auth, requiresISSUE_HAS_PR == true, fails closed (exit 1) on PR-head fetch failure, and is blocked on fork PRs via the same regex as fix/qualityflow.