Skip to content

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

Open
ovsrobot wants to merge 1 commit intomainfrom
series_37003
Open

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

Conversation

@ovsrobot
Copy link
Owner

@ovsrobot ovsrobot commented Jan 9, 2026

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

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

Summary by Sourcery

Documentation:

  • Document detailed coding, commit message, licensing, testing, and review expectations tailored for AI-based code review agents, derived from existing DPDK contributor guidelines.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive code review guidelines including standards for license requirements, commit formatting, C coding style, header organization, naming conventions, indentation, patch validation, ABI compatibility, build system configuration, and Python code. Includes severity taxonomy and structured review workflow.

✏️ 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)
- Linux kernel patch submission process (submitting-patches.rst)
- SPDX License Identifier specification (spdx.org)

Key sections include:
- SPDX license identifier requirements
- Commit message format and tag ordering
- C coding style rules and naming conventions
- Patch validation checklists with severity levels
- Meson build file style requirements

The document provides actionable checklists and concrete examples to
support integration with CI/CD pipelines and automated review systems.
Severity levels (error/warning/info) help tools prioritize feedback
appropriately.

This supports the broader goal of maintaining code quality and
consistency as the project scales, while reducing manual review burden
for maintainers on mechanical style issues.

References:
- https://doc.dpdk.org/guides/contributing/patches.html
- https://doc.dpdk.org/guides/contributing/coding_style.html
- https://www.kernel.org/doc/html/latest/process/submitting-patches.html
- https://spdx.org/licenses/

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

sourcery-ai bot commented Jan 9, 2026

Reviewer's Guide

Adds a new AGENTS.md documentation file that codifies DPDK-specific guidelines and checklists for AI-powered code review tools, covering licensing, commit messages, C/Meson/Python style, testing, ABI, and review process severity levels.

Flow diagram for AI patch validation checklist

flowchart TD
    A[Start_patch_review] --> B[Check_commit_message]
    B --> B1[Validate_subject_length_and_lowercase]
    B1 --> B2[Verify_component_prefix_and_imperative_mood]
    B2 --> B3[Check_no_trailing_period]
    B3 --> B4[Ensure_body_wrapped_at_72_chars]
    B4 --> B5[Confirm_Signed_off_by_present]
    B5 --> B6[If_bug_fix_check_Fixes_tag_and_order]
    B6 --> C[Check_license_headers]

    C --> C1[SPDX_identifier_on_first_line]
    C1 --> C2[License_matches_file_type]
    C2 --> C3[Blank_line_after_license_header]
    C3 --> D[Check_code_style]

    D --> D1[Line_lengths_and_tabs]
    D1 --> D2[No_trailing_whitespace]
    D2 --> D3[Includes_order_and_header_guards]
    D3 --> D4[Naming_conventions_and_prohibited_terms]
    D4 --> D5[Braces_functions_and_NULL_comparisons]
    D5 --> E[Check_structure_and_quality]

    E --> E1[Each_commit_compiles_independently]
    E1 --> E2[Code_and_docs_updated_together]
    E2 --> E3[Tests_added_or_updated]
    E3 --> E4[Release_notes_updated_if_needed]
    E4 --> F[Assign_severity_levels]

    F --> F1[Mark_missing_SPDX_Signed_off_by_or_ABI_break_as_Error]
    F1 --> F2[Mark_style_violations_and_missing_Fixes_as_Warning]
    F2 --> F3[Mark_minor_suggestions_as_Info]
    F3 --> G[Produce_review_report]
    G --> H[End_review]
Loading

File-Level Changes

Change Details Files
Introduce AGENTS.md as a centralized guideline for how AI tools should review DPDK patches, including detailed rules and checklists for commits, code style, builds, and review output.
  • Document SPDX license header requirements and acceptable licenses for different code types
  • Define strict commit message structure, required tags, and tag ordering for patches
  • Summarize DPDK C coding style (formatting, naming, control flow, macros, structures, and returns) tailored for automated checks
  • Capture code quality expectations around compilation, testing, documentation, and ABI compatibility
  • Provide a patch validation checklist formatted as items AI tools should verify
  • Specify Meson build file style and Python (PEP8) expectations
  • Describe how AI tools should report findings, including severity levels and guidance on citing rules and suggesting fixes
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

A new documentation file AGENTS.md has been added containing comprehensive code review guidelines for AI tools in DPDK projects, covering license requirements, commit messages, C coding style, build systems, Python standards, and structured review workflows.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md
New file (+410 lines) containing DPDK code review guidelines for AI tools, including standards for licenses, commit messages, C coding style, header organization, naming conventions, indentation, function layout, patch validation, ABI compatibility, Meson builds, Python code, and structured review workflow with severity taxonomy.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A guidebook hops into view,
With rules both old and shiny new,
For code that's clean and patches right,
AI reviews with guidelines bright!

🚥 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 clearly and specifically describes the main change: adding AGENTS.md documentation for AI-powered code review tools.
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

@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.

Hey - I've left some high level feedback:

  • A lot of this content duplicates existing contributor/development guidelines; consider replacing repeated sections with explicit links or concise summaries to reduce future risk of the AGENTS.md drifting out of sync with the canonical documentation.
  • It might help to clarify what should happen if AGENTS.md conflicts with existing guidelines (e.g., CONTRIBUTING, coding style, ABI policy), so that both humans and AI tools know which source of truth to follow when there is ambiguity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- A lot of this content duplicates existing contributor/development guidelines; consider replacing repeated sections with explicit links or concise summaries to reduce future risk of the AGENTS.md drifting out of sync with the canonical documentation.
- It might help to clarify what should happen if AGENTS.md conflicts with existing guidelines (e.g., CONTRIBUTING, coding style, ABI policy), so that both humans and AI tools know which source of truth to follow when there is ambiguity.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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: 3

🤖 Fix all issues with AI agents
In @AGENTS.md:
- Around line 358-368: Add a language identifier to the fenced code block
showing Meson build syntax so it gets proper syntax highlighting; change the
opening fence from ``` to either ```meson (preferred) or ```python (acceptable)
for the examples that define sources = files(...) and headers = files(...),
leaving the code content and closing fence unchanged.
- Around line 60-63: Update the three fenced code blocks that show commit tag
examples so they include a language identifier (use ```text) to ensure proper
formatting; specifically change the blocks containing the "Fixes:
abcdefgh1234..." example, the block starting with "# For Coverity issues:" and
the block listing tags like "Coverity issue:", "Bugzilla ID:", "Fixes:", etc.,
to open with ```text instead of plain ``` so the tag examples and tag order
render as plain text.
- Around line 42-51: Update the fenced code block containing the commit message
examples so it includes a language specifier for proper highlighting (e.g.,
change the opening "```" to "```bash" or "```text"); locate the block that
starts with "# Good examples" and ends with the closing "```" and modify only
the opening fence to include the chosen language specifier, leaving the block
contents and closing fence unchanged.
📜 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 5f6a12c.

📒 Files selected for processing (1)
  • AGENTS.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
AGENTS.md

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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review

Comment on lines +42 to +51
```
# Good examples
ixgbe: fix offload config option name
config: increase max queues per port
net/mlx5: add support for flow counters

# Bad examples
Fixed the offload config option. # past tense, has period
IXGBE: Fix Offload Config # uppercase
```
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 all fenced code blocks for proper syntax highlighting.

Fenced code blocks throughout the document are missing language identifiers. The block at this location should specify a language (e.g., bash or text for commit message examples) to enable proper rendering and syntax highlighting.

Proposed fix: Add language specifiers
-```
+```bash
 # Good examples
 ixgbe: fix offload config option name
 config: increase max queues per port
 net/mlx5: add support for flow counters
 
 # Bad examples
 Fixed the offload config option.    # past tense, has period
 IXGBE: Fix Offload Config           # uppercase
-```
+```
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

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

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In @AGENTS.md around lines 42 - 51, Update the fenced code block containing the
commit message examples so it includes a language specifier for proper
highlighting (e.g., change the opening "```" to "```bash" or "```text"); locate
the block that starts with "# Good examples" and ends with the closing "```" and
modify only the opening fence to include the chosen language specifier, leaving
the block contents and closing fence unchanged.

Comment on lines +60 to +63
```
Fixes: abcdefgh1234 ("original commit subject")
Cc: original_author@example.com
```
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 code blocks showing tag examples and tag order.

These sections demonstrate commit message tags and their ordering. Each fenced code block should have a language identifier (```text is appropriate for these structured examples).

Proposed fixes: Add language specifiers

For lines 60-63:

-```
+```text
 Fixes: abcdefgh1234 ("original commit subject")
 Cc: original_author@example.com
-```
+```

For lines 67-79:

-```
+```text
 # For Coverity issues:
 Coverity issue: 12345
 
 # For Bugzilla issues:
 Bugzilla ID: 12345
 
 # For stable release backport candidates:
 Cc: stable@dpdk.org
 
 # For patch dependencies:
 Depends-on: series-NNNNN ("Title of the series")
-```
+```

For lines 83-95:

-```
+```text
 Coverity issue:
 Bugzilla ID:
 Fixes:
 Cc:
 
 Reported-by:
 Suggested-by:
 Signed-off-by:
 Acked-by:
 Reviewed-by:
 Tested-by:
-```
+```

Also applies to: 67-79, 83-95

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

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

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In @AGENTS.md around lines 60 - 63, Update the three fenced code blocks that
show commit tag examples so they include a language identifier (use ```text) to
ensure proper formatting; specifically change the blocks containing the "Fixes:
abcdefgh1234..." example, the block starting with "# For Coverity issues:" and
the block listing tags like "Coverity issue:", "Bugzilla ID:", "Fixes:", etc.,
to open with ```text instead of plain ``` so the tag examples and tag order
render as plain text.

Comment on lines +358 to +368
```python
# Short list
sources = files('file1.c', 'file2.c')

# Long list
headers = files(
'header1.h',
'header2.h',
'header3.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 Meson build file syntax block.

This code block demonstrates Meson build syntax. Use a language identifier (meson or python, since Meson is Python-based) for proper highlighting.

Proposed fix: Add language specifier
-```python
+```meson
 # Short list
 sources = files('file1.c', 'file2.c')
 
 # Long list
 headers = files(
         'header1.h',
         'header2.h',
         'header3.h',
 )
-```
+```

Alternatively, if meson syntax highlighting is not available in the target environment, ```python is acceptable since Meson is Python-based.

🤖 Prompt for AI Agents
In @AGENTS.md around lines 358 - 368, Add a language identifier to the fenced
code block showing Meson build syntax so it gets proper syntax highlighting;
change the opening fence from ``` to either ```meson (preferred) or ```python
(acceptable) for the examples that define sources = files(...) and headers =
files(...), leaving the code content and closing fence unchanged.

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