Repository navigation
Add pull request summary command - #25
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new bbt pr summary command to expose normalized, automation-friendly pull request metrics (including diff stats and an accurate mergedAt), extending the existing pr command suite and updating the Bitbucket contract docs accordingly.
Changes:
- Introduce
bbt pr summary [<id>]with human,--json, and--quietoutput modes. - Compute diff stats (files changed / lines added / lines removed) from the PR diff.
- Derive
mergedAtfrom the PR activity log and ensure JSON output includes"mergedAt": nullwhen unavailable.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Bbt.Core.Tests/Diff/PullRequestDiffStatsCalculatorTests.cs | Adds coverage for diff stats aggregation. |
| tests/Bbt.Core.Tests/Bitbucket/PullRequestSummaryModelTests.cs | Verifies summary mapping and mergedAt null-serialization behavior. |
| tests/Bbt.Core.Tests/Bitbucket/PullRequestActivityAnalyzerTests.cs | Adds coverage for merged timestamp derivation from activity updates. |
| src/Bbt/Program.cs | Registers the new pr summary subcommand. |
| src/Bbt/Models/PullRequestModels.cs | Introduces PullRequestSummary model with non-ignored MergedAt. |
| src/Bbt/Infrastructure/ModelMappers.cs | Adds mapping to PullRequestSummary, including review state counting. |
| src/Bbt/Commands/Pr/PrSummaryCommand.cs | Implements the pr summary command including diff parsing and mergedAt resolution. |
| src/Bbt/Commands/Llms/LlmsCommand.cs | Documents the new command in the LLM command inventory output. |
| src/Bbt.Core/Diff/PullRequestDiffStatsCalculator.cs | Adds calculator for diff-based summary stats. |
| src/Bbt.Core/Diff/Models.cs | Adds PullRequestDiffStats record. |
| src/Bbt.Core/Bitbucket/PullRequestActivityAnalyzer.cs | Adds logic to select latest MERGED activity timestamp. |
| src/Bbt.Core/Bitbucket/Models/BitbucketPullRequestActivity.cs | Adds models for the PR activity endpoint payload. |
| src/Bbt.Core/Bitbucket/Models/BitbucketPullRequest.cs | Adds comment_count mapping. |
| src/Bbt.Core/Bitbucket/BitbucketClient.cs | Adds client method to list PR activity. |
| docs/contracts/bitbucket-cloud-v0.1.md | Updates pinned contract with activity endpoint and fields used by pr summary. |
| README.md | Documents bbt pr summary usage and behavior (notably mergedAt). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
bbt pr summary [<id>]with human, JSON, and quiet outputmergedAtfrom Bitbucket PR activity instead of guessing fromupdated_onmergedAt: nullexplicitly when no reliable merge timestamp existsTesting