Skip to content

Add pull request summary command - #25

Merged
mkajander merged 2 commits into
mainfrom
pr-summary
Apr 20, 2026
Merged

mkajander merged 2 commits into
mainfrom
pr-summary

Conversation

@mkajander

Copy link
Copy Markdown
Contributor

Summary

  • add bbt pr summary [<id>] with human, JSON, and quiet output
  • derive mergedAt from Bitbucket PR activity instead of guessing from updated_on
  • emit mergedAt: null explicitly when no reliable merge timestamp exists

Testing

  • dotnet test

Copilot AI review requested due to automatic review settings April 18, 2026 03:49

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 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 --quiet output modes.
  • Compute diff stats (files changed / lines added / lines removed) from the PR diff.
  • Derive mergedAt from the PR activity log and ensure JSON output includes "mergedAt": null when 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.

@mkajander
mkajander merged commit 554cc58 into main Apr 20, 2026
8 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