Skip to content

Conversation

@dbwiddis
Copy link
Member

This PR updates the Gradle build files to fix compatibility with Gradle 9.

Problem

The current syntax using $System.env.VARIABLE_NAME for accessing environment variables is not compatible with Gradle 9.

This format is used in this repository for Sonatype credentials for SNAPSHOT publication. This fails with under Gradle 9.

credentials {
    username = "$System.env.SONATYPE_USERNAME"
    password = "$System.env.SONATYPE_PASSWORD"
}

See example failed workflow here.

Solution

Update to use the System.getenv() method instead:

credentials {
    username = System.getenv("SONATYPE_USERNAME")
    password = System.getenv("SONATYPE_PASSWORD")
}

Example fix which restored successful snapshots: opensearch-project/opensearch-remote-metadata-sdk#245

@jzonthemtn
Copy link
Collaborator

I can't imagine this change is what is causing the yaml rest tests to fail on a couple of those builds.

@epugh
Copy link
Collaborator

epugh commented Sep 17, 2025

@dbwiddis can you sign your commit and then I'll merge!

@dbwiddis
Copy link
Member Author

@dbwiddis can you sign your commit and then I'll merge!

It looks signed off to me? DCO passes?
7f64d22

@epugh
Copy link
Collaborator

epugh commented Sep 17, 2025

@dbwiddis can you sign your commit and then I'll merge!

It looks signed off to me? DCO passes? 7f64d22

DCO yes, but verified missing:
image

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis
Copy link
Member Author

Done!

@epugh epugh merged commit e7d5d48 into opensearch-project:main Sep 23, 2025
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants