Skip to content

feat(apis): add issue.reopened and pr.reopened event types - #286

Open
ccf-lisa[bot] wants to merge 2 commits into
mainfrom
fx/reopen-1-events-contract
Open

ccf-lisa[bot] wants to merge 2 commits into
mainfrom
fx/reopen-1-events-contract

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Task: reopen-1 (reopen events, contract)

Summary

Adds two event types, issue.reopened and pr.reopened, both emitted by the github provider. Today a closed work item can't be reopened: the factory has no reopen event, so closed-gate keeps suppressing every rule after the issue is reopened. The real case was compliance-framework/docs#220. It was closed and reopened, its implement run then opened docs#229, and the review was never dispatched.

Stack: this is PR 1 of 2. It holds only the contract, per AGENTS.md. PR 2 is stacked on it and maps GitHub's issues.reopened / pull_request.reopened in normalise.go, then adds the catalog rule reopen-on-primary-reopened, which sets lifecycle: open.

Changes

  • internal/apis/v1alpha1/events.go: the constants EventIssueReopened and EventPRReopened, and their eventVocabulary entries (github). They sit next to their *.closed pair.
  • Regenerated (make generate): schemas/rule.schema.json, schemas/ruleset.schema.json, and api/openapi.yaml (the EventType enum).
  • Regenerated web client (cd web && npm ci && npm run gen:api): web/src/api/schema.d.ts.
  • Docs:
    • The event table in design/03-domain-model.md.
    • The event vocabulary in design/workstreams/foundation/LLD/contracts.md.
    • The webhook mapping table in design/workstreams/provider-github/LLD/github-provider.md. The mapping it describes is implemented in PR 2.
  • Tests:
    • TestEventVocabulary now expects 30 types.
    • The fake provider's "unknown type" case used issue.reopened, which is now a known type. It uses issue.transferred instead.

Verification

  • make generate leaves the tree clean, and so does cd web && npm run gen:api.
  • make reviewable: check-generated, lint (0 issues), catalog and openapi-lint (100/100) pass. All tests pass except TestBaseScriptRuns (internal/agent/host/provision). That test fails the same way on main on macOS, because it needs /etc/os-release. It is unrelated to this PR, and CI runs it on Linux.
  • go test ./internal/apis/... ./internal/provider/fake/

🤖 Generated with Claude Code

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

no findings.

Stack (base-chain): #286 → #287

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