Skip to content

[PWCI] "[RFC,v2] doc: add AGENTS.md for AI-powered code review tools"#617

Open
ovsrobot wants to merge 1 commit intomainfrom
series_37008
Open

[PWCI] "[RFC,v2] doc: add AGENTS.md for AI-powered code review tools"#617
ovsrobot wants to merge 1 commit intomainfrom
series_37008

Conversation

@ovsrobot
Copy link
Owner

@ovsrobot ovsrobot commented Jan 10, 2026

NOTE: This is an auto submission for "[RFC,v2] doc: add AGENTS.md for AI-powered code review tools".

See "http://patchwork.dpdk.org/project/dpdk/list/?series=37008" for details.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive contribution guidelines documentation covering licensing requirements, code style standards, commit message conventions, API tagging rules, and validation procedures.

✏️ Tip: You can customize this high-level summary in your review settings.

Add a structured reference document that enables AI code review tools
to validate DPDK contributions against project standards. This document
consolidates requirements from multiple sources into a machine-readable
format optimized for automated validation workflows.

The AGENTS.md file synthesizes guidelines from:
- DPDK Contributing Code documentation (patches.rst)
- DPDK Coding Style guidelines (coding_style.rst)
- DPDK validation scripts (check-git-log.sh, checkpatches.sh)
- Linux kernel patch submission process
- SPDX License Identifier specification

Key sections include:
- SPDX license and copyright header requirements
- Commit message format with precise limits (60 char subject,
  75 char body) and tag ordering rules
- C coding style including explicit comparison requirements
- Forbidden tokens table derived from checkpatches.sh
- API tag placement rules for experimental and internal APIs
- Patch validation checklists with severity levels

The forbidden tokens section documents restrictions on deprecated
atomics, logging functions, threading APIs, and compiler built-ins
that are checked by the existing checkpatches.sh infrastructure.

Severity levels (error/warning/info) align with the exit codes and
messaging from check-git-log.sh and checkpatches.sh to help automated
tools prioritize feedback appropriately.

References:
- https://doc.dpdk.org/guides/contributing/patches.html
- https://doc.dpdk.org/guides/contributing/coding_style.html
- devtools/check-git-log.sh
- devtools/checkpatches.sh

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @ovsrobot, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

Adds a new AGENTS.md documentation file that comprehensively defines AI-assisted review guidelines for DPDK contributions, covering licensing, commit message conventions, API tagging, code style enforcement, patch validation, and quality standards.

Changes

Cohort / File(s) Summary
AI Review Guidelines Document
AGENTS.md
Comprehensive 693-line reference document establishing review standards including: licensing/copyright requirements (SPDX, component-specific licenses), commit message conventions (subject/body formatting, required tags like Fixes/Coverity/Signed-off-by), API tagging rules (__rte_experimental/__rte_internal), code style enforcement (line length, indentation, naming, boolean/comparison practices, macro usage), code quality checklist (compilation, testing, documentation, ABI compatibility), patch validation steps, tooling guidance (meson/build/tests), forbidden tokens with recommended replacements, standards for logging/error handling/atomics/threading/compiler built-ins, API/structure constraints, Meson/Python formatting rules, and severity rubric (Error/Warning/Info) for AI review prioritization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A guidebook bound in markdown's art,
Where DPDK patches find their start,
From licensing rules to coding's way,
These agent-crafted guidelines save the day,
A checklist thorough, complete, and bright—
Five hundred lines to set things right! 📋✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an AGENTS.md document for AI-powered code review tools. It is specific, clear, and directly reflects the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @AGENTS.md:
- Around line 24-30: Change every Markdown code fence that contains C examples
to include the language identifier "c" on the opening backticks; e.g., replace
opening fences like ``` that wrap blocks beginning with "/*
SPDX-License-Identifier: BSD-3-Clause" or containing lines such as "#include
<stdio.h>" with ```c so all C snippets throughout the document (including the
other C blocks noted in the review) explicitly specify the C language.
- Around line 57-69: The fenced code blocks in the examples lack language
specifiers and should be updated to include appropriate languages for syntax
highlighting; locate the commit-message example block (the Good/Bad examples
showing net/ixgbe etc.) and the Fixes/tag example blocks referenced (around the
tag examples at 121–123, 135–147, and 153–165) and change the opening fences
from ``` to a language-specific fence such as ```text or ```diff where
appropriate (leave the closing ``` as-is), ensuring each example block has a
proper language label for readability.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd60dcd and c35a21b.

📒 Files selected for processing (1)
  • AGENTS.md
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[style] ~601-~601: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...y in headers - [ ] Alignment attributes only on struct/union - [ ] Packed attributes...

(ADVERB_REPETITION_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
AGENTS.md

57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


121-121: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


135-135: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


153-153: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


685-685: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (2)
AGENTS.md (2)

1-693: Comprehensive and well-structured reference document for AI-assisted code review.

The document effectively consolidates DPDK contribution guidelines into a machine-readable format. The organization into sections (licensing, commit messages, coding style, forbidden tokens, API tags, validation, severity levels) is logical and supports AI tool automation. The use of tables, checklists, and explicit examples makes the guidance actionable and testable.

Strengths:

  • Clear severity levels (Error/Warning/Info) that align with automation priorities
  • Comprehensive forbidden token tables with preferred alternatives
  • Specific commit message rules with examples of common mistakes
  • Validation checklist provides a template for AI tool behavior
  • API tag placement rules are precise and unambiguous

Minor observations:

  • The document is quite long (693 lines); consider if it needs an index or quick-reference section for frequently-checked rules
  • Some rules rely on external files (e.g., devtools/words-case.txt) that are not included; ensure these remain current and accessible

623-633: Specify language for Meson build example.

The Meson build file example at lines 623–633 should specify python as the language (Meson uses Python-like syntax).

🔧 Proposed fix
-```
+```python
 # Short list
 sources = files('file1.c', 'file2.c')
...
-```
+```

Likely an incorrect or invalid review comment.

Comment on lines +24 to +30
```c
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2024 ExampleCorp
*/

#include <stdio.h>
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Specify language for all C code examples.

All C code examples throughout the document (in licensing, style, API tag, and other sections) should specify c as the language identifier. Examples include lines 24–30, 209–219, 223–230, 277–308, 312–319, 323–333, 347–352, 362–369, 469–479, 487–491, 499–505, and 515–523.

🔧 Example fix pattern
-```
+```c
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2024 ExampleCorp
  */
 #include <stdio.h>
-```
+```

Also applies to: 209-219, 223-230, 277-308, 312-319, 323-333, 347-352, 362-369, 469-479, 487-491, 499-505, 515-523

🤖 Prompt for AI Agents
In @AGENTS.md around lines 24 - 30, Change every Markdown code fence that
contains C examples to include the language identifier "c" on the opening
backticks; e.g., replace opening fences like ``` that wrap blocks beginning with
"/* SPDX-License-Identifier: BSD-3-Clause" or containing lines such as "#include
<stdio.h>" with ```c so all C snippets throughout the document (including the
other C blocks noted in the review) explicitly specify the C language.

Comment on lines +57 to +69
```
# Good examples
net/ixgbe: fix offload config option name
config: increase max queues per port
net/mlx5: add support for flow counters
app/testpmd: fix memory leak in flow create

# Bad examples
Fixed the offload config option. # past tense, has period, no prefix
net/ixgbe: Fix Offload Config # uppercase after colon
ixgbe: fix something # wrong prefix, should be net/ixgbe
lib/ethdev: add new feature # wrong prefix, should be ethdev:
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language specifiers to fenced code blocks.

Multiple code blocks throughout the document lack language specifiers, which impacts readability and syntax highlighting. For example, the example commit messages at lines 57–69 and tag examples at lines 121–123, 135–147, and 153–165 should specify appropriate languages (e.g., text, diff, etc.).

🔧 Examples of fixes needed
-# Good examples
+```text
+# Good examples
 net/ixgbe: fix offload config option name
 config: increase max queues per port
...
-```
+```
+
+# And for the Fixes tag example:
-```
+```text
 Fixes: abcdefgh1234 ("original commit subject")
</details>



Also applies to: 121-123, 135-147, 153-165

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @AGENTS.md around lines 57 - 69, The fenced code blocks in the examples lack
language specifiers and should be updated to include appropriate languages for
syntax highlighting; locate the commit-message example block (the Good/Bad
examples showing net/ixgbe etc.) and the Fixes/tag example blocks referenced
(around the tag examples at 121–123, 135–147, and 153–165) and change the
opening fences from to a language-specific fence such astext or diff where appropriate (leave the closing as-is), ensuring each example block has
a proper language label for readability.


</details>

<!-- fingerprinting:phantom:triton:mongoose -->

<!-- This is an auto-generated comment by CodeRabbit -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants