Skip to content

feat(review): reuse review.instructions/pathInstructions for E2E test generation - #4208

Merged
JSONbored merged 1 commit into
mainfrom
feat/e2e-test-gen-instructions-reuse
Jul 8, 2026
Merged

feat(review): reuse review.instructions/pathInstructions for E2E test generation#4208
JSONbored merged 1 commit into
mainfrom
feat/e2e-test-gen-instructions-reuse

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Investigated #4200's original ask (a dedicated review.e2eTestGeneration.instructions/pathInstructions config block, CodeRabbit-path_instructions-style) against the current codebase, and found the codebase already has a fully general-purpose, working mechanism for exactly this: review.instructions (repo-wide brief) and review.pathInstructions ({path, instructions}[]), already parsed, validated, and fed into the AI reviewer's prompt today (resolveReviewPathInstructions in src/signals/focus-manifest.ts).
  • Rather than inventing a second, e2e-test-gen-specific instructions schema that would duplicate this exact concept, this PR adds resolveE2eTestGenInstructions — a small pure function that combines the SAME existing review.instructions + matching review.pathInstructions entries into one instructions block for E2eTestGenInput.instructions (the field feat(review): LLM core to turn a PR diff into Playwright E2E test source #4191/PR feat(review): LLM core to turn a PR diff into Playwright E2E test source #4207 already built and wired to accept).
  • No new config schema, no new migration, no new OpenAPI field, no new glob-matching logic — this is 100% reuse of already-shipped, already-documented config. A maintainer's repo conventions and path-scoped rules ("use Playwright with our page-object pattern," "always test the payment-failure retry path for src/checkout/**") apply equally well to steering an AI reviewer or an AI test generator, so both now draw from the same maintainer-authored brief, written once.
  • Updated the doc comments on pathInstructions/instructions (engine package + both public/self-host .gittensory.yml examples) to note this second consumer, so a maintainer reading the existing docs knows their instructions now also steer test generation once that feature is enabled.

Closes #4200.

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage (targeted at the changed files + the config-example drift tests) — 100% statements/branches/functions/lines on the changed portion of src/services/ai-e2e-test-gen.ts (82/82 stmts, 76/76 branches, 9/9 funcs, 71/71 lines, confirmed via --coverage.include); test/unit/config-templates.test.ts (verifies .gittensory.yml.exampleconfig/examples/gittensory.full.yml byte-for-byte parity) and test/unit/focus-manifest.test.ts both still pass, confirming the doc updates didn't break the existing mirror check.
  • npm run docs:drift-check — clean, no new env vars introduced.
  • npm audit --audit-level=moderate — N/A, no dependency changes (not re-run this PR; nothing in package.json/lockfiles touched).
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — 6 new tests: nothing configured (null), null/undefined review config tolerated, repo-wide alone, path-instructions alone, both combined, and a non-matching glob correctly omitted.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise — N/A directly (this reuses the EXISTING parsePublicSafeText-validated fields verbatim; no new text-handling path).
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no auth/session/CORS surface touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed — N/A, no new API/OpenAPI/MCP surface (reuses existing fields as-is).
  • UI changes use live API data or real empty/error/loading states — N/A, no UI changes.
  • Visible UI changes include a UI Evidence section — N/A, no UI changes.
  • Public docs/changelogs are updated where needed (doc comments + both .gittensory.yml examples updated to note the new consumer); CHANGELOG.md itself is untouched.

Notes

… generation

Adds resolveE2eTestGenInstructions, combining a repo's existing review.instructions
(repo-wide brief) with any review.pathInstructions entries matching the PR's changed
files into one instructions block for AI-generated E2E test coverage (#4189 epic).

Reuses the config-as-code mechanism already parsed and already feeding the AI reviewer
end to end (resolveReviewPathInstructions), rather than inventing a second,
e2e-test-gen-specific instructions schema: a maintainer's repo conventions and
path-scoped rules apply equally well to steering an AI reviewer or an AI test
generator, so both draw from the same maintainer-authored brief written once.

Closes #4200.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 5452058 Commit Preview URL

Branch Preview URL
Jul 08 2026, 12:11 PM

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (8048163) to head (5452058).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4208   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         389      389           
  Lines       36495    36499    +4     
  Branches    13373    13376    +3     
=======================================
+ Hits        34217    34221    +4     
  Misses       1621     1621           
  Partials      657      657           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/focus-manifest.ts 99.16% <ø> (ø)
src/services/ai-e2e-test-gen.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 8, 2026
@JSONbored
JSONbored merged commit 24d058a into main Jul 8, 2026
12 checks passed
@JSONbored
JSONbored deleted the feat/e2e-test-gen-instructions-reuse branch July 8, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): repo/path-scoped test-coverage instructions for e2eTests generation

1 participant