Skip to content

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

Closed
jdaugherty wants to merge 1 commit into
apache:7.0.xfrom
jdaugherty:docs/bug-fix-scope
Closed

jdaugherty wants to merge 1 commit into
apache:7.0.xfrom
jdaugherty:docs/bug-fix-scope

Conversation

@jdaugherty

Copy link
Copy Markdown
Contributor

Description

Adds a rule that keeps a bug fix to its own scope, proposed on dev@ in the thread "[DISCUSS] Keep a bug-fix pull request to the bug it fixes". It should merge only once that thread has settled.

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: 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.
  • A pre-existing finding gets an issue, or a pull request of its own on the oldest release branch that has the bug, instead of a change to the pull request under review. It does not block approval, and once answered with the base-branch result it is not raised again in a later round.
  • 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.
  • The reviewers can agree that a fix cannot be correct without a pre-existing case; the pull request then says so in its description.
  • A security fix still covers the whole vulnerability it fixes.

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", which also tells agents to sort each review finding before changing code.

Why: a bug fix that takes on behaviour already present on its base branch collects new review findings against the code added for it, and stays open. The dev@ thread has the examples.

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

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 bug-fix pull request changes only what 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 gets an issue or a pull request of
its own instead of a change to the pull request under review, does not block
approval, and is not raised again once answered with the base-branch result.
The rule covers pull requests that fix, or set out to fix, a bug or an
issue; 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 marked this pull request as draft December 1, 2026 20:55
@jdaugherty jdaugherty mentioned this pull request Dec 1, 2026
9 of 17 tasks
@jdaugherty

Copy link
Copy Markdown
Contributor Author

Moved to #17274, with the branch on apache/grails-core.

@jdaugherty jdaugherty closed this Dec 1, 2026
@jdaugherty
jdaugherty deleted the docs/bug-fix-scope branch December 1, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant