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

Copy link

codecov bot commented Aug 21, 2025

Codecov Report

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

❌ Your project status has failed because the head coverage (69.80%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #821   +/-   ##
=======================================
  Coverage   69.80%   69.80%           
=======================================
  Files          38       38           
  Lines        1729     1729           
  Branches      156      156           
=======================================
  Hits         1207     1207           
  Misses        431      431           
  Partials       91       91           

☔ 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.

@cwperks cwperks merged commit 4ef133e into opensearch-project:main Aug 21, 2025
16 of 17 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Engineering Effectiveness Board Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants