# Start providing version in revapi ignores

**URL:** <https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894>\
**Category:** Development\
**Tags:** proposal\
**Created:** [September 29, 2026, 2:54pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894 "2026-09-29T14:54:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [September 29, 2026, 2:54pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/1 "2026-09-29T14:54:04Z")

</div>

Hi everyone,

so we have this problem for a while (EDIT: it is actually ticket [Loading...](https://jira.xwiki.org/browse/XINFRA-292)) that currently the revapi ignores we put in our pom.xml doesn’t contain any version information. It’s a problem because when we’re performing a release we cleanup the revapi ignores, and some might have been added in master after the branch where to perform the release was created and our tools currently cannot guess easily which ignores to remove.

So my proposal is to start using the `attachments` elements of revapi schema: [Differences Transformation :: Revapi](https://revapi.org/revapi-basic-features/0.13.1/differences.html#%5C%5C%5C_properties) . This element is basically a map that we use the way we want. I propose that we use an element `version` in it, containing the version the revapi ignore targets.

For example, in master before a 18.8.0 release I could have:

```xml
<revapi.differences>
  <justification>The justification for breaking stuff</justification>
  <criticality>highlight</criticality>
  <attachments>
    <version>18.8.0</version>
    <version>18.4.7</version>
  </attachments>
  <differences>
    <item>
      <ignore>true</ignore>
      <code>java.method.removed</code>
      <old>method boolean org.xwiki.user.UserManager::myMethod()</old>
    </item>
  </differences>
</revapi.differences>
<revapi.differences>
  <justification>The justification for breaking stuff</justification>
  <criticality>highlight</criticality>
  <attachments>
    <version>18.9.0-rc-1</version>
    <version>18.4.7</version>
    <version>17.10.14</version>
  </attachments>
  <differences>
    <item>
      <ignore>true</ignore>
      <code>java.method.removed</code>
      <old>method boolean org.xwiki.user.UserManager::someOtherMethod()</old>
    </item>
  </differences>
</revapi.differences>

```

Then calling the compatibility cleanup on master after releasing 18.8.0 would only remove the first occurence. The algorithm would be to remove all occurences matching the version released basically.

The fact that we can put multiple version is only to help backporting without having to edit the ignores. We could also do it without that support if we want to avoid any mistake, and force people having to put the version manually.

Now I guess we should have a way to verify that any time we put a ignore we also have the version attached, I’m not sure at this point how it’s doable.

WDYT?

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [September 29, 2026, 5:04pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/2 "2026-09-29T17:04:29Z")

</div>

+1

> [@surli](#):
>
> Now I guess we should have a way to verify that any time we put a ignore we also have the version attached, I’m not sure at this point how it’s doable.

I guess that should not be too hard to implement that in an enforcer rule. It would also be in charge of making sure one of the version really matches the current branch next version.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [September 30, 2026, 8:19am UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/3 "2026-09-30T08:19:11Z")

</div>

If I read the [schema definition](https://github.com/revapi/revapi/blob/main/revapi-basic-features/src/main/resources/META-INF/differences-schema.json#L102-L107) correctly the same key is not accepted several times in the `attachments` element, so I suggest moving to a comma separated format instead.  
Maybe with a best practice to always list version from the most recent to the least.

```xml
<attachments>
  <versions>18.9.0-rc-1,18.4.7,17.10.14</versions>
</attachments>

```

+1 for the tool support that feels essential to make this work.

---

<div class="post-metadata">

**Author:** ![pjeanjean](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pjeanjean/32/5901_2.png) [@pjeanjean](https://forum.xwiki.org/u/pjeanjean)\
**Post date:** [September 30, 2026, 1:47pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/4 "2026-09-30T13:47:00Z")

</div>

+1 overall, I’m just wondering if we actually need to list all the target versions here. If it’s only a technical information for our scripts, it might be less error prone to add a “update revapi difference version” to the backport process, no?

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [September 30, 2026, 1:50pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/5 "2026-09-30T13:50:07Z")

</div>

> [@pjeanjean](#):
>
> I’m just wondering if we actually need to list all the target versions here. If it’s only a technical information for our scripts, it might be less error prone to add a “update revapi difference version” to the backport process, no?

Honestly I’m not sure either about this. In some cases you know in advance in which branch the backport ignores will be exactly the same, in some other you don’t. So the idea behind my proposal would be to allow providing multiple version, but I wouldn’t enforce it: if a dev prefer to indicate a unique version per ignore per branch it’s perfectly fine.

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [November 26, 2026, 11:14am UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/6 "2026-11-26T11:14:00Z")

</div>

Hi everyone,

I’ve started working on the tooling for this, two PRs are ready for review:

- [XCOMMONS-3934: Enforce indicating the target version of Revapi ignores by surli · Pull Request #2270 · xwiki/xwiki-commons · GitHub](https://github.com/xwiki/xwiki-commons/pull/2270) (XCOMMONS-3934): a new enforcer rule `revapiIgnoreVersionCheck`
- [XINFRA-292: Backward compatibility cleanup script removes all excludes from master by surli · Pull Request #23 · xwiki/xwiki-dev-tools · GitHub](https://github.com/xwiki/xwiki-dev-tools/pull/23) (XINFRA-292): the adapted `backward_compatibility_cleanup.sh`

Following @mleduc’s remark (the schema doesn’t accept the same key twice), the versions are a comma-separated list in a `versions` attachment, either on the item or on the whole `revapi.differences` group (the item wins):

```xml
<revapi.differences>
  <justification>...</justification>
  <attachments>
    <versions>19.0.0-rc-1,18.10.1</versions>
  </attachments>
  <differences>
    ...
  </differences>
</revapi.differences>

```

Note that revapi only adds attachments to the differences, it doesn’t use them for matching, so it doesn’t change what gets ignored.

**Enforcer rule** (as suggested by @tmortagne): the build fails if an ignore has no `versions`, or if none of its versions is greater than `xwiki.compatibility.previous.version` and lower than or equal to the current version of the branch. I didn’t go for “must match the exact version of the branch”: master legitimately keeps ignores of the not-yet-released stable version, and it allows backporting an ignore with its whole list without editing it.

**Cleanup script** : this is where I’m diverging a bit from my first post. Instead of removing the ignores matching the released version, it keeps in each list only the versions in that same window, and removes the ignore only when nothing is left. For example:

- on master after releasing 18.10.1, `18.10.1,19.0.0-rc-1` becomes `19.0.0-rc-1`
- on master after releasing 18.10.0, `19.0.0-rc-1` is kept (what we lose today)
- on stable-18.10.x after releasing 18.10.1, `18.10.1,19.0.0-rc-1` is removed: `19.0.0-rc-1` belongs to master, which has its own copy of the ignore

So to answer @pjeanjean’s point: listing several versions is optional, and you never need to update the list by hand during a backport, the cleanup trims each branch’s copy at its next final release.

Once the commons PR is merged, all the existing ignores of rendering and platform will need to be tagged at the same time, otherwise their builds will break. I’ll take care of it. Same for contrib extensions with revapi ignores inheriting from `xwiki-commons-pom`: they’ll need to tag them or skip the rule with `xwiki.enforcer.revapi-ignore-version.skip`.

WDYT?

PS: This post was written by Claude Code.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [November 26, 2026, 12:10pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/7 "2026-11-26T12:10:51Z")

</div>

> [@surli](#):
>
> ```auto
> <attachments>
> <versions>19.0.0-rc-1,18.10.1</versions>
> </attachments>
> 
> ```

I think I’d use a more semantic name since version can mean a lot of things. When you read this it’s not obvious what version means. AFAIU it’s the xwiki or extension version in which the ignore was introduced. If we use the JIRA terminology, it’s the `affectsVersions` and in OP terminology it’s the `observedInVersions`.

WDYT about using either one of these?

Apart from this, it’s fine for me, thx for working on this automation. I just think that we’re going to mess it whenever we backport branches (as we do for `@since` versions), but I guess it’s a best effort.

Thanks

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [November 26, 2026, 1:52pm UTC](https://forum.xwiki.org/t/start-providing-version-in-revapi-ignores/18894/8 "2026-11-26T13:52:46Z")

</div>

> [@vmassol](#):
>
> WDYT about using either one of these?

I don’t have a strong opinion on that, I’m more used to affects version but probably a habit.
