-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): remove orphaned OpenCode dispatch bootstrap on current main #1619
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
seonghobae
merged 15 commits into
main
from
fix/current-main-remove-opencode-dispatch-bootstrap-20260902
Sep 1, 2026
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fce0c0e
chore(ci): remove orphaned OpenCode dispatch bootstrap
seonghobae 1f0c49b
merge(main): preserve metadata integration before bootstrap cleanup
seonghobae 29b731a
ci: run bounded PR 1619 causal repair
seonghobae 5f190b8
ci: make PR 1619 helper expression-safe
seonghobae 84d0fc7
ci: reconstruct PR 1619 repair from current main
seonghobae 7dcd52f
ci(opencode): make causal repair exact-head safe
seonghobae bf18aae
chore(ci): remove failed temporary PR 1619 writer
e95a90f
ci(opencode): repair same-repo status authority on exact head
seonghobae dd5ad8e
ci: add exact-head PR 1619 restack writer
seonghobae 2e2abc8
ci(opencode): make PR 1619 restack writer self-contained
seonghobae 9bda471
chore(ci): remove failed PR 1619 restack writer
0a3ac6b
ci: rebuild PR 1619 repair from live main
seonghobae fc71c0a
fix(opencode): land verified live-main bootstrap cleanup
seonghobae c8b2fd4
fix(ci): make PR 1619 live-main repair fail-closed and exact
seonghobae 66046ec
chore(ci): reconcile PR 1619 on protected main
seonghobae 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 |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| name: Temporary PR 1619 causal repair | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - fix/current-main-remove-opencode-dispatch-bootstrap-20260902 | ||
| paths: | ||
| - .github/workflows/tmp-pr1619-causal-repair.yml | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: tmp-pr1619-causal-repair | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| repair: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Check out exact repair head | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Reconstruct intended delta from live protected main and remove helper | ||
| shell: bash | ||
| env: | ||
| EXPECTED_REF: fix/current-main-remove-opencode-dispatch-bootstrap-20260902 | ||
| run: | | ||
| set -euo pipefail | ||
| cleanup_on_failure() { | ||
| rc="$?" | ||
| if [ "$rc" -ne 0 ]; then | ||
| trap - EXIT | ||
| git reset --hard "${GITHUB_SHA}" | ||
| rm -f .github/workflows/tmp-pr1619-causal-repair.yml | ||
| git config user.name 'contextualwisdomlab-automation' | ||
| git config user.email 'contextualwisdomlab-automation@users.noreply.github.com' | ||
| git add .github/workflows/tmp-pr1619-causal-repair.yml | ||
| if ! git diff --cached --quiet; then | ||
| git commit -m 'chore(ci): remove failed temporary PR 1619 writer' | ||
| git fetch origin "${EXPECTED_REF}" | ||
| if [ "$(git rev-parse FETCH_HEAD)" = "${GITHUB_SHA}" ]; then | ||
| git push origin "HEAD:${EXPECTED_REF}" | ||
| else | ||
| echo '::error::Writer branch moved; refusing cleanup push.' | ||
| fi | ||
| fi | ||
| fi | ||
| exit "$rc" | ||
| } | ||
| trap cleanup_on_failure EXIT | ||
|
|
||
| test "${GITHUB_REF_NAME}" = "${EXPECTED_REF}" | ||
| test "$(git rev-parse HEAD)" = "${GITHUB_SHA}" | ||
|
|
||
| git fetch origin main | ||
| main_sha="$(git rev-parse FETCH_HEAD)" | ||
| test -n "$main_sha" | ||
| git fetch origin "${EXPECTED_REF}" | ||
| test "$(git rev-parse FETCH_HEAD)" = "${GITHUB_SHA}" | ||
|
|
||
| # Reconstruct the durable files from current protected main, then | ||
| # reapply only PR #1619's still-valid semantic delta. This discards the | ||
| # stale same-repository credential regression while preserving current main. | ||
| git checkout "$main_sha" -- \ | ||
| .github/workflows/opencode-review-dispatch.yml \ | ||
| tests/test_opencode_agent_contract.py \ | ||
| tests/test_pr_review_autofix_nvidia_nim_contract.py | ||
|
|
||
| python - <<'PY' | ||
| from pathlib import Path | ||
|
|
||
| workflow_path = Path('.github/workflows/opencode-review-dispatch.yml') | ||
| workflow = workflow_path.read_text(encoding='utf-8') | ||
| bootstrap = ''' required-workflow-bootstrap:\n name: required-workflow-bootstrap\n runs-on: ubuntu-latest\n steps:\n - run: echo "OpenCode repository-dispatch review run materialized."\n\n''' | ||
| if workflow.count(bootstrap) != 1: | ||
| raise SystemExit('current main bootstrap shape changed; refusing lossy mutation') | ||
| workflow = workflow.replace(bootstrap, '', 1) | ||
| if 'required-workflow-bootstrap:' in workflow: | ||
| raise SystemExit('orphaned dispatch bootstrap still present') | ||
| workflow_path.write_text(workflow, encoding='utf-8') | ||
|
|
||
| test_path = Path('tests/test_opencode_agent_contract.py') | ||
| test_text = test_path.read_text(encoding='utf-8') | ||
| old = ''' assert "required-workflow-bootstrap:" in workflow\n assert "OpenCode repository-dispatch review run materialized." in workflow\n bootstrap_start = workflow.index(" required-workflow-bootstrap:\\n")\n bootstrap_end = workflow.index("\\n validate-pr-metadata:", bootstrap_start)\n bootstrap_job = workflow[bootstrap_start:bootstrap_end]\n assert "\\n if:" not in bootstrap_job\n''' | ||
| new = ''' # This repository_dispatch-only workflow is not the org-required\n # pull_request_target entrypoint, so an unconditional bootstrap job here only\n # consumes Actions capacity without providing authoritative review evidence.\n assert "required-workflow-bootstrap:" not in workflow\n''' | ||
| if test_text.count(old) != 1: | ||
| raise SystemExit('current main bootstrap contract test shape changed; refusing mutation') | ||
| test_path.write_text(test_text.replace(old, new, 1), encoding='utf-8') | ||
| PY | ||
|
|
||
| workflow_blob="$(git hash-object .github/workflows/opencode-review-dispatch.yml)" | ||
| python - "$workflow_blob" <<'PY' | ||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| blob = sys.argv[1] | ||
| path = Path('tests/test_pr_review_autofix_nvidia_nim_contract.py') | ||
| text = path.read_text(encoding='utf-8') | ||
| text, count = re.subn( | ||
| r'REVIEW_DISPATCH_BLOB_SHA = "[0-9a-f]{40}"', | ||
| f'REVIEW_DISPATCH_BLOB_SHA = "{blob}"', | ||
| text, | ||
| count=1, | ||
| ) | ||
| if count != 1: | ||
| raise SystemExit('unable to update exact dispatch blob contract') | ||
| path.write_text(text, encoding='utf-8') | ||
| PY | ||
|
|
||
| PYTHONPATH=. python -m pytest -q \ | ||
| tests/test_opencode_agent_contract.py \ | ||
| tests/test_pr_review_autofix_nvidia_nim_contract.py | ||
| git diff --check | ||
|
|
||
| rm .github/workflows/tmp-pr1619-causal-repair.yml | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Outdated
|
||
| test ! -e .github/workflows/tmp-pr1619-causal-repair.yml | ||
| git diff --check | ||
|
|
||
| git config user.name 'contextualwisdomlab-automation' | ||
| git config user.email 'contextualwisdomlab-automation@users.noreply.github.com' | ||
| git add .github/workflows/opencode-review-dispatch.yml \ | ||
| tests/test_opencode_agent_contract.py \ | ||
| tests/test_pr_review_autofix_nvidia_nim_contract.py \ | ||
| .github/workflows/tmp-pr1619-causal-repair.yml | ||
| git commit -m 'fix(opencode): reconstruct bootstrap removal from current main' | ||
| git fetch origin "${EXPECTED_REF}" | ||
| test "$(git rev-parse FETCH_HEAD)" = "${GITHUB_SHA}" | ||
| git push origin "HEAD:${EXPECTED_REF}" | ||
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
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.