-
Notifications
You must be signed in to change notification settings - Fork 0
fix(strix): add missing github-token fallback for self-target status publish #1441
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
Open
seonghobae
wants to merge
7
commits into
main
Choose a base branch
from
fix/strix-self-target-status-token-403-20260830
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−12
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
698ffde
fix(strix): add missing github-token fallback for self-target status …
claude bec60ca
test(strix): update GITHUB_STATUS_TOKEN smoke assertions for the seco…
claude d877886
Merge branch 'main' into fix/strix-self-target-status-token-403-20260830
seonghobae 9a764e5
Merge branch 'main' into fix/strix-self-target-status-token-403-20260830
seonghobae f4b794e
Merge branch 'main' into fix/strix-self-target-status-token-403-20260830
seonghobae 7a94578
Merge branch 'main' into fix/strix-self-target-status-token-403-20260830
claude 3bca264
fix(ci): bound required-workflow-bootstrap awk extraction to its own job
claude 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1091,6 +1091,15 @@ jobs: | |
| - name: Publish same-head manual Strix status | ||
| env: | ||
| TARGET_APP_STATUS_TOKEN: ${{ steps.target_app_token.outputs.token || '' }} | ||
| # Same conditional as the strix job's own GITHUB_STATUS_TOKEN above: | ||
| # github.token only has statuses:write on THIS repository, so it is | ||
| # only worth offering as a publish credential when the dispatch | ||
| # target is this repository itself (the self-referential case | ||
| # target-app-token cannot cover -- the OpenCode app is scoped to | ||
| # sibling repos, not to ContextualWisdomLab/.github as its own | ||
| # target). Empty for a cross-repo target, matching post_strix_status's | ||
| # existing empty-token skip. | ||
| GITHUB_STATUS_TOKEN: ${{ (github.event.client_payload.target_repository == '' || github.event.client_payload.target_repository == github.repository) && github.token || '' }} | ||
|
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. |
||
| GITHUB_STATUS_READ_TOKEN: ${{ github.token }} | ||
| PR_REVIEW_MERGE_STATUS_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || '' }} | ||
| OPENCODE_APPROVE_STATUS_TOKEN: ${{ secrets.OPENCODE_APPROVE_TOKEN || '' }} | ||
|
|
@@ -1202,6 +1211,9 @@ jobs: | |
| if post_strix_status "target-app-token" "$TARGET_APP_STATUS_TOKEN"; then | ||
| exit 0 | ||
| fi | ||
| if post_strix_status "github-token" "$GITHUB_STATUS_TOKEN"; then | ||
| exit 0 | ||
| fi | ||
|
Comment on lines
+1214
to
+1216
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. |
||
| if post_strix_status "pr-review-merge-token" "$PR_REVIEW_MERGE_STATUS_TOKEN"; then | ||
| exit 0 | ||
| fi | ||
|
|
||
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
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 |
|---|---|---|
|
|
@@ -206,8 +206,29 @@ assert_strix_workflow_pr_trigger_hardened() { | |
| assert_file_contains "$workflow_file" "default-branch repository_dispatch evidence cannot cancel" "strix workflow documents manual evidence isolation from branch protection contexts" | ||
| assert_file_contains "$workflow_file" "re-dispatches exact-head evidence" "strix workflow documents current-head queue recovery" | ||
| assert_file_contains "$workflow_file" "refs/pull/<n>/head has already advanced before this queued run starts" "strix workflow documents stale scan queue avoidance" | ||
| # Two declarations as of 2026-08-30: the strix job's own inline status | ||
| # publish, and publish-manual-pr-evidence-status's -- the latter added a | ||
| # github-token fallback for the self-referential case where .github is | ||
| # the repository_dispatch target of its own Strix run (target-app-token | ||
| # is scoped for sibling repositories and always 403s there). Both must | ||
| # stay byte-identical same-repository conditionals, not merely | ||
| # same-named: a third assertion below pins the exact conditional | ||
| # expression to the same count so a divergent copy (e.g. a typo'd | ||
| # comparison, or one job's copy missing the || github.repository | ||
| # fallback) fails closed here instead of only in the field the next | ||
| # time .github dispatches Strix at itself. | ||
| status_token_count="$(grep -c '^[[:space:]]*GITHUB_STATUS_TOKEN:' "$workflow_file")" | ||
| assert_equals "1" "$status_token_count" "strix workflow defines GITHUB_STATUS_TOKEN once so GitHub can parse repository_dispatch" | ||
| assert_equals "2" "$status_token_count" "strix workflow defines GITHUB_STATUS_TOKEN exactly twice, once per status-publishing job" | ||
| status_token_conditional_count="$(grep -c "GITHUB_STATUS_TOKEN: \${{ (github.event.client_payload.target_repository == '' || github.event.client_payload.target_repository == github.repository) && github.token || '' }}" "$workflow_file")" | ||
| assert_equals "2" "$status_token_conditional_count" "both GITHUB_STATUS_TOKEN declarations use the identical same-repository conditional" | ||
| # Three invocations, not two: the strix job's own inline publish tries | ||
| # the github-token fallback twice (once mid-chain, once as the final | ||
| # last-resort retry after every other credential has failed), while | ||
| # publish-manual-pr-evidence-status tries it once. Both jobs actually | ||
| # consuming their own declared GITHUB_STATUS_TOKEN (not just declaring | ||
| # and ignoring it) is the property under test here. | ||
| github_status_token_fallback_count="$(grep -c 'post_strix_status "github-token" "\$GITHUB_STATUS_TOKEN"' "$workflow_file")" | ||
| assert_equals "3" "$github_status_token_fallback_count" "both status-publishing jobs actually invoke their own GITHUB_STATUS_TOKEN fallback, not just declare it" | ||
|
Comment on lines
220
to
+231
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. |
||
| assert_file_not_contains "$workflow_file" "github.event.pull_request.number == 240" "strix workflow must not hard-code repository-specific PR bypasses" | ||
| assert_file_contains "$workflow_file" "models: read" "strix workflow grants only the GitHub Models read permission needed for Strix" | ||
| assert_file_contains "$workflow_file" "actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0" "strix workflow pins actions/setup-python" | ||
|
|
@@ -522,7 +543,7 @@ 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 | ||
| if awk '/^ required-workflow-bootstrap:$/{p=1; print; next} p && /^ [A-Za-z0-9_-]+:/{exit} p' "$bootstrap_file" | grep -q '^[[:space:]]*if:'; then | ||
| record_failure "opencode required workflow bootstrap must not depend on required-workflow event payload fields" | ||
| fi | ||
| assert_file_contains "$workflow_file" 'github.event.client_payload.target_repository || github.repository' "opencode review scopes concurrency by target repository" | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.