Skip to content

Enrich commits with pull request and issue metadata #8

Description

@tabkram

Why

A pull request title and body are written for humans. A commit subject is written for git log. When a repository squash-merges, the PR number is already sitting in the commit subject as (#123) and we throw it away.

github/copilot-release-notes is built entirely on this — it walks merged PRs rather than commits — and it is the main reason its output reads well with zero configuration.

Scope

  • Parse PR and issue references out of commit subjects and bodies ((#123), Closes #45, Fixes #45).
  • When a GitHub remote is present and credentials are available, resolve those references to title, body, labels, and author.
  • Feed the resolved metadata into the prompt as an additional labelled, untrusted block.
  • Degrade silently. No remote, no credentials, no network, a non-GitHub host, or a rate limit must all fall back to commit-only behaviour without failing the run. This tool must keep working on a private repo with no token.

Prefer the user's existing gh CLI when present, falling back to a plain token from the environment. Do not add a hard dependency on either.

Acceptance criteria

  • Reference parsing covers (#N), Closes/Fixes/Resolves #N, and full URLs
  • Resolution is batched, not one request per commit
  • Every failure mode above falls back to commit-only, with one clear note in the run report
  • Works with gh auth or GITHUB_TOKEN; neither is required
  • Resolved PR text is treated as untrusted input under the scope guard
  • Eval fixtures include one squash-merge repo showing the improvement

Files

src/git.ts, new src/forge.ts (or similar), src/prompts/builder.ts, src/config.ts, docs/configuration.md

Notes

Keep the forge layer behind an interface. GitLab and Bitbucket are the obvious follow-ups and should not require reworking this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:gitGit reading and parsingeffort:MA few daystier:qualityImproves the quality of generated notes

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions