| name | pulsar-create-pr |
| description | Create a pull request to apache/pulsar |
| allowed-tools | Bash(gh *), Bash(find *), Bash(grep *), Read, Glob, Grep |
Create a pull request to apache/pulsar
To create a pull request to the apache/pulsar repository, you can follow these steps:
Precondition: Before creating a pull request, ensure that checkstyle and spotless check tasks pass locally. This can be done by running the following command in the root directory of the pulsar repository:
./gradlew spotlessCheck checkstyleMain checkstyleTest
Fix any checkstyle or spotless issues that arise before proceeding to create the pull request.
- Unless a specific branch other than master is provided, create a new branch for the changes.
Follow the naming convention:
${PULSAR_PR_BRANCH_PREFIX}[fix|improve|feat]-[brief-description].
- The
[fix|improve|feat] prefix reflects the type of change, matching the semantic commit message types defined in @.github/workflows/ci-semantic-pull-request.yml.
- The brief description should be concise and not exceed 30 characters.
PULSAR_PR_BRANCH_PREFIX is typically set to the user's initials followed by a hyphen (e.g., my-).
- Example:
my-fix-auth-npe-in-some-scenario.
Create the branch using the following command:
git switch -c [branch-name]
- Push the branch to the forked repository on GitHub. The remote name is specified by the
PULSAR_FORKED_REMOTE environment variable (default: forked). Set the upstream branch:
git push -u ${PULSAR_FORKED_REMOTE:-forked} [branch-name]
- Create a pull request using the GitHub CLI (
gh). Follow the format described in @.github/PULL_REQUEST_TEMPLATE.md and ensure the title matches the semantic conventions defined in @.github/workflows/ci-semantic-pull-request.yml.
- If the
PULSAR_PR_REVIEWERS environment variable is set, request reviews from the specified reviewers using the GitHub CLI (gh).
- When revisiting the PR later, update the description to reflect the latest changes and provide context for reviewers. Ensure it complies with @.github/PULL_REQUEST_TEMPLATE.md.
When referencing a PIP in the PR description header, include the PIP number such as PIP: 460 in the pull request description to provide context for reviewers. Link this to the PIP in the pip directory of the pulsar repository for easy access (for example, pip/pip-460.md).
When the PR is a fix for a specific issue, include the issue number in the PR description header (e.g., Fixes: #1234) to automatically link the PR to the issue on GitHub. If the issue is a task of an enhancement, use the format Closes: #1234 to indicate that the PR will close the issue once merged.