Skip to content

Stats output #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 14, 2025
Merged

Stats output #15

merged 7 commits into from
Apr 14, 2025

Conversation

GrantBirki
Copy link
Member

@GrantBirki GrantBirki commented Apr 14, 2025

This pull request implements a very basic "stats" output for this CLI.

$ gh combine owner/repo

Stats Summary:
Repositories Processed: 1
PRs Combined: 2
PRs Skipped (Merge Conflicts): 0
PRs Skipped (Criteria Not Met): 1
Execution Time: 6s
Links to Combined PRs:
- https://github.com/owner/repo/pull/123

Per-Repository Details:
  owner/repo
    Combined: 2
    Skipped (Merge Conflicts): 0
    Skipped (Criteria): 1
    Combined PR: https://github.com/owner/repo/pull/123

It is very basic and will be improved upon in subsequent PRs


Resolves: #14

@GrantBirki GrantBirki added the enhancement New feature or request label Apr 14, 2025
@GrantBirki GrantBirki self-assigned this Apr 14, 2025
@Copilot Copilot AI review requested due to automatic review settings April 14, 2025 18:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a basic stats summary output for the gh-combine CLI runs. Key changes include:

  • Adding a StatsCollector and RepoStats structs to track processing details.
  • Integrating new CLI flags (--no-color and --no-stats) and updating command execution flow to display a summary.
  • Modifying PR combination logic to return combined PR details and maintain backward compatibility.

Reviewed Changes

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

File Description
internal/cmd/root.go Adds new stats tracking functionality, CLI flags, and displays stats summary.
internal/cmd/combine_prs.go Updates PR combination logic to return stats details and introduces CombinePRsWithStats.
Comments suppressed due to low confidence (2)

internal/cmd/root.go:40

  • [nitpick] The variable name 'noStats' may be less descriptive; consider renaming it to 'disableStats' to improve clarity.
noStats             bool

internal/cmd/combine_prs.go:72

  • [nitpick] The variable 'combined' is a bit ambiguous; renaming it to 'combinedPRs' could make the code clearer regarding its purpose.
combined = append(combined, fmt.Sprintf("#%d - %s", pr.Number, pr.Title))

@GrantBirki GrantBirki merged commit 28d98bb into main Apr 14, 2025
7 checks passed
@GrantBirki GrantBirki deleted the stats-output branch April 14, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: stats output
1 participant