Skip to content

feat: display the command used on the generated combined PR #26

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 3 commits into from
Apr 15, 2025

Conversation

GrantBirki
Copy link
Member

resolves: #25

@GrantBirki GrantBirki added the enhancement New feature or request label Apr 15, 2025
@GrantBirki GrantBirki self-assigned this Apr 15, 2025
@Copilot Copilot AI review requested due to automatic review settings April 15, 2025 06:43
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 adds functionality to display the CLI command used for generating the combined PR, aiding in traceability and debugging. Key changes include:

  • Adding a new utility function buildCommandString to reconstruct the original CLI command.
  • Updating CombinePRsWithStats and generatePRBody to accept and display the command string.
  • Modifying processRepository to pass the command string when combining PRs.

Reviewed Changes

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

File Description
internal/cmd/root.go Imports "strings" and uses buildCommandString to pass the command string to the combine function.
internal/cmd/combine_prs.go Adjusts CombinePRsWithStats and generatePRBody to include and display the command used.
Comments suppressed due to low confidence (2)

internal/cmd/root.go:427

  • Consider adding unit tests for buildCommandString to verify that various flag combinations produce the expected command string.
func buildCommandString(args []string) string {

internal/cmd/combine_prs.go:196

  • [nitpick] Consider adding tests for generatePRBody to ensure that the command string is correctly integrated into the PR body, and handle cases where the command string may be empty or contain excess whitespace.
body += fmt.Sprintf("\nCommand used:\n\n```bash\n%s\n```", command)

@GrantBirki GrantBirki merged commit 647d13d into main Apr 15, 2025
7 checks passed
@GrantBirki GrantBirki deleted the cmd-used branch April 15, 2025 06:44
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.

Add the command used to the PR comment body
1 participant