Create a pull request for the current branch following the Datadog Agent contributing guidelines.
Instructions
- •Check the current branch and ensure it's not
main - •Get the commits on this branch compared to
mainusinggit log main..HEAD - •Get the diff using
git diff main..HEADto understand all changes - •Read the PR template from
.github/PULL_REQUEST_TEMPLATE.md - •Push the branch to origin if needed
- •Open the PR: By default, open as Draft using
gh pr create --draft. If$ARGUMENTScontains--real, open as a regular (non-draft) PR instead (omit the--draftflag). Remove--realfrom$ARGUMENTSbefore processing remaining arguments as labels. - •PR title: Use conventional commits format, prefixed with the general area of change. Examples:
- •
fix(e2e): Fix flaky diagnose test - •
feat(logs): Add new log pipeline - •
refactor(config): Simplify endpoint resolution
- •
- •Labels: Choose appropriate labels (plus any additional labels passed as $ARGUMENTS):
- •If the PR only changes tests, docs, CI config, or developer tooling (no Agent binary code changes), use
changelog/no-changelogandqa/no-code-change - •If the PR changes Agent binary code and QA was done, use
qa/done - •If the PR changes Agent binary code, a reno release note is expected (remind the user)
- •Add
backport/<branch-name>if the user asks for a backport
- •If the PR only changes tests, docs, CI config, or developer tooling (no Agent binary code changes), use
- •PR body: Fill in the PR template sections:
- •What does this PR do?: A clear description of what is changed. Must be readable independently, tying back to the changed code.
- •Motivation: A reason why the change is made. Point to an issue if applicable. Include drawbacks or tradeoffs if any.
- •Describe how you validated your changes: How you validated the change (tests added/run, benchmarks, manual testing). Only needed when testing included work not covered by test suites.
- •Additional Notes: Any extra context, links to predecessor PRs if part of a chain, notes that make code understanding easier.
PR Description Guidelines (from CONTRIBUTING.md)
The PR description should incorporate everything reviewers and future maintainers need:
- •A description of what is changed
- •A reason why the change is made (pointing to an issue is a good reason)
- •When testing had to include work not covered by test suites, a description of how you validated your change
- •Any relevant benchmarks
- •Additional notes that make code understanding easier
- •If part of a chain of PRs, point to the predecessors
- •If there are drawbacks or tradeoffs, raise them
Example
bash
gh pr create --draft \ --title "fix(e2e): Fix flaky diagnose test by adding missing fakeintake redirect" \ --label "changelog/no-changelog" \ --label "qa/no-code-change" \ --body "$(cat <<'EOF' ### What does this PR do? <description of changes> ### Motivation <why this change is needed> ### Describe how you validated your changes <testing done> ### Additional Notes <any extra context> EOF )"
Usage
- •
/create-pr— creates a draft PR (default) - •
/create-pr --real— creates a non-draft PR - •
/create-pr --real team/my-team— non-draft PR with an extra label
Output
Return the PR URL when done.