feat: Phase 1 foundation — config, webhooks, JUnit, tests (v0.5.0)#1
Merged
feat: Phase 1 foundation — config, webhooks, JUnit, tests (v0.5.0)#1
Conversation
….5.0) Phase 1 foundation — makes the package self-sufficient and CI-ready: - Config file system: agent-browser-driver.config.ts with defineConfig(), loadConfig() (searches up dir tree), mergeConfig() (last-wins scalars, concat sinks only). CLI --config flag, all CLI flags override config. - WebhookSink: ArtifactSink that POSTs to any URL. Event filtering, includeData toggle, exponential backoff retry, never throws. - JUnit XML reporter: generateJUnitXml() produces valid XML for GitHub Actions/Jenkins/GitLab. Full XML escaping in attributes and body text. Grouped by category, failures include verdict + last actions. - Test suite: 51 vitest unit tests across 6 files covering config, webhook-sink, junit, filesystem-sink, composite-sink, and snapshot. Runs in ~35ms. Bump version to 0.5.0.
…CI tests - Add slackFormatter() for Slack Block Kit webhook notifications - Add formatPayload callback to WebhookSinkOptions for custom transformations - Wire reporters config into CLI — writes all configured formats to disk - Add report-junit to ArtifactType union - Update CI workflow to run pnpm test - Add tests for slack formatter and formatPayload
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
Config file system —
agent-browser-driver.config.tswithdefineConfig()for IDE autocomplete.loadConfig()searches up the directory tree,mergeConfig()does last-wins for scalars/arrays, concat for sinks only. CLI--configflag; all CLI flags override config values without clobbering unrelated config file settings.WebhookSink —
ArtifactSinkimplementation that POSTs artifact metadata (and optionally base64 data) to any webhook URL. Event type filtering, custom headers, configurable max payload size, exponential backoff retry (1s/2s/4s). Never throws (infra-as-best-effort).close()accepts optional pass/fail summary.JUnit XML reporter —
generateJUnitXml()produces standard JUnit XML for GitHub Actions, Jenkins, GitLab CI. Full XML escaping in both attributes and body text. Tests grouped bytestCase.category. Failures include verdict, criteria results, and last 5 actions. Wired intogenerateReport()viaformat: 'junit'.Test suite — 51 vitest unit tests across 6 files. No browser, no LLM, no network. Runs in ~35ms (133ms total with transform/import).
Metrics
pnpm testtimeTest plan
pnpm build— zero TypeScript errorspnpm test— 51/51 pass['junit']replaces default['json']