PR Description Generation (/describe)
Relevant source files
The following files were used as context for generating this wiki page:
The /describe command generates a comprehensive Pull Request description and changelog. It automates the documentation of changes to ensure clarity and consistency across the @JWEB0689 fleet.
This feature operates as an interactive command within the PR-Agent framework. It utilizes central configuration settings to provide uniform output while allowing for repository-specific overrides.
Sources: README.md:1-26, scripts/autofix.py:182-205
Command Execution and Triggering
Users trigger the description generation by posting the /describe comment on a Pull Request. The system identifies the command and processes the code changes to build the documentation.
Command Flow
The following diagram illustrates the interaction between the user and the PR-Agent when generating a description.
The PR-Agent orchestrates the data retrieval from the repository and uses the AI model to interpret changes.
Sources: README.md:20-26, scripts/autofix.py:148-164
Configuration and Inheritance
PR-Agent uses a hierarchical configuration system. Centralized settings in JWEB0689/pr-agent-settings serve as the global default for all repositories.
Settings Hierarchy
| Level | File | Description |
|---|---|---|
| Global | .pr_agent.toml | Defines default behavior for the /describe command across all repos. |
| Repository | .pr_agent.toml | Overrides global settings to customize tool behavior for a specific project. |
Sources: README.md:9-15
Data Context for Generation
To generate an accurate description, the system gathers context from the modified files and the pull request environment.
- Modified Files: The agent identifies changed files using
git diffagainst the base reference (typicallyorigin/main). - File Context: Full contents of modified files are read, provided they do not exceed size limits (e.g., 80,000 bytes).
- Review Findings: If available, the agent incorporates existing review comments and summaries to refine the description.
Sources: scripts/autofix.py:46-56, scripts/autofix.py:84-97, scripts/autofix.py:182-205
Content Collection Logic
The system prioritizes local file context to ensure the AI model understands the logic behind the changes.
Sources: scripts/autofix.py:40-44, scripts/autofix.py:84-97
Integration with Automation
While /describe is often manual, the infrastructure supports autonomous updates. The pr_agent.yml workflow allows for scheduled or event-driven execution across the organization.
- Workflow: A reusable GitHub Action workflow manages the execution environment.
- API Usage: The tool uses the GitHub REST API to post the generated summaries back to the PR as comments or body updates.
Sources: README.md:17-19, scripts/autofix.py:136-150
Summary
The /describe feature provides an automated method for documenting software changes. By leveraging a central configuration and LLM-based analysis of git diffs, it ensures that every Pull Request in the fleet contains a clear summary and changelog without manual effort.