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

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.84%. Comparing base (5906035) to head (761de38).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1219   +/-   ##
=========================================
  Coverage     77.84%   77.84%           
  Complexity     1223     1223           
=========================================
  Files           103      103           
  Lines          5778     5778           
  Branches        599      599           
=========================================
  Hits           4498     4498           
  Misses          992      992           
  Partials        288      288           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis force-pushed the fix-gradle-9-syntax branch from 76a381a to 761de38 Compare September 4, 2025 03:23
@dbwiddis dbwiddis merged commit e7b731f into opensearch-project:main Sep 4, 2025
22 of 23 checks passed
@dbwiddis dbwiddis deleted the fix-gradle-9-syntax branch September 4, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants