Skip to content

Conversation

@jormundur00
Copy link
Member

@jormundur00 jormundur00 commented Nov 14, 2025

What does this PR do?

In this PR we filter out early-access/pre-release library versions from automated ticket creation, when their version upgrade fails. Also in this PR, we introduce the automated removal of pre-release versions from the tested-versions of a libraries index.json file, when the full version of that specific version is added to the same (e.g.: 6.6.0.rc2 would be removed once 6.6.0 or 6.6.0.Final is added), as well as automated renaming of the metadata and tests directories for the library once its version is changed.

The implementation follows a 2 step process:

  1. When fetching new library versions from maven (by reading its maven-metadata.xml) we filter out pre-release versions if their full release version is present in the same file,
  2. Later, when adding a new version to a libraries index.json tested-libraries field, if its not a pre-release version we remove all pre-releases for that version from the same field. If the metadata-version field for that library is a pre-release version, and the full release for it is added to the tested-libraries, we also replace the metadata-version field to refer to the full release and also rename the metadata and tests directories to refer to the same version (also updating the gradle.properties file of the test directory). If test directories are renamed, the test root index.json is also updated to reflect the new version.

We determine if a library version is a pre-release by regex pattern matching, determining if the version suffix matches one of the pre-release patterns. Currently, we filter out versions that end with a . or - following one of the following case insensitive suffixes:

  • alpha with optional numbers after it, or a . or - separated string,
  • beta with optional numbers after it, or a . or - separated string,
  • rc with optional numbers after it, or a . or - separated string,
  • cr with optional numbers after it, or a . or - separated string,
  • m with non-optional numbers after it, or a . or - separated string,
  • ea with optional numbers after it, or a . or - separated string,
  • b with non-optional numbers after it, or a . or - separated string,
  • preview with optional numbers after it, or a . or - separated string,
  • specially if separated by -: an array of numbers.

Implements: #754

@jormundur00 jormundur00 self-assigned this Nov 14, 2025
@jormundur00 jormundur00 added the enhancement New feature or request label Nov 14, 2025
FAILED_VERSION="${{ steps.runtests.outputs.failed_version }}"
# Skip issue creation if failed version is a pre-release
Copy link
Member

Choose a reason for hiding this comment

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

Should we even run the tests for those versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Based on offline discussion, I've fully refactored this PR to match the newly-decided functionality, so we no longer do these checks here.

# Skip issue creation if failed version is a pre-release
shopt -s nocasematch
if [[ "$FAILED_VERSION" =~ (-|\.)(rc|cr|m|ea|beta|alpha)(-?[0-9]*) ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Does does capture all of the cases? I have seen all kinds of stuff in the versions: 13.1.1.jre8-preview, 1.8.0-343, and others.

Also, there should be an end of string at the end, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the pattern to include more different pre-release versions. All the covered pre-release identifiers are listed in the PR description.

@jormundur00 jormundur00 force-pushed the jormundur00/skip-ea-version-issue-creation branch from 801c26f to e76661e Compare November 17, 2025 15:08
@jormundur00 jormundur00 changed the title Avoid automated issue creation when new library version is a pre-release Filter out pre-release versions of libraries when a full release is present Nov 18, 2025
@jormundur00 jormundur00 force-pushed the jormundur00/skip-ea-version-issue-creation branch 2 times, most recently from fce2ea5 to 7e3e039 Compare November 18, 2025 10:42
Copy link
Member Author

Choose a reason for hiding this comment

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

This file used to have a weird indentation format, that default jackson/java formatters don't use. When updating this file, the JSON is reformatted to use regular indentation.

Since this file should be removed once #4 is implemented, I would update the format here, so any PR's in between don't massively change this file like this PR.

@jormundur00 jormundur00 force-pushed the jormundur00/skip-ea-version-issue-creation branch 2 times, most recently from 14b38b8 to 761bf2a Compare November 18, 2025 11:35
@jormundur00 jormundur00 force-pushed the jormundur00/skip-ea-version-issue-creation branch from 761bf2a to eef5f1a Compare November 18, 2025 11:56

public abstract class TestedVersionUpdaterTask extends DefaultTask {
private static final Pattern PRE_RELEASE_PATTERN = Pattern.compile(
"(?i)^(\\d+(?:\\.\\d+)*)(?:[-.](alpha\\d*|beta\\d*|rc\\d*|cr\\d*|m\\d+|ea\\d*|b\\d+|\\d+|preview)(?:[-.].*)?)?$"
Copy link
Member

Choose a reason for hiding this comment

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

All the wisdom of Maven in one regex ;)

Copy link
Member

Choose a reason for hiding this comment

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

Explain it here like in the PR description.

@vjovanov
Copy link
Member

We should run this after every library update as the final step. And add the results as the final commit. Please see:

https://github.com/oracle/graalvm-reachability-metadata/blob/master/.github/workflows/verify-new-library-version-compatibility.yml

@jormundur00
Copy link
Member Author

jormundur00 commented Nov 18, 2025

We should run this after every library update as the final step. And add the results as the final commit. Please see:

https://github.com/oracle/graalvm-reachability-metadata/blob/master/.github/workflows/verify-new-library-version-compatibility.yml

We already do this in this PR. The addTestedVersion task called inside of verify-new-library-version-compatibility.yml (inside of update_new_versions()) filters out old pre-release versions when a new version is added (if that new version is the full release for the given pre-release), and renames the metadata and test directories and their references to point to the full release version, if applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants