Skip to content

docs: keep a bug fix to its own scope - #17274

Merged
jdaugherty merged 5 commits into
7.0.xfrom
docs/bug-fix-scope
Dec 2, 2026
Merged

jdaugherty merged 5 commits into
7.0.xfrom
docs/bug-fix-scope

Conversation

@jdaugherty

@jdaugherty jdaugherty commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a rule that keeps a bug fix to its own scope, so that a fix that needs to ship soon is not held up by bugs that were already there. Contributors to an Apache project are volunteers who set their own priorities, so a review can suggest more work but cannot require it (see ASF basis below), and reviews written with agents have been presenting such suggestions as required changes. It is proposed on dev@ in the thread "[DISCUSS] Keep a bug-fix pull request to the bug it fixes", and should merge only once that thread has settled. It replaces #17273, which had the same change on a fork branch.

What the rule says

  • It applies to a pull request that fixes, or sets out to fix, a bug or an issue. A pull request that adds a feature or other new functionality is not covered.
  • In scope, and a condition of approval: the behaviour the pull request claims to fix, any regression it causes against its base branch, defects in the code it adds, and the tests, documentation and upgrade notes for those.
  • Pre-existing: anything that behaves the same on the base branch without the pull request, such as the same bug through another argument, setting, query form, datastore or Hibernate version, a difference the base branch already has, a refactoring, or a "while we are there" fix.
  • Before a finding is called a regression, its case is run on the base branch and the result goes in the reply.
  • Expanding the scope is optional. A reviewer can suggest that the pull request also takes on a pre-existing finding, but the suggestion never blocks approval and is never a reason to request changes. A review labels such a suggestion as optional, also when an agent helped write it. The author decides. By default the finding goes to an issue or to a separate pull request, and once it has been answered with the base-branch result it is not raised again as a blocker.
  • A fix for an in-scope finding narrows or removes what the pull request added rather than adding a new mechanism on top of it. When it would need new machinery, the author says so and waits for the reviewers.
  • A security fix still covers the whole vulnerability it fixes.
  • Agents implement the in-scope findings, and take on a pre-existing finding only when the human asks for it. Agents that review a pull request present a pre-existing finding as an optional suggestion, never as a required change, a reason to request changes, or a condition of approval.

Where

  • CONTRIBUTING.md: a new subsection, "Keeping a Bug Fix to Its Scope", at the end of "Change Review Process".
  • AGENTS.md (which CLAUDE.md links to): critical rule 15, and a "Bug-fix scope" section under "Pull Request Guidelines".

It targets 7.0.x so that every release branch gets the rule through the usual merge-up.

ASF basis

  • "All participants in ASF projects are volunteers": How the ASF works.
  • "As an ASF volunteer, you have the right to set your own priorities and do the work that scratches your own itch.": Committers' FAQ.
  • "To prevent vetoes from being used capriciously, the voter must provide with the veto a technical justification showing why the change is bad" and "A veto without a justification is invalid and has no weight.": Apache Voting Process. A bug that was already there on the base branch does not show that a fix is bad.
  • "It's also good to encourage developers by suggesting new related work they may like to volunteer to work on.": Incubator, Guide to Successful Community Building.

Why: November 2026

I went through the reviews on the 41 public pull requests I took part in from 2026-11-01 to 2026-12-01. I counted each time a pull request took on behaviour that was the same on its base branch without it, whether a review asked for it or the author (often me) widened it unasked. A regression the pull request caused, or a bug in its own new code, is not counted.

  • 92 cases on 41 pull requests. In 61 of them the thread shows the same result on the base branch. The other 31 were outside what the pull request claimed, but nobody ran them on the base.
  • 65 were review asks, and 62 of those were taken on. 16 of those asks were mine, and in 27 more cases I widened a pull request unasked.
  • 234 commits went into these cases. In 61 cases the code added for the older bug drew review findings of its own, which then had to be fixed too.
  • Timing: the median time from an ask to the first commit for it was about 9 hours, and to the last commit about 2 days. 26 cases ran past 3 days and 12 past a week.
  • 22 of the 41 pull requests are still open.

Effect on 8.0.1

Examples

  1. Sort where queries by an association the query filters on #16853 (7.0.x, sorting a where query by an association) grew from one fix to "53 commits, 24 files and about 6,200 added lines" (comment). It was split into twelve stacked pull requests, Sort list by every sort property, and join an association once #17062 to Sort by a path that starts with the alias of the queried class #17073, and four of those are still open. In the author's words, it "grew whenever a fix also took on an older issue nearby (...), which gave the next round more to find" (comment).
  2. Sort by an association with Hibernate 7 as with Hibernate 5, and keep the rows without it with leftJoinAssociationSort #16863 and Apply a requested join type with Hibernate 7 #17079 (8.0.x) are mine, and are still open after 87 reviews from other committers in November.
  3. Validate the constraints declared on a multi-tenant entity's tenant id #16840 (7.0.x): we first agreed to track a MongoDB case separately as MongoDB: an associated object saved with its owner is dropped without an error when its tenant id breaks a declared constraint #16855, and I then implemented it in the pull request anyway (ask). Eleven commits later, "each of the ten review rounds since Nov 4 has found new cases". It is still open, 27 days on.
  4. 8.0 (fix): Start with another CacheManager next to the Grails cache plugin's #16980 (8.0.x): an ask to choose the cache manager differently from 8.0.0 (ask) led to a three-day rewrite. The rewrite brought a startup failure with lazy beans and a binary-compatibility break for compiled plugins. The pull request then went back to Spring's choice and moved the rule to 9.0 (9.0: Cache annotations use grailsCacheManager before a primary or prioritized cache manager #17152). Production code went from 882 added lines back to 279.
  5. Apply a join type that a criteria query requests #17069 (7.0.x, mine): an ask to apply a requested join type in one more case, which the pull request had left out on purpose (ask), was taken on and merged. The next day it turned up as a regression against 7.0.17, GORM for Hibernate 5: a requested left join of a collection that the criteria also join loads only some of its elements #17198.
  6. fix(hibernate5): merge writes the changed fields of a detached instance, criterion in junction #16845 (8.0.x), my ask: I asked for merge() to also write three kinds of instance that 8.0.x does not write either (ask). The code added for it drew two defects, then a third round on cases that were also pre-existing. The pull request was later replaced by fix(hibernate5): merge writes the changed fields of a detached instance #17044.

At least three of my asks offered a way out ("If that is too far from #16813, say so", "Either restore the previous cacheable value or say in the Javadoc that it stays off", "If H5 queries are meant to be out of scope here, please say so"). Each time, the pull request took the fix on. That is why the rule makes the expanded scope explicitly optional, rather than leaving it to the reviewer's wording.

Per pull request

PR Base State Cases (base result shown) Commits for them Reviews by others after the first Days from the first to merge, or open
#16863 8.0.x open 14 (12) 54 40 26 (open)
#17079 stacked open 6 (4) 15 45 10 (open)
#16980 8.0.x merged 1 (1) 8 22 9
#16853 7.0.x merged 12 (10) 55 30 21
#17018 9.0.x merged 1 (0) 5 15 2
#16840 7.0.x open 3 (2) 14 25 27 (open)
#16836 8.0.x open 6 (5) 14 15 26 (open)
#16816 8.0.x open 1 (1) 2 17 26 (open)
#17073 stacked open 3 (1) 6 12 8 (open)
#17162 9.0.x open 2 (1) 12 9 6 (open)
#16820 stacked open 1 (0) 1 8 26 (open)
#17087 8.0.x merged 2 (1) 8 8 2
#17070 7.0.x open 1 (0) 2 11 8 (open)
#17072 stacked open 1 (0) 3 10 10 (open)
#17071 stacked open 2 (1) 8 10 7 (open)
#17182 7.0.x open 1 (0) 6 8 5 (open)
#17180 7.0.x open 2 (2) 5 7 5 (open)
#17172 8.0.x open 3 (3) 9 6 5 (open)
#17114 9.0.x open 4 (4) 7 11 5 (open)
#17037 7.0.x merged 1 (1) 1 7 7
#17069 7.0.x merged 1 (1) 2 9 5
#16773 8.0.x merged 2 (2) 5 7 4
#16879 8.0.x merged 1 (0) 2 3 1
#16901 8.1.x merged 1 (1) 1 5 1
#17260 8.0.x open 1 (1) 2 4 0 (open)
#17086 7.0.x merged 1 (0) 3 3 2
#16845 8.0.x closed 1 (0) 4 5 9
#16982 7.2.x closed 1 (0) 2 5 12
#16866 8.0.x merged 1 (1) 1 5 19
#16986 7.0.x open 1 (0) 3 5 14 (open)
#16821 stacked open 2 (1) 3 5 13 (open)
#17014 7.0.x open 2 (0) 3 5 16 (open)
#17052 7.0.x open 1 (1) 2 5 10 (open)
#17092 7.0.x merged 1 (1) 1 4 1
apache/grails-intellij-plugin#463 main merged 1 (0) 1 4 1
#16763 8.0.x open 2 (0) 2 4 13 (open)
#17203 8.0.x merged 1 (0) 2 3 0
#17074 9.0.x merged 1 (1) 1 2 4
#16827 8.0.x merged 1 (1) 1 2 0
#16822 stacked open 1 (1) 1 1 4 (open)
#17089 8.0.x merged 1 (0) 1 0 0
All 92 cases

"Kind" says who started it. "Base result shown" is yes when the thread shows the same result on the base branch. Times run from the ask to the commits that addressed it; for my own expansions there is no ask to time from.

PR Ask Kind Base result shown Commits Ask to first change Ask to last change
#16863 2026-11-23 review ask on my PR yes 6 3.9d 7.7d
#16863 2026-11-05 review ask on my PR yes 5 2.6h 22.9d
#16863 2026-11-23 review ask on my PR no 2 35.0h 4.5d
#16863 2026-11-25 review ask on my PR yes 2 0.5h 47.2h
#16863 2026-11-25 review ask on my PR yes 1 – –
#16863 2026-11-05 my own expansion yes 11 2.2h 26.1d
#16863 2026-11-05 my own expansion yes 5 10.5h 22.6d
#16863 2026-11-05 my own expansion yes 3 15.6d 22.1d
#16863 2026-11-05 my own expansion yes 3 19.0d 22.1d
#16863 2026-11-05 my own expansion yes 1 – –
#16863 2026-11-05 my own expansion yes 1 – –
#16863 2026-11-05 my own expansion yes 4 21.5d 22.5d
#16863 2026-11-05 my own expansion yes 7 19.0d 24.0d
#16863 2026-11-27 my own expansion no 3 – –
#17079 2026-11-26 review ask on my PR yes 3 9.9h 26.7h
#17079 2026-11-21 review ask on my PR no 5 30.4h 10.2d
#17079 2026-11-27 review ask on my PR no 2 3.9h 6.7h
#17079 2026-11-30 review ask on my PR yes 3 0.5h 3.1h
#17079 2026-11-27 review ask on my PR yes 1 3.1d 3.1d
#17079 2026-11-28 my own expansion yes 1 – –
#16980 2026-11-14 review ask yes 8 2.0h 3.6d
#16853 2026-11-04 my review ask yes 4 0.6h 16.1d
#16853 2026-11-04 my own expansion yes 6 – –
#16853 2026-11-17 my own expansion yes 3 – –
#16853 2026-11-05 my own expansion yes 10 – –
#16853 2026-11-05 my own expansion yes 4 – –
#16853 2026-11-04 my review ask yes 7 – –
#16853 2026-11-05 my own expansion yes 7 – –
#16853 2026-11-06 my own expansion yes 1 – –
#16853 2026-11-08 review ask yes 4 – –
#16853 2026-11-09 review ask no 2 – –
#16853 2026-11-09 my own expansion yes 3 – –
#16853 2026-11-09 review ask no 4 – –
#17018 2026-11-17 my review ask no 5 1.6h 21.4h
#16840 2026-11-04 review ask no 11 1.2h 5.2d
#16840 2026-11-04 my own expansion yes 2 45.0h 45.0h
#16840 2026-11-06 my own expansion yes 1 – –
#16836 2026-11-05 my review ask no 7 16.7h 5.4d
#16836 2026-11-10 review ask yes 1 21.3h 21.3h
#16836 2026-11-10 review ask yes 1 8.8h 8.8h
#16836 2026-11-12 review ask yes 1 44.7h 44.7h
#16836 2026-11-14 review ask yes 1 23.6h 23.6h
#16836 2026-11-16 review ask yes 3 13.8h 7.8d
#16816 2026-11-04 my review ask yes 2 2.1d 2.1d
#17073 2026-11-23 review ask on my PR no 3 27.1h 4.4d
#17073 2026-11-27 my own expansion yes 2 – –
#17073 2026-11-26 review ask on my PR no 1 30.4h 30.4h
#17162 2026-11-25 my review ask yes 5 10.1h 25.5h
#17162 2026-11-25 my review ask no 7 27.1h 2.6d
#16820 2026-11-04 my review ask no 1 5.7h 5.7h
#17087 2026-11-20 review ask no 4 6.2h 2.1d
#17087 2026-11-22 review ask yes 4 0.8h 17.4h
#17070 2026-11-23 review ask on my PR no 2 25.9h 25.9h
#17072 2026-11-21 review ask on my PR no 3 28.1h 6.4d
#17071 2026-11-24 review ask on my PR yes 7 14.5h 40.4h
#17071 2026-11-23 review ask on my PR no 1 18.8h 18.8h
#17182 2026-11-26 review ask on my PR no 6 0.2h 4.9d
#17180 2026-11-26 review ask on my PR yes 1 0.5h 0.5h
#17180 2026-11-26 review ask on my PR yes 4 25.0h 3.7d
#17172 2026-11-26 review ask on my PR yes 2 0.9h 5.0d
#17172 2026-11-26 my own expansion yes 3 0.1h 4.9d
#17172 2026-12-01 my own expansion yes 4 0.3h 2.9h
#17114 2026-11-26 my own expansion yes 1 6.7h 6.7h
#17114 2026-11-26 my own expansion yes 4 6.8h 4.3d
#17114 2026-11-26 my own expansion yes 2 7.3h 5.3d
#17114 2026-11-26 my own expansion yes 0 – –
#17037 2026-11-22 review ask yes 1 0.6h 0.6h
#17069 2026-11-21 review ask on my PR yes 2 29.2h 3.3d
#16773 2026-11-05 my own expansion yes 2 – –
#16773 2026-11-05 review ask yes 3 10.8h 44.1h
#16879 2026-11-10 review ask no 2 0.5h 12.3h
#16901 2026-11-09 review ask yes 1 8.6h 8.6h
#17260 2026-12-01 review ask on my PR yes 2 0.3h 3.5h
#17086 2026-11-20 review ask no 3 6.2h 2.5d
#16845 2026-11-09 my review ask no 4 1.3h 7.4d
#16982 2026-11-18 my review ask no 2 5.1h 35.2h
#16866 2026-11-05 my review ask yes 1 16.7h 16.7h
#16986 2026-11-17 my review ask no 3 7.3h 2.9d
#16821 2026-11-27 my review ask yes 2 33.3h 33.3h
#16821 2026-11-17 review ask no 1 41.1h 41.1h
#17014 2026-11-15 review ask no 2 16.9h 2.2d
#17014 2026-11-20 review ask no 1 10.8h 10.8h
#17052 2026-11-21 review ask yes 2 8.7h 21.9h
#17092 2026-11-21 review ask yes 1 19.5h 19.5h
apache/grails-intellij-plugin#463 2026-11-19 my review ask no 1 2.3h 2.3h
#16763 2026-11-18 review ask no 1 2.1h 2.1h
#16763 2026-11-18 review ask no 1 2.1h 2.1h
#17203 2026-11-28 review ask no 2 2.7h 2.8h
#17074 2026-11-21 review ask on my PR yes 1 32.6h 32.6h
#16827 2026-11-03 review ask yes 1 0.7h 0.7h
#16822 2026-11-27 my review ask yes 1 36.7h 36.7h
#17089 2026-11-20 my review ask no 1 2.2h 2.2h

The cases were classified from the review threads; nothing was re-run for this summary. Several cases can share a review round, so the per-case numbers are not summed into review totals; the per pull request review counts come from GitHub.

Contributor Checklist

Please review the following checklist before submitting your pull request. Pull requests that do not meet these requirements may be closed without review.

Issue and Scope

  • This PR is linked to an existing issue that has been acknowledged or approved by the project team. If no approved issue exists, please give background on why this change is necessary. Tickets are preferred for release change log history.
  • This PR addresses the complete scope of the linked issue. Partial implementations or unfinished work should not be submitted for review.
  • This PR contains a single, focused change. Unrelated changes should be submitted as separate pull requests.
  • This PR targets the correct branch for the type of change (see Choosing the Branch):
    • Maintenance branches, whose minor version has been released and that still get patch releases (e.g., 7.0.x, 7.2.x, 8.0.x): Bug fixes only, released as the next patch version. No new features or API changes. A bug fix targets the oldest release branch that has the bug and still gets releases, and is merged up.
    • Next minor branch, until its minor version is released (e.g., 8.1.x before 8.1.0): New features are welcome, but breaking existing APIs must be avoided.
    • Next major branch, until its major version is released (e.g., 9.0.x before 9.0.0): Reserved for major changes. Breaking API changes are permitted.
  • If this PR changes a result, it follows Fixes That Change a Result. A result is what a call that works today returns, stores, renders, binds or maps to, and a fix that makes such a call throw changes one too.
    • The description says which results change, how to get the old ones, and whether the fix needs a setting, and why.
    • The release notes and the upgrade guide section of the release that carries it have a note, and the upgrade skill (grails-skills/upgrade/skills/grails-upgrade/SKILL.md) has the same entry.
    • A setting it adds has a row on the Compatibility Settings page, and an issue for each later step: turning it on and removing it.
    • On a maintenance branch or the next minor branch, it waits for two approving reviews.

Code Quality

  • I have added or updated tests that cover the changes introduced in this PR. All code contributions are expected to include appropriate test coverage. (Documentation only.)
  • I have verified that all existing tests pass by running ./gradlew build --rerun-tasks.
  • My code follows the project's code style guidelines. I have run ./gradlew codeStyle and resolved any violations. See Code Style for details. (Documentation only.)
  • This PR does not include mass reformatting, style-only changes, or large-scale refactoring unless it was explicitly approved in the linked issue. Unsolicited reformatting will not be accepted.
  • If generative AI tooling was used in preparing this contribution, a quality model was used to ensure contributions are consistent with the project's quality standards.

Licensing and Attribution

Documentation

  • If this PR introduces user-facing changes, I have included or updated the relevant documentation.
  • If this PR adds a new feature, I have updated the What's New section of the Grails Guide.
  • If this PR introduces breaking changes or changes that require user action during an upgrade, I have updated the Upgrade Notes for the corresponding version in the Grails Guide.
  • The PR description clearly explains what was changed and why.

First-time contributors: Please read our Contributing Guide before submitting.
Pull requests that appear to be auto-generated, incomplete, or unrelated to an approved issue may be
closed to help maintainers focus on reviewed and planned work. We appreciate your understanding.

A pull request that fixes, or sets out to fix, a bug or an issue is
approved on the bug it claims to fix, the regressions it causes against its
base branch and its own new code. A review finding that behaves the same on
the base branch is pre-existing: a reviewer can suggest taking it on, but
that is optional and never a condition of approval, and by default it goes
to an issue or a pull request of its own. Pull requests that add features
or other new functionality are not covered.

Adds the rule to CONTRIBUTING.md under the change review process, and to
AGENTS.md as critical rule 15 with a bug-fix scope section.
@jdaugherty jdaugherty mentioned this pull request Dec 1, 2026
9 of 17 tasks
A pre-existing finding goes to an issue or a separate pull request by
default; the rule does not say which branch that pull request targets or
whether it is backported.
Contributors to an Apache project are volunteers who choose what they
work on, so a review can suggest taking on a pre-existing finding but
cannot require it. A review labels such a suggestion as optional, also
when an agent helped write it, and AGENTS.md tells reviewing agents to.
Quote and link How the ASF works, the Committers' FAQ, the Apache Voting
Process and the Incubator's Guide to Successful Community Building where the
bug-fix scope rule says that a review can suggest more work but cannot
require it.
@jdaugherty

Copy link
Copy Markdown
Contributor Author

This was approved via the weekly meeting, merging.

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