Skip to content

Docs: Add PR review guide - #24051

Open
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/pr_review_guide
Open

Docs: Add PR review guide#24051
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/pr_review_guide

Conversation

@alamb

@alamb alamb commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

As our project grows both in terms of number of users as well as the number of PRs submitted (due to agents and increasing usage) I would like to trying to document / automate as much as possible

As one of the largest bottlenecks at the moment is PR review, so making that more efficient I think will help us improve the flow of code in the project and make best use of our committers' time. My rationale is that by documenting this process more clearly

  1. PR submitters (and/or their agents) can pre-review their own PRs to reduce back and forth with committers
  2. Committers (and/or their agents) have a checklist they can apply when reviewing

I also strongly believe effective documentation should be written for both humans and agents so I purposely didn't make a specific skill for this (instead I made a skill that points at the relevant parts of the docs)

What changes are included in this PR?

  1. Add a new PR review page to the contributor guide
  2. Try and distill project best practice
  3. Leave links to help people/agents find it

Are these changes tested?

By CI

Are there any user-facing changes?

New doc page

@codecov-commenter

codecov-commenter commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.86%. Comparing base (f3a895f) to head (7aec50c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24051      +/-   ##
==========================================
- Coverage   80.86%   80.86%   -0.01%     
==========================================
  Files        1101     1101              
  Lines      375446   375446              
  Branches   375446   375446              
==========================================
- Hits       303596   303586      -10     
- Misses      53757    53764       +7     
- Partials    18093    18096       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alamb
alamb force-pushed the alamb/pr_review_guide branch from 365a836 to 6760aad Compare August 2, 2026 11:07
@github-actions github-actions Bot added documentation Improvements or additions to documentation development-process Related to development process of DataFusion labels Aug 2, 2026
@@ -0,0 +1,33 @@
---
name: pr_review
description: Review Apache DataFusion pull requests following the project's PR review guide. Use whenever asked to review a DataFusion PR or PR URL, and whenever creating a PR, to check the changes against the same criteria before submitting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the hope is that this SKILL points back to the relevant PR review guide so agents can prepare the PR cleanly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

absolutely agree for As you said,

I also strongly believe effective documentation should be written for both humans and agents so I purposely didn't make a specific skill for this (instead I made a skill that points at the relevant parts of the docs)

Since AI will continue to evolve to mimic humans, I wonder if skills are strictly necessary. A contributor guide alone could be enough.
However, these days, it does help route the AI's exploration path (assuming routing to the .ai/ directory works).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

absolutely agree for As you said,

I also strongly believe effective documentation should be written for both humans and agents so I purposely didn't make a specific skill for this (instead I made a skill that points at the relevant parts of the docs)

Since AI will continue to evolve to mimic humans, I wonder if skills are strictly necessary. A contributor guide alone could be enough. However, these days, it does help route the AI's exploration path (assuming routing to the .ai/ directory works).

I agree skills are mostly the same as regular user doc.

I think this skills.md has two part:

  1. Coding agent specific instruction, like commands to run
  2. Idea/philosophy behind the reviewing process

And part 2 do point to an existing contributor doc. We should do something similar for other skills.md: try to explain the core ideas only in the user doc, skills.md should only reference it.


1. Is the feature or fix covered sufficiently with tests (see the [Testing](testing.md) section)?
2. Is the code clear, and fits the style of the existing codebase?
See the [Reviewing Pull Requests](pr_review.md) guide for what we look for

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I moved and expanded the content into its own page

The PR description is often what users and contributors will find when they run
`git log` / `git blame` and ask "why is the code like this?".

Check that the description:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This document basically distills down my experience reviewing PRs / what I do. I think it is common practice but would love additioanl feedback / suggestions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will hope to expand this with some examples going forwrd

@alamb
alamb marked this pull request as ready for review August 2, 2026 11:11
@alamb
alamb force-pushed the alamb/pr_review_guide branch from 6760aad to 7aec50c Compare August 2, 2026 11:11
@github-actions github-actions Bot removed the development-process Related to development process of DataFusion label Aug 2, 2026
## Compute the diff

```bash
git fetch apache main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in my setup I have two remotes, origin and upstream if i try this approach it will fail. Others can have similar settings. Should we use something like <main-remote> or <upstream-main>.

## Review the PR Description

The PR description is often what users and contributors will find when they run
`git log` / `git blame` and ask "why is the code like this?".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

both git log and git blame don't show pr description unless you are using inside an IDE and using its built in git blame feature, from cli you can view the pr description using gh pr view

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if want to get readable results for the pr body then can use gh pr view --json body --jq .body

@@ -0,0 +1,33 @@
---
name: pr_review
description: Review Apache DataFusion pull requests following the project's PR review guide. Use whenever asked to review a DataFusion PR or PR URL, and whenever creating a PR, to check the changes against the same criteria before submitting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

absolutely agree for As you said,

I also strongly believe effective documentation should be written for both humans and agents so I purposely didn't make a specific skill for this (instead I made a skill that points at the relevant parts of the docs)

Since AI will continue to evolve to mimic humans, I wonder if skills are strictly necessary. A contributor guide alone could be enough.
However, these days, it does help route the AI's exploration path (assuming routing to the .ai/ directory works).

@2010YOUY01 2010YOUY01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you. I read through it and strongly agree!

Comment on lines +91 to +94
Well written code comments are what makes the codebase understandable to the
next contributor.

Check that:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Well written code comments are what makes the codebase understandable to the
next contributor.
Check that:
The goal of code comments is not only for the code to be understandable after a reader spends time studying the implementation. It should make the implementation easy to understand for readers with the expected background.
Some practical guidelines for writing comments:

Emphasizing the philosophy here might help

valid as the code evolves.
4. New public APIs have doc comments, including examples where appropriate
(doc examples are also tested by CI, so they double as test coverage).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
5. When documenting modules, functions, or fields, start with simple examples and intuitive explanations, and optionally add formal, math-like definitions when necessary. This makes the implementation easier to reason about.
6. When something is confusing on first read, treat that as a good opportunity to improve the comments.

Here are some extra items I find useful.


1. Prefer `sqllogictest` (`.slt`) tests or DataFrame API tests where
possible, as they exercise **user visible behavior** and are less coupled
to internal implementation details than unit tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could insert a list item here like:

2. Try to cover edge cases and failure scenarios as well, rather than testing only the common successful path.

@@ -0,0 +1,33 @@
---
name: pr_review
description: Review Apache DataFusion pull requests following the project's PR review guide. Use whenever asked to review a DataFusion PR or PR URL, and whenever creating a PR, to check the changes against the same criteria before submitting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

absolutely agree for As you said,

I also strongly believe effective documentation should be written for both humans and agents so I purposely didn't make a specific skill for this (instead I made a skill that points at the relevant parts of the docs)

Since AI will continue to evolve to mimic humans, I wonder if skills are strictly necessary. A contributor guide alone could be enough. However, these days, it does help route the AI's exploration path (assuming routing to the .ai/ directory works).

I agree skills are mostly the same as regular user doc.

I think this skills.md has two part:

  1. Coding agent specific instruction, like commands to run
  2. Idea/philosophy behind the reviewing process

And part 2 do point to an existing contributor doc. We should do something similar for other skills.md: try to explain the core ideas only in the user doc, skills.md should only reference it.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants