Skip to content

GHA-338 Add SQAA integration to release automation - #156

Closed
nils-werner-sonarsource wants to merge 4 commits into
masterfrom
nils/sqaa-integration
Closed

nils-werner-sonarsource wants to merge 4 commits into
masterfrom
nils/sqaa-integration

Conversation

@nils-werner-sonarsource

Copy link
Copy Markdown
Contributor

Summary

  • Extends update-analyzer action with an explicit target input (sqs/sqc/sqaa), falling back to ticket-key prefix routing for backward compatibility
  • Adds TOML sed pattern for sqaa target (updates gradle/libs.versions.toml in sonar-analysis-as-a-service)
  • Adds sqaa-integration (default: false) and plugin-artifacts-sqaa inputs to automated-release.yml; sqaa reuses the SC ticket key and requires sqc-integration: true
  • Wires sqaa-pull-request-url through job outputs, workflow outputs, and the release summary

Prerequisites

A separate re-terraform PR must be merged to grant release-automation secrets access to sonar-analysis-as-a-service before enabling sqaa-integration: true in any analyzer workflow.

Test plan

  • Verify update-analyzer still routes correctly for existing SONAR-* and SC-* ticket keys (no target input)
  • Verify new target: sqaa produces a PR in sonar-analysis-as-a-service updating gradle/libs.versions.toml
  • Verify sqaa-integration: false (default) skips the sqaa step entirely
  • Verify sqaa-pull-request-url appears in the workflow summary when enabled

🤖 Generated with Claude Code

Extends update-analyzer action and automated-release workflow to support
updating sonar-analysis-as-a-service after a release, in addition to
existing SQS and SQC integrations.

- update-analyzer: add `target` input (sqs/sqc/sqaa) for explicit routing;
  falls back to ticket-key prefix for backward compat; adds TOML sed pattern
  for sqaa's libs.versions.toml
- automated-release: add sqaa-integration (default: false) and
  plugin-artifacts-sqaa inputs; new update-sqaa step reuses SC ticket key;
  sqaa-pull-request-url wired through job/workflow outputs and summary

Re-terraform update required to grant release-automation secrets access
to sonar-analysis-as-a-service (tracked separately).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Add SQAA integration to release automation GHA-338 Add SQAA integration to release automation Jun 16, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

GHA-338

Comment thread update-analyzer/action.yml Resolved
Comment thread .github/workflows/automated-release.yml Resolved
- Add sqaa-integration and plugin-artifacts-sqaa to inputs table
- Expand outputs table (was only showing new-version, now lists all outputs)
- Add SQAA integration section with prerequisites note
- Update vault setup example with sonar-analysis-as-a-service
- Update post-release checklist

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. Thanks for handling this!
Please check the one Gitar comment.

@nils-werner-sonarsource

Copy link
Copy Markdown
Contributor Author

gitar auto-apply:on

…ation prerequisite

Co-authored-by: Nils Werner <64034005+nils-werner-sonarsource@users.noreply.github.com>
@nils-werner-sonarsource

Copy link
Copy Markdown
Contributor Author

Using #157 instead

@gitar-bot

gitar-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Integrates SQAA into release automation by adding target routing, TOML update logic, and PR tracking. Resolved issues regarding TOML over-matching and silent failures when SQAA is enabled without SQC.

✅ 2 resolved
✅ Edge Case: TOML sed pattern over-matches plugin keys with shared prefix

📄 update-analyzer/action.yml:122 📄 update-analyzer/action.yml:128-132
When plugin-artifacts is not supplied, the plugin pattern defaults to ${PLUGIN_NAME}.* (line 122). For the new TOML target this is interpolated into:

sed -i "s/^\(sonar-$plugin\s*=\s*"\)[0-9.]*/\1$RELEASE_VERSION/" "$BUILD_FILE"

giving e.g. ^sonar-java.*\s*=\s*" for plugin-name java. The greedy .* makes this match any TOML key that merely starts with the plugin name. In gradle/libs.versions.toml a line like sonar-javascript = "4.5.6" is matched by sonar-java + .*(script ) + = ", so releasing java would silently rewrite the sonar-javascript (and any other sonar-java*) version to the java release version.

Unlike the Gradle pattern, the TOML pattern has no -plugin: suffix to bound the key, so the collision is much more likely to fire against real sibling entries. Because sed exits 0 even when it edits the wrong line, the bad change is only visible in the resulting PR diff.

Consider anchoring the TOML key so the plugin name must be the full key (no trailing .*), e.g. require the key to be immediately followed by optional whitespace and =.

✅ Quality: sqaa-integration without sqc-integration silently does nothing

📄 .github/workflows/automated-release.yml:806-810 📄 .github/workflows/automated-release.yml:857-859
The update-analyzers job runs when any of sqs-integration || sqc-integration || sqaa-integration is true (lines 806-810), but the update-sqaa step requires both sqaa-integration && sqc-integration (line 859). If a caller enables sqaa-integration: true while leaving sqc-integration: false, the job runs but the SQAA step is skipped with no warning or error, and no SQAA PR is produced. The dependency is only documented in the input description, so a misconfiguration fails silently and is easy to miss.

Consider adding an explicit validation step (or a warning) that fails/notifies when sqaa-integration is true but sqc-integration is false, making the misconfiguration visible.

Options ✅ Auto-apply

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

Comment with these commands to change:

✅ Auto-apply Compact
gitar auto-apply:off         
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.

3 participants