-
Notifications
You must be signed in to change notification settings - Fork 109
Filter out pre-release versions of libraries when a full release is present #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| FAILED_VERSION="${{ steps.runtests.outputs.failed_version }}" | ||
| # Skip issue creation if failed version is a pre-release |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
801c26f to
e76661e
Compare
fce2ea5 to
7e3e039
Compare
There was a problem hiding this comment.
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.
14b38b8 to
761bf2a
Compare
…hen a full release for that version exists
761bf2a to
eef5f1a
Compare
|
|
||
| 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)(?:[-.].*)?)?$" |
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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.
|
We should run this after every library update as the final step. And add the results as the final commit. Please see: |
We already do this in this PR. The |
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-versionsof a librariesindex.jsonfile, when the full version of that specific version is added to the same (e.g.:6.6.0.rc2would be removed once6.6.0or6.6.0.Finalis 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:
maven-metadata.xml) we filter out pre-release versions if their full release version is present in the same file,index.jsontested-librariesfield, if its not a pre-release version we remove all pre-releases for that version from the same field. If themetadata-versionfield for that library is a pre-release version, and the full release for it is added to thetested-libraries, we also replace themetadata-versionfield to refer to the full release and also rename the metadata and tests directories to refer to the same version (also updating thegradle.propertiesfile of the test directory). If test directories are renamed, the test rootindex.jsonis 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:alphawith optional numbers after it, or a.or-separated string,betawith optional numbers after it, or a.or-separated string,rcwith optional numbers after it, or a.or-separated string,crwith optional numbers after it, or a.or-separated string,mwith non-optional numbers after it, or a.or-separated string,eawith optional numbers after it, or a.or-separated string,bwith non-optional numbers after it, or a.or-separated string,previewwith optional numbers after it, or a.or-separated string,-: an array of numbers.Implements: #754