Skip to content

Contributing ​

First of all, thank you for looking to contribute to Saluki. We're excited to have you here.

This document covers filing issues and the lifecycle of a code change: making it, committing it, opening a pull request, adding a release note, addressing review feedback, and merging.

Filing issues ​

If you've discovered a bug, have a feature request, or have discovered a security issue, start by creating a new issue. We use GitHub issue templates to provide a number of pre-defined issue types, which will prompt you for the necessary information to help us understand the problem.

If none of the existing issue types fit your needs, create a Blank issue and provide as much information as you can.

Making a change ​

We strive for a high level of quality in terms of pull requests, and this guide is meant to help you understand what we expect from a PR so that you're not surprised during the review process.

Keep it small, focused ​

Avoid changing too many things at once.

For example, if you're working on changes to a component that requires adding new functionality to core types (topology builder, event model, etc), then you should split up your changes into multiple PRs, focusing first on the supporting changes and then the final change that makes the component use the new functionality. Stack dependent PRs on top of each other so that each one can be reviewed on its own.

Reviewers check the scope of each PR:

  • Large refactors that a pull request makes possible belong in later pull requests. Don't flag their absence.
  • Flag code that nothing in the pull request uses, such as a speculative helper or a feature that no caller connects. This is fine when the pull request description names the stacked pull request that uses the code.
  • If the change leaves a known hazard or a known performance gap, suggest a TODO comment that names it, or an issue, in a "Not blocking:" comment. Skip this when the pull request description already names the gap and the pull request that closes it.
  • Flag a pull request title that doesn't describe what the code does. We squash-merge, so the title becomes the commit title on main.

Testing ​

We generally require unit tests for bug fixes, as well as new features. See Testing for the kinds of tests we write, and Testing patterns for how to write them.

Sometimes, this can be difficult to do depending on the type of code change: some areas of code don't have a great way to be run independently and we often choose to not abstract code just to make it testable. This can sometimes require a little more thought and creativity to test the code.

A good rule of thumb to follow is that if you don't have to change the code to make it testable, then you should probably write a test for it. For example, if you're fixing a bug in an existing type, and that type is already being tested in other ways... then the overhead to add an additional test is low, and so you should do it.

Depending on the complexity of the change, we may insist that tests be included, even if it means adding additional abstractions. Reviewers will help guide you on this during the review process.

Documentation ​

If a change alters behavior, update the documentation, code comments, and rustdoc that describe it in the same PR. All documentation lives under docs/; see Where documentation lives.

Commit messages and PR titles ​

PR titles MUST follow the Conventional Commits format, which CI enforces. A title has a type, an optional scope in parentheses, and a short description in the imperative mood:

text
fix(dogstatsd): match core agent's listener startup behavior

The allowed types are:

  • feat: a new capability
  • enhancement: an improvement to an existing capability
  • fix: a bug fix
  • docs: documentation only
  • chore: everything else, such as refactoring, tests, CI, dependencies, and developer tooling
  • revert: reverting an earlier change

The scope names the area of the codebase you changed, such as config, agent-data-plane, dogstatsd, otlp, test, ci, deps, or dev. Look at recent history on main for the scopes already in use, and reuse one where it fits.

We usually squash-merge PRs, so the PR title becomes the commit title on main. Write it for someone reading the history a year from now: describe what changed, not how you got there. Wrap names of code items, configuration keys, and commands in backticks.

Commit messages on your branch should still describe the change, rather than read Fixed stuff or WIP. Keep in mind that they don't survive the squash: put anything a reviewer needs to know in the PR description.

Opening a pull request ​

Open the PR when the code is reviewable, or open it as a draft if you want to share code before it's ready for review.

Fill out the PR template (.github/PULL_REQUEST_TEMPLATE.md):

  • Summary: what the PR does and why, written so that a reviewer can give faster, better feedback
  • Change type: bug fix, feature, non-functional change, or performance
  • How did you test this PR?: the tests you added, and anything you ran by hand
  • References: issues the PR closes, and related issues or PRs

Before marking a PR ready for review, run the checks described in the Agent guide. A collaborator with write access can comment /dd-review on the PR to request an AI code review against our review guidelines.

Release notes ​

Every PR records whether it has customer-visible release information. When it does, add a Reno note under releasenotes/notes/. When it doesn't, ask a maintainer to apply the changelog/no-changelog label. The release-note check requires one of these choices before the PR can merge.

Release notes are the source for the curated section of each tagged GitHub release: reno report renders them as reStructuredText, and ci/tooling/release_notes.py render converts that to GitHub-flavored Markdown.

When a change needs a note ​

A note is needed when the change alters behavior that someone operating Agent Data Plane could observe: new or changed configuration, metrics, telemetry, defaults, performance characteristics, error handling, or a fixed bug.

A note isn't needed for changes with no observable effect on the shipped binary: tests, documentation, CI configuration, developer tooling, dependency bumps that change no behavior, and pure refactors.

Some features aren't ready for users to turn on yet. The diff, the docs, or the note says so, for example "not intended for production traffic." For such a feature, the note only says that the feature exists, without its configuration keys or defaults. A change that only makes such a feature work as intended doesn't need a note. An experimental feature that users can turn on still names its keys, such as experimental.metrics_endpoint_routing.metric_allowlist. The Datadog Agent changelog links to the Agent Data Plane GitHub release, so Datadog Agent users read these notes too.

Create the note ​

shell
make ensure-python-venv
.venv/bin/reno new describe-the-change --edit

--edit opens the new note in your editor. To create the file and edit it afterwards, use --no-edit instead.

Always create the file with reno new: the hexadecimal suffix it appends is the note's unique identifier, and two notes that share one break release-note rendering at release time. make check-release-notes rejects any filename that doesn't match <topic>-<16 lowercase hex characters>.yaml. If you can't install reno at all, generate a suffix with openssl rand -hex 8 rather than typing one.

Write the note ​

Choose one section from releasenotes/config.yaml, and remove every other section of the template, including its comments:

SectionWhen to use
upgradeA required operator action, or a major behavior change on upgrade
featuresA wholly new customer-visible capability
enhancementsA customer-visible improvement too small to be a feature
issuesA known customer-visible limitation
deprecationsA planned customer-visible removal
securityA customer-relevant security change
fixesA customer-visible correction
otherCustomer-visible release information that fits no other section

For example:

yaml
fixes:
  - |
    Fix a listener shutdown race that could drop telemetry during process exit.

People operating Agent Data Plane read these notes, not reviewers of your PR. Describe the observable effect rather than the implementation, and make each note self-contained: don't refer to PRs, commits, internal type names, or other release notes. Use a separate list item for each distinct change.

Reno renders note prose as reStructuredText, not Markdown, and make check-release-notes rejects Markdown spellings:

Instead of MarkdownWrite reStructuredText
`dogstatsd_port```dogstatsd_port``
[the docs](https://example.test)`the docs <https://example.test>`_
__important__**important**
# HeadingA title underlined with ===
A fenced code blockA .. code-block:: yaml directive
> quoted textIndentation, or a .. note:: directive

Validate notes locally with make check-release-notes and .venv/bin/reno lint.

Which release a note ships in ​

A note ships in the first release whose tag contains it. Each release line is cut to its own releases/X.Y.x branch before its first tag, so a change that merges to main after that cut ships in the next minor release, not in X.Y.0. To ship it on an existing line, backport it: the note comes along with the cherry-pick. A fix made only on a release branch carries its note in the pull request to that branch.

Because each line's first tag is on its release branch rather than main, Reno on its own would list the previous line's notes again under the next X.Y.0. The release tooling leaves them out. Release notes for a new line explains how Reno assigns notes and what the tooling corrects.

Addressing review feedback ​

The goals, in priority order, are:

  • make PR reviews, both initial and follow-up, easy for reviewers using GitHub
  • keep a meaningful history on main that explains, even years later, what each commit does and why

Before the first review ​

Before the first review, meaningful commits are best: logically encapsulated commits help the reviews go quicker and make the job for the reviewer easier. You can resolve conflicts with main by rebasing on origin/main and force pushing, if it makes future reviews easier.

After the first review ​

After the first review, make follow-up reviews easier:

  • Address feedback with additional commits on the PR branch. Rewriting history that was already reviewed makes follow-up reviews painful, because GitHub loses track of each comment.
  • Resolve merge conflicts with main by merging origin/main.
  • Reply to each comment: say what you changed, or explain why you didn't. Leave it to the reviewer to resolve the conversation.
  • In a stack of PRs, restacking after a change lower in the stack rewrites the branches above it. That's expected: keep the rewrite to the restack itself, and push feedback fixes as their own commits.

Responding to AI review ​

Treat a comment from an AI reviewer like any other review comment:

  • Answer each thread. Say what you changed, or give a short reason why you didn't. Don't resolve a thread without a reply.
  • Apply a nit only if it follows our conventions, not only because a reviewer asked for it.
  • If an agent replies for you, the reply says that an agent wrote it.

Merging to main ​

Once reviews are complete, merge to main with either:

  • the squash-merge option, which keeps the history of main clean, even though some details are lost in the squash. Always edit the commit message for the squash to concisely describe the change, without extraneous "address review comments" text.
  • the rebase-merge option, after manually rewriting the PR's commit history and force-pushing to the branch. When using this option, the branch must have a clean history. PRs merged this way can't be backported automatically (see Backporting a change).

Backporting a change ​

To ship a fix on an older release line, backport the change to that line's releases/X.Y.x branch. Label the PR with backport/X.Y.x, for example backport/1.8.x, and the Backport workflow opens a PR against releases/1.8.x for you. You can apply the label before or after the PR merges to main, and you can apply several labels to backport to several release lines. Removing a label before the merge cancels that backport.

The workflow cherry-picks the squash commit of the original PR, so it only supports squash-merged PRs. It refuses PRs that look rebase-merged, rather than backporting only part of the change. If the original PR includes a release note, the note comes along with the cherry-pick.

Stacked PRs work too. The workflow checks that the PR's own commit is on main, not which branch the PR targeted, so every PR in a stack whose commit lands on main can be labeled. If a PR in a stack was merged into its parent's branch instead, its change reaches main inside the parent's commit. The workflow refuses it and says so, so label the PR that was merged to main.

The new PR is titled <original title> (backport X.Y.x), and the original PR gets a comment linking to it. Review and merge it like any other PR. A clean cherry-pick can still fail to compile on an older branch if the change depends on something that only exists on main, so wait for CI before you merge.

A backport brings the code change, any version gate it needs, and its release note. It never brings an Agent version: each release line keeps its own .datadog-agent-version.json and target (see Datadog Agent version). The workflow refuses a PR that changes .datadog-agent-version.json, and its comment explains how to backport the change without it. A gate must select the behavior that the release line's target Agent expects. If a change needs a newer Agent minor than the line's target, it belongs on the release line for that minor.

When the backport fails ​

If the cherry-pick has conflicts, the workflow doesn't open a PR. Instead, it comments on the original PR with the commands to backport the change by hand. The comment also appears if releases/X.Y.x no longer exists. In that case, the release line is no longer maintained, so remove the label.

After you push your manual backport branch (named backport-<pr number>-to-X.Y.x) and open a PR, the workflow treats the backport as done.

To retry after a failure or a closed backport PR, remove the label and apply it again, or run the Backport workflow from the Actions tab with the original PR number and the release line, for example 1.8.x.

Release lines ​

Each releases/X.Y.x branch supports one Agent minor, its target, for its whole life. Releasing ADP covers how a line is cut and how its Agent is updated.

The backport/X.Y.x label for a release line is created automatically when its X.Y.0 release is tagged. When a release line is no longer maintained, delete its label and remove it from MAINTAINED_LINES in .github/workflows/update-agent-version.yml.

Version gates ​

A version gate switches ADP between old and new behavior based on the Agent version ADP was built with. Before you add or remove one, read Version gates.