Skip to content

BUILD-11835 Guard Vault JSON expressions - #347

Merged
jayadeep-km-sonarsource merged 1 commit into
masterfrom
fix/kinavoormadam/BUILD-11835-guardVaultJsonExpressions
Sep 16, 2026
Merged

jayadeep-km-sonarsource merged 1 commit into
masterfrom
fix/kinavoormadam/BUILD-11835-guardVaultJsonExpressions

Conversation

@jayadeep-km-sonarsource

Copy link
Copy Markdown
Contributor

BUILD-11835 Guard Vault JSON expressions

Jira: https://sonarsource.atlassian.net/browse/BUILD-11835

Guard all remaining fromJSON(steps.secrets.outputs.vault) expressions in composite actions. Empty Vault output now short-circuits to an empty value instead of producing a JToken parsing error during post-job evaluation.

Coverage:

  • Guards config-gradle Develocity access-key parsing.
  • Guards build-gradle secret environment values.
  • Audits and guards all remaining expressions against this Vault output across 12 action files.

Validation:

  • mise exec -- pre-commit run yamllint --files <12 changed action files>
  • git diff origin/master...HEAD --check
  • sonar analyze --base origin/master --format json (0 issues, 0 failures)
  • sonar analyze secrets <12 changed action files> (no issues)
  • ./run_shell_tests.sh requires unavailable kcov; direct ShellSpec run reported two failures that CI must confirm.
  • Sonar context augmentation: unavailable (Vortex Context is not installed).

Caveats: No GitHub Actions post-job simulation harness exists locally.

This draft PR was opened by the autonomous factory. A human must mark it ready, approve it, and merge it.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 14, 2026

Copy link
Copy Markdown

BUILD-11835

Comment thread promote/action.yml
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the fix/kinavoormadam/BUILD-11835-guardVaultJsonExpressions branch from d2874fc to 5990750 Compare September 14, 2026 13:40
@jayadeep-km-sonarsource
jayadeep-km-sonarsource marked this pull request as ready for review September 16, 2026 11:34
@jayadeep-km-sonarsource
jayadeep-km-sonarsource requested a review from a team as a code owner September 16, 2026 11:34
Guard all remaining steps.secrets.outputs.vault JSON lookups so empty Vault output does not cause post-job JToken parse errors.
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the fix/kinavoormadam/BUILD-11835-guardVaultJsonExpressions branch from 5990750 to c3d7f03 Compare September 16, 2026 11:34
@gitar-bot

gitar-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

Guards all remaining fromJSON(steps.secrets.outputs.vault) expressions in composite actions to prevent JToken parsing errors when Vault output is empty. Vault guard audit across 12 action files was completed, addressing artifactory expressions in 2 actions.

✅ 1 closed
Bug: Vault guard audit misses artifactory expressions in 2 actions

📄 build-yarn/action.yml:167-169 📄 promote/action.yml:72
The audit that this PR claims covers "all remaining expressions against this Vault output" left fromJSON(steps.artifactory.outputs.vault) unguarded in build-yarn/action.yml:167-169 and promote/action.yml:71 — both in env: blocks the PR otherwise rewrote line-for-line, and both the last such sites in the repo (build-gradle, build-maven, build-npm, build-poetry, config-gradle and config-maven all already use the steps.artifactory.outputs.vault && … || '' form). With an empty Vault output these two actions still hit the JToken parse error this PR exists to remove. Note the guarded replacements exceed the 140-char yamllint limit, so use a folded continuation as update-release-channel does; the four .github/workflows/*Review*.yml / PullRequest*.yml files also still hold unguarded fromJSON(steps.secrets.outputs.vault) expressions, which the description's "composite actions" wording may intentionally exclude.

Review coverage

Functional validation 3 of 4 objectives covered

Rules No rules evaluated

Auto-approval Not enabled · Set up

Implementation Status ◻️ 3 of 4 objectives covered
◻️ BUILD-11835 - 3 of 4 objectives covered

This PR covers guarding the vault JSON expressions in config-gradle and build-gradle actions.

Other objectives on this issue, possibly covered elsewhere:

  • ◻️ Validate that post-job cleanup no longer surfaces misleading JToken errors when vault output is empty
✅ 3 covered here
  • ✅ Guard config-gradle develocity-access-key with steps.secrets.outputs.vault && before fromJSON
  • ✅ Guard build-gradle vault secret env expressions using the same pattern as Artifactory secrets in the same file
  • ✅ Audit and fix remaining unguarded fromJSON(steps.secrets.outputs.vault) calls in ci-github-actions
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

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

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@jayadeep-km-sonarsource
jayadeep-km-sonarsource merged commit 89998b8 into master Sep 16, 2026
19 checks passed
@jayadeep-km-sonarsource
jayadeep-km-sonarsource deleted the fix/kinavoormadam/BUILD-11835-guardVaultJsonExpressions branch September 16, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants