AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-557
  5. plan
  6. plan.md
plan.md(2.9 KB)· Apr 23, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks
  • Open Questions

Plan — BJ-17: E2E tier 2d-bitbucket#

Summary#

Add a new E2E module bitbucket in AgentSDE/agent-core-e2e containing one happy-path scenario that drives the full Bitbucket intake → PR → merge cycle against the mock Atlassian server (from BJ-16). All work lands on rc/atlassian-integration in agent-core-e2e; no agent-core source changes.

Files#

PathActionPurpose
test/bitbucket/bitbucket.happy-path.e2e-spec.tscreateSingle @integration @bitbucket scenario: post pullrequest:created, poll WebhookDeliveryEntity, poll task phase transitions, assert mock request log, post pullrequest:fulfilled, assert close-out.
package.jsonmodifyAdd "test:module:bitbucket": "MODULE=bitbucket jest --config jest.module.config.js --forceExit" script alongside the existing per-module scripts.
TEST_MODULES.mdmodifyRegister bitbucket in the Modules table and add src/webhook/bitbucket/** → bitbucket mapping (for e2e-targeted.yml).

Steps#

  1. S1 — Scaffold the module: create test/bitbucket/, add the npm script to package.json, and register the module in TEST_MODULES.md. No spec logic yet.
  2. S2 — Implement the happy-path spec: boot AppModule via NestFactory, use the BJ-15 Bitbucket webhook client to POST pullrequest:created at ${AGENT_CORE_URL}/webhooks/bitbucket, poll WebhookDeliveryEntity for success, poll GET /internal/task/<id> until phase reaches completed, read the BJ-16 mock request log and assert the expected Bitbucket API calls (comment, PR create, merge) occurred, then POST pullrequest:fulfilled and assert final task state is closed. Register the spec under @integration @bitbucket describe tag. Reuse CleanupService in afterAll.

Verification#

  • MODULE=bitbucket npm run test:module passes against the test instance (AGENT_CORE_URL=http://localhost:8777).
  • Mock server request log (atlassianMock.requests()) contains a PR-create, comment, and merge call in expected order.
  • Both pullrequest:created and pullrequest:fulfilled deliveries land with success status in WebhookDeliveryEntity; final task row reaches closed.

Risks#

  • Prerequisites still open — #550, #551, #555, #556 are all OPEN. The spec cannot import the mock server or webhook-client fixtures until BJ-15 and BJ-16 merge, and the pipeline cannot progress without BJ-10/BJ-11. Implementation must wait for those to land on rc/atlassian-integration.
  • Module vs tier naming drift — issue prose says "tier 2d-bitbucket" but the codebase uses module-based organisation (test/<module>/ + MODULE=… env). Plan uses bitbucket as the module name to match convention; legacy 2d-bitbucket alias is out of scope.

Open Questions#

  • Should the module be tagged @smoke (runs every PR) or @integration (runs on module-change only)? Plan assumes @integration given the 10+ minute runtime and external mock dependency.
ContextPrd