git-pr-release icon indicating copy to clipboard operation
git-pr-release copied to clipboard

Aggregate labels from merged pull requests

Open ohbarye opened this issue 5 years ago • 0 comments

@onk @motemen

Issue

Closes #54

Changes

As described in https://github.com/x-motemen/git-pr-release/issues/54, I added aggregate_labels feature.

  • Add pr-release.aggregate_labels config (or GIT_RELEASE_PR_AGGREGATE_LABELS).
    • It accepts boolean-ish value: "true" or anything
    • Only when it is "true", git-release-pr aggregates labels from merged pull requests.
  • What if pr-release.labels is given at the same time?
    • Merge aggregated labels and pr-release.labels setting.
      • pr-release.labels=foo,bar and aggregated labels are baz, then labels would be ["foo", "bar", "baz"].

Testing

That worked well on my own

$ GIT_PR_RELEASE_BRANCH_STAGING=release GIT_PR_RELEASE_LABELS=release GIT_PR_RELEASE_AGGREGATE_LABELS=true bundle exec git-pr-release
Merged PRs have labels Created PR has labels
image image

Review Points

  • Is aggregate_labels an appropriate name?
    • ideas: reuse_labels, summarize_labels... etc.
  • Should aggregate_labels be given as a command line arg, not environment variable or git config?
    • As like --dry-run, --no-fecth, aggregate_labels is boolean-ish value. So I wonder if it should be. (It depends on this gem's command line design.)

ohbarye avatar Sep 22 '20 05:09 ohbarye