Skip to content

Conversation

@rafaelrcamargo
Copy link
Owner

Changes

  • Introduced comprehensive PR template compatibility, enabling the system to automatically detect and utilize templates from the .github/PULL_REQUEST_TEMPLATE directory for new pull requests.
  • Enhanced overall template management, including adding a default PR template, streamlining existing issue templates for improved clarity and conciseness, and standardizing their formatting.
  • Updated development dependencies (including the AI SDK), refined the PR description generator instructions, and fixed an issue allowing PR creation without new commits.

Related Issues

Updated various dependencies to their latest versions.

Key updates include:
- `@ai-sdk/anthropic` from `^2.0.8` to `^2.0.15`
- `@ai-sdk/google` from `^2.0.11` to `^2.0.13`
- `@ai-sdk/openai` from `^2.0.22` to `^2.0.27`
- `ai` from `^5.0.26` to `^5.0.39`
- `eslint` from `^9.34.0` to `^9.35.0`
- `typescript-eslint` from `^8.41.0` to `^8.43.0`
Introduced logic to detect and utilize repository-specific PR templates, enhancing compliance with project guidelines. The PR generation prompt is now dynamically adjusted based on whether a template is found, ensuring the generated PR description adheres to the template's structure.

Adjusted the PR generation flow to allow PR creation even if `options.yes` or `options.force` are not set, providing more flexibility. Also added an informative message when the branch is already up-to-date with the remote.
This commit introduces a PR template to ensure consistent and informative pull request descriptions. The template provides sections for change summaries, type of changes, and a checklist for PR best practices. This helps streamline the review process and maintain code quality standards.
Previously, the `--pr` option only functioned if new commits were generated. This change modifies the condition to allow PR creation independently, enabling its use for existing branches with or without recent commits.
Adjust spacing and empty lines in bug report and feature request templates for better readability and consistency with markdown best practices.
Enhance the `listDirectory` function to correctly handle directory paths and extract filenames. This ensures accurate listing of PR templates, improving compatibility.
Updated the bug report and feature request issue templates to be more direct and concise. This change removes verbose sections, focusing on essential information to improve the efficiency of issue submission and review processes.
Modified the instructions for the PR description generator to emphasize factual, concise, and pragmatic communication. This change aims to produce more accurate and less embellished PR titles and bodies, adhering strictly to the provided templates without exaggeration or conventional commit prefixes.
This template provides a standardized structure for pull requests, aiming to:

- Improve clarity and consistency across all contributions.
- Guide contributors on necessary information, such as type of change, description, and checklist items.
- Streamline the review process for maintainers.
This change introduces a new `reset.d.ts` file to provide a type definition for a global `reset` function. This ensures that the function is properly typed and available within the project's TypeScript environment.

The `package.json` and `bun.lock` files are updated to reflect the new type definition.
@rafaelrcamargo rafaelrcamargo self-assigned this Sep 9, 2025
@rafaelrcamargo rafaelrcamargo added the enhancement New feature or request label Sep 9, 2025
Copy link

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 introduces comprehensive PR template compatibility to automatically detect and utilize templates from the .github/PULL_REQUEST_TEMPLATE directory, enhances overall template management, and updates various dependencies.

  • Adds PR template discovery functionality with support for multiple template locations and formats
  • Updates AI instruction system to follow repository PR templates when generating PR descriptions
  • Refactors PR creation workflow to allow PR generation even without new commits

Reviewed Changes

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

Show a summary per file
File Description
template.ts New module implementing PR template discovery and analysis functionality
pr.ts Updated to integrate PR template detection and modified commit checking logic
constants.ts Enhanced PR instruction generation to support template-based descriptions
index.ts Modified PR option description and reordered push/PR handling logic
package.json Updated AI SDK and other development dependencies to newer versions
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md Simplified PR template structure
.github/ISSUE_TEMPLATE/feature_request.md Streamlined feature request template format
.github/ISSUE_TEMPLATE/bug_report.md Condensed bug report template structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +99 to +100
} else if (unpushedCommits.total === 0) {
log.info("Branch is already up to date with remote! 👍");
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will never be reached because the code above already checks if unpushedCommits.total > 0 and returns early if the user doesn't confirm pushing. The else if should be just else since it only handles the case where unpushedCommits.total === 0.

Copilot uses AI. Check for mistakes.
await handlePush({ git, log, spinner });
}

if ((commitCount > 0 && !options.force && !options.yes) || options.pr) {
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition logic is complex and hard to read. Consider extracting this into a meaningful variable like shouldHandlePullRequest to improve readability and make the intent clearer.

Copilot uses AI. Check for mistakes.
@rafaelrcamargo rafaelrcamargo merged commit 89987f3 into main Sep 9, 2025
14 checks passed
@rafaelrcamargo rafaelrcamargo deleted the rafael/introduce-pr-template-compat branch September 9, 2025 20:57
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.

2 participants