Skip to content

ci: add GitHub Actions workflow + tests for new code from PRs #1, #2, #3#4

Merged
JohnnyVicious merged 1 commit intomainfrom
feat/ci-and-tests
Apr 12, 2026
Merged

ci: add GitHub Actions workflow + tests for new code from PRs #1, #2, #3#4
JohnnyVicious merged 1 commit intomainfrom
feat/ci-and-tests

Conversation

@JohnnyVicious
Copy link
Copy Markdown
Owner

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

  • New .github/workflows/ci.yml, adapted from openai/codex-plugin-cc's pull-request-ci.yml. Pinned action SHAs match codex's workflow for parity.
  • Runs on every PR and on pushes to main, on Node 22.
  • Two gates: node --check for every .mjs companion script, then npm test.
  • New package-lock.json so npm ci can run reproducibly (the upstream repo was missing one).

New tests (39 → 57, all passing on clean npm ci)

Test file New cases Covers
tests/git.test.mjs +11 detectPrReference — positive matches (PR #N, pr #N, PR N, embedded refs), negatives (bare #123 issue refs, plain text, empty/null), and the strip-from-focus workflow used by handleAdversarialReview.
tests/process.test.mjs +7 findOpencodeAuthFile (XDG_DATA_HOME-first lookup) and getConfiguredProviders (one provider, multiple, empty {}, malformed JSON, JSON array, JSON null). Overrides XDG_DATA_HOME so 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 findOpencodeAuthFile falls through to platform-default paths (~/.local/share/opencode/auth.json on 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:

After #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

  • Local: rm -rf node_modules && npm ci && npm test — 57 tests, 0 failures
  • Local: node --check for all 5 modified .mjs files
  • CI workflow validates against actions schema (name, on, jobs.test.steps[*] shape)
  • CI runs green on PR open

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.
@JohnnyVicious JohnnyVicious merged commit 6551bab into main Apr 12, 2026
1 check passed
@JohnnyVicious JohnnyVicious deleted the feat/ci-and-tests branch April 12, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant