-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): correct strix quick-gate opencode fuzz support-file case pattern #1499
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,6 +96,13 @@ assert_file_not_contains() { | |
| fi | ||
| } | ||
|
|
||
| required_workflow_bootstrap_has_if() { | ||
| local bootstrap_file="$1" | ||
|
|
||
| awk '/^ required-workflow-bootstrap:$/{p=1; print; next} p && /^ [A-Za-z0-9_-]+:/{exit} p' "$bootstrap_file" | | ||
| grep '^[[:space:]]*if:' >/dev/null | ||
|
Comment on lines
+102
to
+103
Contributor
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. |
||
| } | ||
|
|
||
| seal_opencode_test_artifacts() { | ||
| local runner_temp="$1" | ||
| local head_sha="$2" | ||
|
|
@@ -522,9 +529,31 @@ assert_opencode_review_uses_codegraph_and_contextual_orchestrator() { | |
| assert_file_not_contains "$workflow_file" "Wait for trusted OpenCode approval review" "opencode pull_request bridge was removed to avoid duplicate required-check resource use" | ||
| assert_file_not_contains "$workflow_file" "Trusted OpenCode requested changes for head" "opencode pull_request bridge no longer reconsumes stale trusted review state" | ||
| assert_file_not_contains "$workflow_file" "github.event.pull_request.number == 240" "opencode review workflow must not hard-code repository-specific PR bypasses" | ||
| if awk '/^ required-workflow-bootstrap:$/,/^[^ ]/' "$bootstrap_file" | grep -q '^[[:space:]]*if:'; then | ||
| # Match against the full awk output rather than letting `grep -q` close its | ||
| # end of the pipe on the first match: a large bootstrap job's piped output | ||
| # can exceed the OS pipe buffer, and `grep -q`'s early exit can SIGPIPE the | ||
| # still-writing awk producer. Under `set -o pipefail` (top of this file) | ||
| # that SIGPIPE (128+13=141) outranks grep's own 0 exit, so the `if` | ||
| # incorrectly takes the "no match" branch even though the forbidden `if:` | ||
| # key was found. Dropping `-q` makes grep read to completion, so it never | ||
| # closes the pipe early and the real exit status is preserved. | ||
| if required_workflow_bootstrap_has_if "$bootstrap_file"; then | ||
| record_failure "opencode required workflow bootstrap must not depend on required-workflow event payload fields" | ||
| fi | ||
| local large_bootstrap_fixture | ||
| local fixture_line | ||
| large_bootstrap_fixture="$(mktemp)" | ||
| { | ||
| printf '%s\n' 'jobs:' ' required-workflow-bootstrap:' ' if: forbidden' | ||
| for ((fixture_line = 0; fixture_line < 20000; fixture_line++)); do | ||
| printf '%s\n' ' # padding forces the producer past the pipe buffer' | ||
| done | ||
| printf '%s\n' ' next-job:' ' runs-on: ubuntu-latest' | ||
| } >"$large_bootstrap_fixture" | ||
| if ! required_workflow_bootstrap_has_if "$large_bootstrap_fixture"; then | ||
| record_failure "opencode required workflow bootstrap condition detection must survive a job block larger than the pipe buffer" | ||
| fi | ||
| rm -f "$large_bootstrap_fixture" | ||
| assert_file_contains "$workflow_file" 'github.event.client_payload.target_repository || github.repository' "opencode review scopes concurrency by target repository" | ||
| assert_file_contains "$workflow_file" "format('pr-{0}', github.event.client_payload.pr_number)" "opencode review scopes repository_dispatch concurrency by current PR" | ||
| assert_file_not_contains "$workflow_file" "format('pr-{0}-{1}'" "opencode review does not keep stale head-specific concurrency groups" | ||
|
|
@@ -5347,6 +5376,14 @@ EOS | |
| echo "Error: PR changed-file scope missing CI support dependency ($target_path)" >&2 | ||
| exit 55 | ||
| ;; | ||
| pr-changed-scope-includes-opencode-normalizer) | ||
| if [ -f "$target_path/fuzz/fuzz_opencode_review_normalize_output.py" ] && [ -f "$target_path/scripts/ci/opencode_review_normalize_output.py" ]; then | ||
| echo "scan ok with opencode normalizer support dependency" | ||
| exit 0 | ||
| fi | ||
| echo "Error: PR changed-file scope missing opencode normalizer support dependency ($target_path)" >&2 | ||
| exit 64 | ||
| ;; | ||
| pr-deployment-scope-entrypoint-context) | ||
| if [ ! -f "$target_path/Dockerfile" ]; then | ||
| echo "Error: deployment scope missing Dockerfile ($target_path)" >&2 | ||
|
|
@@ -5544,6 +5581,10 @@ EOS | |
| echo 'def real_changed_endpoint(): pass' >"$repo_root_dir/backend/api/emails.py" | ||
| elif [ "$scenario" = "pr-changed-scope-bounded" ]; then | ||
| echo 'class Unrelated {}' >"$repo_root_dir/sync-module-system/smart-crawling-common/src/main/java/org/empasy/sync/common/system/util/JwtUtil.java" | ||
| elif [ "$scenario" = "pr-changed-scope-includes-opencode-normalizer" ]; then | ||
| mkdir -p "$repo_root_dir/fuzz" | ||
| echo 'from scripts.ci import opencode_review_normalize_output as normalizer' >"$repo_root_dir/fuzz/fuzz_opencode_review_normalize_output.py" | ||
| echo 'def iter_json_objects(text): return []' >"$repo_root_dir/scripts/ci/opencode_review_normalize_output.py" | ||
| elif [ "$scenario" = "pr-python-scope-context" ]; then | ||
| mkdir -p "$repo_root_dir/backend/api" "$repo_root_dir/backend/core" "$repo_root_dir/backend/db" "$repo_root_dir/backend/services" | ||
| touch "$repo_root_dir/backend/api/__init__.py" | ||
|
|
@@ -11807,6 +11848,32 @@ run_gate_case "pr-changed-scope-includes-ci-dependency" \ | |
| "pull_request" \ | ||
| "scripts/ci/strix_quick_gate.sh" | ||
|
|
||
| # The real, live Atheris fuzz target that imports | ||
| # scripts/ci/opencode_review_normalize_output.py is | ||
| # fuzz/fuzz_opencode_review_normalize_output.py (not the deleted | ||
| # fuzz/fuzz_opencode_normalize_output.py duplicate). A PR that changes only | ||
| # that fuzz target must still pull the normalizer module into scan scope. | ||
| run_gate_case "pr-changed-scope-includes-opencode-normalizer" \ | ||
| "openai/gpt-4o-mini" \ | ||
| "" \ | ||
| "0" \ | ||
| "scan ok with opencode normalizer support dependency" \ | ||
| "1" \ | ||
| "openai/gpt-4o-mini" \ | ||
| "https://example.invalid" \ | ||
| "vertex_ai" \ | ||
| "__DEFAULT__" \ | ||
| "" \ | ||
| "0" \ | ||
| "CRITICAL" \ | ||
| "0" \ | ||
| "" \ | ||
| "" \ | ||
| "1200" \ | ||
| "0" \ | ||
| "pull_request" \ | ||
| "fuzz/fuzz_opencode_review_normalize_output.py" | ||
|
|
||
| run_gate_case "pr-ci-test-harness-only-skip" \ | ||
| "openai/gpt-4o-mini" \ | ||
| "" \ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🟡 Legacy fuzz target loses scan dependency
When a PR changes the still-present
fuzz_opencode_normalize_output.py, Strix omits its imported normalizer. The scoped review therefore lacks required context.Was this helpful? React with 👍 or 👎 to provide feedback.