Skip to content

Add explicit versions in the branches.json and use them for calculating unreleased versions for BwC tests #129637

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jozala
Copy link
Contributor

@jozala jozala commented Jun 18, 2025

Work in progress

Gradle task added to modify branches.json. Possibility to add, remove and update branches in the file with the version field added next to the branch.
After the change the file looks like this:

{
    "branches": [
        {
            "branch": "main",
            "version": "9.1.0"
        },
        {
            "branch": "9.0",
            "version": "9.0.3"
        },
        {
            "branch": "8.19",
            "version": "8.19.1"
        }
    ]
}

BwC test configuration has been changed to use changed branches.json file to calculate unreleased ES versions, instead of combining data from Version.java and branches.json.

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Jun 18, 2025
@jozala jozala force-pushed the bwc-explicit-branches-version branch from 1e1a591 to d84fef9 Compare June 20, 2025 10:24
@jozala jozala self-assigned this Jun 20, 2025

@TaskAction
public void executeTask() throws IOException {
File branchesFile = new File(Util.locateElasticsearchWorkspace(project.getGradle()), "branches.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

referencing project here while executing task is deprecated. In this case I think we should just inject ProjectLayout instead of project in the ctor and then use layout.getSettingsDirectory().file('branches.json').asFile.

The Util.locateElasticsearchWorkspace is just a utility method only used to resolve files relateive from internal builds within this repository, which we don't need here as we never run this task anywhere else but in the :elasticsearch root build

Copy link
Contributor

Choose a reason for hiding this comment

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

Also we probably want to make this file an outputFile property of the task

private final ObjectMapper objectMapper;
private final BranchesFileParser branchesFileParser;

@Nullable
Copy link
Contributor

@breskeby breskeby Jun 23, 2025

Choose a reason for hiding this comment

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

Usually we do not use that annotation. In Gradle tasks, you usually mark properties that are optional as @optional and as @input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue serverless-linked Added by automation, don't add manually v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants