Skip to content

feat: handle draft PR lifecycle state - #13

Merged
harshitsinghbhandari merged 2 commits into
mainfrom
feat/draft-pr-state
May 27, 2026
Merged

harshitsinghbhandari merged 2 commits into
mainfrom
feat/draft-pr-state

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator

Summary\n- add canonical PR state and display status for GitHub draft PRs\n- derive draft display status while keeping CI failure dominant\n- route draft PR SCM observations through the PR ladder without review/merge statuses\n\n## Tests\n- go test ./...\n- go build ./...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for GitHub draft pull requests in the canonical PR lifecycle, including a new derived display status (draft) while preserving CI failure as the dominant signal.

Changes:

  • Introduces domain.PRDraft and a new derived domain.StatusDraft, plus status-derivation rules for draft PRs.
  • Routes draft SCM observations through the existing open-PR decision ladder, but short-circuits review/merge states for drafts.
  • Extends unit tests across lifecycle manager, decision logic, and status derivation to cover draft behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/internal/lifecycle/manager.go Handles PRDraft SCM observations by running the open-PR ladder with Draft=true.
backend/internal/lifecycle/manager_test.go Adds ApplySCMObservation coverage for draft PR scenarios (draft vs ci_failed).
backend/internal/domain/status.go Adds StatusDraft and draft-specific status derivation (CI failure still wins).
backend/internal/domain/status_test.go Adds draft status-derivation test cases.
backend/internal/domain/lifecycle.go Adds PRDraft canonical PR state.
backend/internal/domain/decide/types.go Extends OpenPRInput with a Draft flag and updates documentation.
backend/internal/domain/decide/decide.go Updates open-PR ladder to emit PRDraft + StatusDraft when Draft=true (CI failure still dominates).
backend/internal/domain/decide/decide_test.go Adds decision tests for draft behavior and PRState emission.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/internal/lifecycle/manager.go
Comment thread backend/internal/lifecycle/manager_test.go
@harshitsinghbhandari
harshitsinghbhandari merged commit bbaf665 into main May 27, 2026
2 checks passed
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.

2 participants