en un clic
atlas-cli-open-pr
// Pre-PR validation and pull request creation workflow for the mongodb-atlas-cli repository. Use when the user asks to open a PR, create a pull request, submit changes for review, or push code to the repository.
// Pre-PR validation and pull request creation workflow for the mongodb-atlas-cli repository. Use when the user asks to open a PR, create a pull request, submit changes for review, or push code to the repository.
| name | atlas-cli-open-pr |
| description | Pre-PR validation and pull request creation workflow for the mongodb-atlas-cli repository. Use when the user asks to open a PR, create a pull request, submit changes for review, or push code to the repository. |
Run the validation script. It formats, lints, builds, tests, and regenerates docs — printing only errors:
./scripts/agent-pr-hook.sh
If any check fails, fix the reported issues and re-run until all checks pass. Stage and commit any files modified by formatting or doc generation.
For each changed .go file (excluding _test.go and mock), check for a corresponding _test.go. Warn about missing test files but let the user decide whether to proceed.
Ask the user before proceeding with this step. Only push and create a PR if the user explicitly confirms.
git push -u origin HEAD
Then create the PR using the repo's PR template:
gh pr create --title "CLOUDP-XXXXX: <description>" --body "$(cat <<'EOF'
## Proposed changes
_Jira ticket:_ CLOUDP-XXXXX
<Description>
## Checklist
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have added any necessary documentation (if appropriate)
- [x] I have run `make fmt` and formatted my code
## Further comments
<context>
EOF
)"
Fill in the actual ticket ID and adjust the checklist to reflect what was done. Provide a suncict and clear description of the code changes in the <Description> placeholder.