Skip to content

feat(ai-evals): add BrowserStack AI Evals GitHub Action #86

Open
EMMUUU28 wants to merge 2 commits into
browserstack:masterfrom
EMMUUU28:feat/ai-evals
Open

feat(ai-evals): add BrowserStack AI Evals GitHub Action #86
EMMUUU28 wants to merge 2 commits into
browserstack:masterfrom
EMMUUU28:feat/ai-evals

Conversation

@EMMUUU28
Copy link
Copy Markdown

Adds a new ai-evals/ action that runs a BrowserStack AI Evals experiment on every pull request, compares scores against the previous baseline run, and posts a sticky PR comment + Job Summary. Fails the check when any evaluator threshold is breached.

Notes

  • TypeScript source, esbuild-bundled dist/index.js, node20 runtime
  • Mocha + Chai + Sinon tests, husky pre-commit keeps src/ and dist/ in sync
  • Verified end-to-end via act and a real downstream PR against production AI Evals

  BrowserStack AI Evals action
Adds a unit test suite matching sibling action conventions:
- 8 tests covering all RunResult status branches (NOT_FOUND, CREATE_FAILED,
  FAILED, PASS, REGRESSION) and exit codes (0/1/2/3)
- Stubs the SDK at its method boundary so tests are deterministic, fast,
  and isolated from network/auth concerns
- Asserts CI metadata pass-through to experimentRuns.create as the 5th arg
- Asserts lifecycle progress messages

Tooling:
- mocha + chai + sinon + nyc (matches setup-env / setup-local / browserstack-report-action)
- ts-node loader so Mocha can read .ts source directly
- @typescript-eslint v8 (supports TypeScript 5.9)
- husky pre-commit hook: runs test + build + stages dist/ so src and dist
  cannot drift in a published commit

'npm test' chains tsc --noEmit -> eslint -> nyc mocha with HTML coverage
report (coverage/index.html, gitignored).
@EMMUUU28 EMMUUU28 requested a review from a team as a code owner May 22, 2026 07:34
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