Skip to content
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

[BUG] 1.x doesn't build against latest 2.x snapshot #924

Open
dbwiddis opened this issue Aug 2, 2023 · 1 comment
Open

[BUG] 1.x doesn't build against latest 2.x snapshot #924

dbwiddis opened this issue Aug 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Aug 2, 2023

What is the bug?

OpenSearch version check logic on 1.x branch is impossible to meet both cases.

main branch:

buildscript {
    ext {
        opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
        isSnapshot = "true" == System.getProperty("build.snapshot", "true")
        buildVersionQualifier = System.getProperty("build.version_qualifier", "")
    }

1.x branch:

buildscript {
    ext {
        opensearch_version = System.getProperty("opensearch.version", "2.9.0")
        isSnapshot = "true" == System.getProperty("build.snapshot", "true")
        if (isSnapshot) {
            opensearch_version += "-SNAPSHOT"
        }
        buildVersionQualifier = System.getProperty("build.version_qualifier", "")
    }

The released version is always a version behind the snapshot version (for example, 2.9.0 is released, 2.10.0-SNAPSHOT is latest).

How can one reproduce the bug?

Run a github action requiring 2.10.0 changes: it fails with current code (above) but if we just change version to 2.10.0, then there is no such release that it will ever build against (until the 2.10.0 release, at which time we'll have 2.11.0-SNAPSHOT).

What is the expected behavior?

1.x actions build against the latest snapshot version

Do you have any additional context?

See for example https://github.com/opensearch-project/opensearch-sdk-java/actions/runs/5741412861/job/15561744611?pr=920

I believe there are version options such as "2+" that will get the latest 2.x version, and that can be filtered to allow or exclude snapshots.

@dbwiddis
Copy link
Member Author

dbwiddis commented Aug 3, 2023

We should change version to 2.+ to get the "latest" 2.x version. This will include snapshots.

When we don't want snapshots we can use Component Selection rules to reject the snapshots: https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ComponentSelectionRules.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants