Skip to content

Add 'Generate PR Description' feature for automated PR title and description drafting#1

Merged
charleyRV merged 1 commit intomainfrom
charlie/generate-pr-descriptions
Apr 9, 2026
Merged

Add 'Generate PR Description' feature for automated PR title and description drafting#1
charleyRV merged 1 commit intomainfrom
charlie/generate-pr-descriptions

Conversation

@creiney5
Copy link
Copy Markdown
Collaborator

@creiney5 creiney5 commented Apr 9, 2026

This PR introduces a new feature to the Code Explainer VS Code extension that automatically generates a reviewable GitHub pull request title and description for the current branch. It leverages existing repository analysis and GitHub integration to draft PR descriptions tailored to different audiences and styles.

Changes Overview

  • Added a new command codeExplainer.generatePrDescription to trigger PR description generation.
  • Implemented PrDescriptionAnalysisService to analyze the current branch, generate draft PR titles and bodies, and interact with GitHub to create or update pull requests.
  • Created a dedicated UI panel to display, edit, and apply generated PR descriptions.
  • Extended the extension configuration with settings for default PR description style, guidelines, and templates.
  • Integrated the new command into the extension activation lifecycle and command palette.
  • Updated README and package.json to document and register the new feature.

Architectural Details

  • The feature uses the PrDescriptionAnalysisService which combines repository scanning, prompt building for LLMs, and GitHub API interactions.
  • The UI panel supports regenerating drafts with different styles or custom instructions and applying the final draft to GitHub.
  • The system tracks PR state (no PR, existing empty, existing with description) to decide whether to create or update a PR.

Risks and Mitigations

  • GitHub API interactions require authentication and network availability; errors are surfaced in the UI.
  • Generated descriptions depend on LLM responses, which may vary; users can edit drafts before applying.
  • The feature adds complexity to the extension; code is modularized and tested to isolate concerns.

Testing

  • Manual testing was performed to verify generation, editing, and application of PR descriptions.
  • Verified correct handling of existing PRs and branch states.
  • UI interactions tested for responsiveness and error handling.

This description was generated using the new 'Generate PR Description' feature to demonstrate its capabilities.

@charleyRV charleyRV merged commit e1e948e into main Apr 9, 2026
3 checks passed
@creiney5 creiney5 deleted the charlie/generate-pr-descriptions branch April 9, 2026 18:42
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