Skip to content

PREQ-1938 Fix RepoX auth for build-gradle#81

Merged
mstachniuk merged 1 commit intomasterfrom
marcin/fix-repox-auth
Sep 5, 2025
Merged

PREQ-1938 Fix RepoX auth for build-gradle#81
mstachniuk merged 1 commit intomasterfrom
marcin/fix-repox-auth

Conversation

@mstachniuk
Copy link
Copy Markdown
Contributor

@mstachniuk mstachniuk commented Sep 5, 2025

PREQ-1938

This fixes the following issue in build-gradle action:

e: file:///home/runner/_work/sonar-php/sonar-php/.gradle/init.d/repoxAuth.init.gradle.kts:102:18: Type argument is not within its bounds: must be subtype of 'Any'.

FAILURE: Build failed with an exception.

* Where:
Initialization script '/home/runner/_work/sonar-php/sonar-php/.gradle/init.d/repoxAuth.init.gradle.kts' line: 102

* What went wrong:
Script compilation error:

  Line 102: fun <T> Provider<T>.orElse(vararg providers: Provider<T>) =
                             ^ Type argument is not within its bounds: must be subtype of 'Any'.

1 error

Spotted in sonar-php

@mstachniuk mstachniuk requested a review from a team September 5, 2025 08:05
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Fix RepoX auth for build-gradle PREQ-1938 Fix RepoX auth for build-gradle Sep 5, 2025
This fixes the following issue in build-gradle action:

```
e: file:///home/runner/_work/sonar-php/sonar-php/.gradle/init.d/repoxAuth.init.gradle.kts:102:18: Type argument is not within its bounds: must be subtype of 'Any'.

FAILURE: Build failed with an exception.

* Where:
Initialization script '/home/runner/_work/sonar-php/sonar-php/.gradle/init.d/repoxAuth.init.gradle.kts' line: 102

* What went wrong:
Script compilation error:

  Line 102: fun <T> Provider<T>.orElse(vararg providers: Provider<T>) =
                             ^ Type argument is not within its bounds: must be subtype of 'Any'.

1 error
```

Spotted in sonar-php
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 5, 2025

🤖 Pull Request summary

Adds null-safety constraint to Provider extension function.

• Modified Provider<T>.orElse() extension to require non-null generic type T: Any
• This prevents potential null-safety issues when chaining provider fallbacks

Review focus: Verify this change doesn't break existing usage where nullable types were previously passed to this function.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

mstachniuk added a commit to SonarSource/sonar-php that referenced this pull request Sep 5, 2025
@mstachniuk mstachniuk merged commit 8f7fc52 into master Sep 5, 2025
9 of 10 checks passed
@mstachniuk mstachniuk deleted the marcin/fix-repox-auth branch September 5, 2025 09:06
@mstachniuk
Copy link
Copy Markdown
Contributor Author

Here is the workflow, where I verified my change: https://github.com/SonarSource/sonar-php/actions/runs/17487699132?pr=1476
The Build used build-gradle version from my PR and succeed. The Build Test Analyze used v1 and failed.

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.

2 participants