Skip to content

dev docs: update guidance on code changes#37274

Open
martykulma wants to merge 2 commits into
MaterializeInc:mainfrom
martykulma:maz-pr-guidelines-update
Open

dev docs: update guidance on code changes#37274
martykulma wants to merge 2 commits into
MaterializeInc:mainfrom
martykulma:maz-pr-guidelines-update

Conversation

@martykulma

@martykulma martykulma commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

Authoring and reviewing changes are adjusting as AI usage increases and our PR workflows evolve (hello stacked PRs). This updates Materialize developer guidelines regarding code changes to address that evolution.

Description

  • adds a TL;DR section
  • adds a stacked PRs section
  • adds AI assisted review section
  • revise guidance for refactor, size limits (and breaking up changes), latency, and priority/urgency

@martykulma martykulma force-pushed the maz-pr-guidelines-update branch from f07bdb4 to d2e7a3d Compare June 26, 2026 13:18
@martykulma martykulma force-pushed the maz-pr-guidelines-update branch from d2e7a3d to 8442648 Compare June 26, 2026 15:06
@martykulma martykulma marked this pull request as ready for review June 26, 2026 15:12
Comment thread doc/developer/guide-changes.md Outdated
Comment on lines +39 to +40
* **[Self-review and pass CI](#polish-requirements)** before requesting
review; use draft PRs for early feedback.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think default to opening all PRs in draft until you have done a self review and PR checks are green is a solid best practice.

Should we suggest that people consider using LLMs to aid with self review here, we do have a pr review skill.

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.

1000%

Comment thread doc/developer/guide-changes.md Outdated
Comment thread doc/developer/guide-changes.md Outdated
Comment on lines +23 to +25
* **[Keep PRs small](#pr-size-limits)** — ideally under 500 lines; reviewers
often ask to split PRs over 1000. Limit each RU to one team's
[CODEOWNERS](/.github/CODEOWNERS) scope.

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.

Maybe we should make a note about "ideally under 500 lines of behavioral changes"? For instance, #37260 is a recent refactor that has about ~500 lines of code that needs paying attention to, split by behavioral / refactoring. However, it adds about 1000 lines of simple one line changes. Another instance are Console PRs where the majority of the changes are markup (JSX, html).

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.

Agree. The 500 lines is not a hard limit, they are targets because exceptions will always exist. I'll update to call that out.

I would say that PR should have had refactoring split out 😏

  • PR1: unify authZ
  • PR2: fix allowed_roles

Further down, I added a section on refactoring + behavioral changes (~ln:169) that suggests keeping them separate as a way to allow the reviewers to focus on the behavior changes.

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.

Valid take! After reading this doc, I think I'll split out my refactors by PR rather than commit from now on 💯

Comment thread doc/developer/guide-changes.md Outdated
description reads "do X *and* Y *and* Z," split it. Never mix refactoring and
behavior changes in the same RU.

* **[Keep PRs small](#pr-size-limits)** — ideally under 500 lines; reviewers

@SangJunBak SangJunBak Jun 26, 2026

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.

Not clear if "500 lines" means 500 lines of added code, or 500 lines of added+deleted code

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.

It should be 500 lines of changes. Will update!

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

Thanks for this thoughtful update

Comment thread doc/developer/guide-changes.md Outdated
change. For a project, that assumption can be flipped. Pair an implementer with
a dedicated reviewer/partner from the start: one writes the feature, the other
reviews it and stays close to the design throughout. When the reviewer already
shares your context, a larger diff is no longer overwhelming, so the pair can

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.

I don't agree that working with someone means larger diffs are no longer overwhelming. Also just because one person is working with someone on a project doesn't mean that others also won't be participating in reviews

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.

yikes, can't believe I left that in there. absolutely - i'll reword that.

arrived PRs at least once a day. Beyond that the throughput will vary: some days
you'll clear five or six PRs, other days you'll clear none, and both are fine.

When you have several PRs in your queue and can't get to them all at once, weigh

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.

Nice

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.

Thanks for asking the questions, it motivated me think more on what these 2 axes were!

@SangJunBak

SangJunBak commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Don't wanna bloat our PR guidelines and make it too verbose, but one thing I've seen people do and have adopted myself is when using AI agents to create a PR, adding a commit to publish the plan, then adding a commit to remove the plan at the end. At least as a reviewer, it gives me high level context of what's going on and as the reviewee, easy to compile if ran under a single AI session. Maybe worth putting under "### AI-assisted review" as a note like "It's encouraged to commit the generated plan for the session in a commit as long the plan is removed in another commit at the end"?

@Alphadelta14 Alphadelta14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving for generally good value, reasonable expectations, direct actions.
I'll do as i can to continually refer back to this from time to time to refresh my knowledge as i review/submit changes.

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

Looks good to me!

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.

5 participants