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.64%. Comparing base (6059afb) to head (6fae4c7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #4129   +/-   ##
=========================================
  Coverage     81.63%   81.64%           
  Complexity     8829     8829           
=========================================
  Files           761      761           
  Lines         38099    38099           
  Branches       4250     4250           
=========================================
+ Hits          31104    31105    +1     
  Misses         5167     5167           
+ Partials       1828     1827    -1     
Flag Coverage Δ
ml-commons 81.64% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dbwiddis dbwiddis temporarily deployed to ml-commons-cicd-env-require-approval August 21, 2025 06:24 — with GitHub Actions Inactive
@dbwiddis dbwiddis temporarily deployed to ml-commons-cicd-env-require-approval August 21, 2025 06:24 — with GitHub Actions Inactive
@mingshl
Copy link
Collaborator

mingshl commented Aug 25, 2025

The IT failed. The new way of exporting variables seems changing the values of the aws credentials.

 RestBedRockInferenceIT > test_bedrock_multimodal_model_empty_imageInput FAILED
    java.lang.AssertionError: Failing test case name: without_step_size, inference result: {"error":{"root_cause":[{"type":"status_exception","reason":"Error from remote service: {\"message\":\"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\\n\\nThe Canonical String for this request should have been\\n\u0027POST\\n/model/amazon.titan-embed-image-v1/invoke\\n\\ncontent-length:44\\ncontent-type:application/json\\nhost:bedrock-runtime.us-west-2.amazonaws.com\\nx-amz-content-```

@dbwiddis
Copy link
Member Author

The IT failed. The new way of exporting variables seems changing the values of the aws credentials.

The changes only impact the gradle build's access to the specific Sonatype system environment variables (GitHub secrets) associated with publishing snapshots, and should have zero impact on compiled code and internal handling of credentials.

@dbwiddis dbwiddis had a problem deploying to ml-commons-cicd-env-require-approval August 26, 2025 17:15 — with GitHub Actions Failure
@dbwiddis dbwiddis had a problem deploying to ml-commons-cicd-env-require-approval August 26, 2025 17:15 — with GitHub Actions Error
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