Skip to content

PREQ-6823 Guard Develocity vault JSON parsing in config-gradle - #316

Closed
marta-sancheztorres-sonarsource wants to merge 1 commit into
masterfrom
fix/marta/guard-develocity-vault-json
Closed

PREQ-6823 Guard Develocity vault JSON parsing in config-gradle#316
marta-sancheztorres-sonarsource wants to merge 1 commit into
masterfrom
fix/marta/guard-develocity-vault-json

Conversation

@marta-sancheztorres-sonarsource

Copy link
Copy Markdown

Summary

Guard config-gradle's develocity-access-key expression so GitHub Actions does not call fromJSON(...) when the Vault output is empty during post-job evaluation.

Context

sonarcloud-analyzers-shared-services PR 314 (SC-51120) is migrating the repository to uv and currently uses build-gradle@v1 with Develocity enabled in several jobs.

The current config-gradle action evaluates:

develocity-access-key: ${{ inputs.use-develocity == 'true' &&
  fromJSON(steps.secrets.outputs.vault).DEVELOCITY_TOKEN || '' }}

During Post job cleanup, steps.secrets.outputs.vault can be empty/unavailable, which causes:

Error reading JToken from JsonReader

This change makes the expression consistent with the already-safe DEVELOCITY_TOKEN environment export earlier in the same action.

Change

develocity-access-key: ${{ inputs.use-develocity == 'true' && steps.secrets.outputs.vault &&
  fromJSON(steps.secrets.outputs.vault).DEVELOCITY_TOKEN || '' }}

Impact

This is the shared-action fix needed to unblock completion of SC-51120 without keeping a repo-specific workaround in sonarcloud-analyzers-shared-services.

Validation

  • git diff --check
  • ./run_shell_tests.sh could not be run locally because shellspec is not installed in the current environment

@marta-sancheztorres-sonarsource
marta-sancheztorres-sonarsource requested a review from a team as a code owner June 26, 2026 11:43
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Guard Develocity vault JSON parsing in config-gradle PREQ-6823 Guard Develocity vault JSON parsing in config-gradle Jun 26, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 26, 2026

Copy link
Copy Markdown

PREQ-6823

@gitar-bot

gitar-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds a conditional check to the Develocity access key expression to prevent fromJSON errors when Vault output is empty during post-job evaluation. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant