On 11/15/26 01:15, Paul King wrote:
Hi folks,
COMPATIBILITY.md has become a regular source of merge conflicts
(around 50 commits touching it since October), because concurrent PRs
add their behaviour-change entries at the same spot, and entries
rarely cherry-pick cleanly between master and GROOVY_6_0_X. The
wishful thinking part of my brain hopes that some of the AI churn we
are seeing will slow down once some of the exotic edge cases that are
being discovered are tackled. But the pragmatic part of my brain
thinks, let's develop a more scalable scheme.
I think we should probably also think about what really goes in there
and what the description must contain. After all this is for humans in
the end, not for AI.
"Would a user upgrading from an earlier Groovy version have to
investigate or potentially change existing code because of this change?"
Should be the principle, but then the issue should also explain why.
The entry for 12644 for example enables mostly programs that previously
did not compile. That in itself is no breaking change. 12758 also does
not state why it is a breaking change really. 12457 is a fix in
behaviour, it does not explain why it is a breaking change really. 12763
could be considered a breaking change, but the feature is incubating. I
think incubating features should have different rules. I mean they are
incubating because we may still make changes.
12568 changes a program that would fail at runtime to one that fails
already at compile time... is that really a breaking change?
Also the document now shows two basic types of compatibility issues. One
I would consider the classic variant where it is about source or binary,
runtime behaviour, serialization, AST and compiler integration and Java
interoperability. The other category is bug-fixes that correct
previously incorrect behaviour, where the users may have dependent on.
I was thinking to keep the policy sections (stability tiers,
@GroovyABI, deprecation, etc.) in COMPATIBILITY.md, plus a short
index, and move each behaviour-change entry into its own file,
compatibility/changes/GROOVY-NNNNN.md, with a "since:" line giving the
first release that ships it. A small script could assemble the entries
into a per-version view for release notes and review. For humans,
recording a change means adding one small file instead of editing a
1,900-line one, and new entries should no longer conflict.
won´t the index also cause merge conflicts? Probably more easy to
resolve, but still. Using the issue as file name looks like a potential
problem. Looking at the existing entries some are actually about
multiple issues. And I think it makes sense to have that. But it does
not map well to GROOVY-NNNNN.md
There are some details to work out, e.g. backporting could mean
setting "since:" to the backport release, so the file is identical on
both branches and cherry-picks cleanly. A partial backport could be
split into two files, one per release (e.g. GROOVY-NNNNN.md for 6.0.1
and GROOVY-NNNNN-7.md for the rest in 7.0). For AI agents, the
existing links to the policy sections keep working; only the "where to
record a behaviour change" guidance in AGENTS.md, CONTRIBUTING.md and
the fix-workflow skill changes. Small per-issue files are also easier
and cheaper for agents to find and read than one large page. The
existing entries could be migrated mechanically either in a single
commit on master at a quiet moment, or via some interim scheme
supporting both approaches.
We can work out the finer details in issue/PR comments but I wanted to
get any initial feedback before filing an issue. Thoughts?
First of all I think doing a split is a good approach here. I just would
split differently...
First of all I would give the files semantic names like
collection-coercion.md or closure-metaclass-behaviour.md. That does not
exclude conflicts, but if they conflict maybe they should be together
instead of having them spread across multiple files.
Second I would consider each file to have a short identifier section.
And I would use YAML front matter for that. That allows easy processing
by tools. There we can mention a since, the issues, classifications like
impact and type. Maybe also a one-sentence-description for release
notes. Types might be API, AST, bytecode, compile static, compile
dynamic, runtime behaviour... something like that. It would be nice to
try to define a fixed set.
I would also consider having one directory per release, that then
contains the compatibility documents. I would not mix several releases
into the same file. So if not directories, then in the file name.
Intended effects:
- mostly no merge conflicts
- easier to generate release notes
- when adding a new entry you can potentially use the short description
to decide if it needs to be in an existing file or in a new file (new
file when not sure). Agents can use the description to judge if they
should look at the MD content.
- type can be used maybe downstream to decide if it is relevant for them
before the actual release
And maybe the MD part also needs some structural guidance (old
behaviour, new behaviour, impact, migration?), well I am just
brainstorming here, I do not want to make it too complicated to add
entries here.
bye Jochen