Skip to content

fix(review): enforce repo gate for e2e generation - #4386

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-vulnerability-in-e2e-test-generation
Jul 9, 2026
Merged

fix(review): enforce repo gate for e2e generation#4386
JSONbored merged 1 commit into
mainfrom
codex/fix-vulnerability-in-e2e-test-generation

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Close a security gap where the E2E test generator only checked the global e2eTests kill-switch and not the per-repo converged-feature decision, which could let private PR diffs be sent to an AI provider and consume BYOK/shared quota.

Description

  • Add an explicit per-repo gate by calling convergedFeatureActive(env, input.repoFullName, "e2eTests") early in runGittensoryE2eTestGeneration and return a disabled result when it is not active (file: src/services/ai-e2e-test-gen.ts).
  • Update the generator header comment to document that generation requires both the global kill-switch and the repo manifest/allowlist activation.
  • Add test helpers and manifest seeding (cacheEmptyManifest, enabledEnvWithCachedManifest) and import upsertRepoFocusManifest so tests can exercise the repo manifest path, and add regression tests that assert an unallowlisted repo is disabled and a repo-specific features.e2eTests: true opt-in enables generation (file: test/unit/ai-e2e-test-gen.test.ts).
  • Adjust existing unit tests to seed cached manifests where needed so the per-repo resolver behavior is covered.

Testing

  • Ran npx vitest run test/unit/ai-e2e-test-gen.test.ts; unit tests passed (41 tests).
  • Ran npm run typecheck; TypeScript typecheck passed.
  • Ran coverage with npm run test:coverage -- test/unit/ai-e2e-test-gen.test.ts; tests completed successfully but coverage remapping failed with TypeError: jsTokens is not a function during V8→lcov conversion.
  • Ran npm audit --audit-level=moderate; the audit step failed with a 403 Forbidden from the npm registry and could not complete.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (c823f9c) to head (15bfdce).
⚠️ Report is 13 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4386   +/-   ##
=======================================
  Coverage   93.95%   93.95%           
=======================================
  Files         400      400           
  Lines       36817    36819    +2     
  Branches    13451    13452    +1     
=======================================
+ Hits        34592    34594    +2     
  Misses       1569     1569           
  Partials      656      656           
Files with missing lines Coverage Δ
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.

@JSONbored JSONbored self-assigned this Jul 9, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 9, 2026
@JSONbored
JSONbored merged commit 4125ee0 into main Jul 9, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-vulnerability-in-e2e-test-generation branch July 9, 2026 06:54
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.

Development

Successfully merging this pull request may close these issues.

1 participant