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 81.61%. Comparing base (17e56f0) to head (5d14dc1).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1554      +/-   ##
============================================
+ Coverage     81.59%   81.61%   +0.01%     
- Complexity     6039     6042       +3     
============================================
  Files           536      536              
  Lines         24427    24427              
  Branches       2494     2494              
============================================
+ Hits          19932    19935       +3     
- Misses         3260     3261       +1     
+ Partials       1235     1231       -4     
Flag Coverage Δ
plugin 81.61% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kaituo
Copy link
Collaborator

kaituo commented Aug 21, 2025

@dbwiddis Can you add changelog?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x infra Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants