ci: add GitHub Actions workflow + tests for new code from PRs #1, #2, #3#4
Merged
JohnnyVicious merged 1 commit intomainfrom Apr 12, 2026
Merged
ci: add GitHub Actions workflow + tests for new code from PRs #1, #2, #3#4JohnnyVicious merged 1 commit intomainfrom
JohnnyVicious merged 1 commit intomainfrom
Conversation
Adds: * `.github/workflows/ci.yml` — adapted from openai/codex-plugin-cc's pull-request-ci.yml. Runs on every PR and on pushes to main, on Node 22, syntax-checks all `.mjs` companion scripts via `node --check`, and runs the full test suite (`npm test`). Pinned action SHAs match codex's workflow for parity. * `package-lock.json` — generated so CI can use `npm ci` for reproducible installs (was missing in upstream tasict/opencode-plugin-cc). * `tests/git.test.mjs` — 11 new cases for `detectPrReference`, covering positive matches (`PR #N`, `pr #N`, `PR N`, embedded inside longer focus text), negatives (bare `#N` issue refs, plain text, empty/null), and the strip-from-focus workflow used by handleAdversarialReview. * `tests/process.test.mjs` — 7 new cases for `findOpencodeAuthFile` and `getConfiguredProviders`, covering valid auth.json with one or many providers, empty object, malformed JSON, JSON array, JSON null, and the XDG_DATA_HOME-first lookup order. Tests override XDG_DATA_HOME so they read fixtures from a tmp dir instead of the developer's real ~/.local/share/opencode/auth.json. Test count: 39 -> 57. All passing on a clean `npm ci` install. The "missing auth.json" case is intentionally not asserted because findOpencodeAuthFile falls through to platform-default paths (~/.local/share/opencode/auth.json on Linux) which may legitimately exist on a developer machine.
e2988eb to
287d447
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes the gap with codex-plugin-cc on CI and test coverage for the new code shipped in PRs #1, #2, #3.
CI workflow
.github/workflows/ci.yml, adapted fromopenai/codex-plugin-cc'spull-request-ci.yml. Pinned action SHAs match codex's workflow for parity.main, on Node 22.node --checkfor every.mjscompanion script, thennpm test.package-lock.jsonsonpm cican run reproducibly (the upstream repo was missing one).New tests (39 → 57, all passing on clean
npm ci)tests/git.test.mjsdetectPrReference— positive matches (PR #N,pr #N,PR N, embedded refs), negatives (bare#123issue refs, plain text, empty/null), and the strip-from-focus workflow used byhandleAdversarialReview.tests/process.test.mjsfindOpencodeAuthFile(XDG_DATA_HOME-first lookup) andgetConfiguredProviders(one provider, multiple, empty{}, malformed JSON, JSON array, JSON null). OverridesXDG_DATA_HOMEso tests read fixtures from a tmp dir, not the developer's real~/.local/share/opencode/auth.json.The "missing auth.json" case is intentionally not asserted, because
findOpencodeAuthFilefalls through to platform-default paths (~/.local/share/opencode/auth.jsonon Linux) which may legitimately exist on a developer machine and would make the assertion non-portable.Branch structure (please read)
This branch is stacked on top of #1, #2, and #3 via merge commits, because the new tests depend on code that only exists on those feature branches:
52bc31cMergefix/model-passthrough167c04bMergefix/pr-fetch(resolves trivialvalueOptionsconflict between fix(review): thread --model through review handlers #1 and feat(review): support reviewing GitHub PRs via --pr / focus auto-detect #2 by combining"model"and"pr"into one array)83c1260Mergefix/setup-provider-detectionAfter #1, #2, #3 merge into
main, this PR's diff will collapse to just the CI workflow + new test files + lockfile. Until then GitHub will show a larger diff that includes all three fixes.If you'd rather merge each fix individually first and then have me re-base PR #4 down to a clean diff, I'm happy to do that — just say the word.
Test plan
rm -rf node_modules && npm ci && npm test— 57 tests, 0 failuresnode --checkfor all 5 modified.mjsfilesname,on,jobs.test.steps[*]shape)