Skip to content

GHA-300 Automated release workflow should use new plugin deployment workflow#152

Merged
nils-werner-sonarsource merged 4 commits into
masterfrom
nw/GHA-300
May 21, 2026
Merged

GHA-300 Automated release workflow should use new plugin deployment workflow#152
nils-werner-sonarsource merged 4 commits into
masterfrom
nw/GHA-300

Conversation

@nils-werner-sonarsource
Copy link
Copy Markdown
Contributor

@nils-werner-sonarsource nils-werner-sonarsource commented May 19, 2026

Summary

When `sqc-integration: true` and `sqc-plugins-deployer-integration: true`, the automated release opens PRs in both repositories simultaneously during the transition period:

  1. `sonarcloud-core` — existing `build.gradle` update (unchanged)
  2. `sonar-plugins-deployer` — new `plugins.yaml` anchor update (this PR)

The `sqc-plugins-deployer-integration` input defaults to `false` so existing callers are unaffected until they opt in.

Changes

File Change
`update-plugins-deployer/action.yml` New composite action — vault → validate SC- ticket → sparse checkout `plugins.yaml` → sed anchor update → create PR
`update-plugins-deployer/update_plugins_yaml.sh` Shell script: computes anchor key from `plugin-name` (strips `-enterprise`, maps `csharp`/`vbnet` → `dotnet`), updates version anchor in `versions:` block, fails hard if anchor not found
`update-plugins-deployer/test_plugins.yaml` Fixture `plugins.yaml` used by action tests
`update-plugins-deployer/test_update_plugins_yaml.sh` 7 shell unit tests covering all key-mapping cases
`update-plugins-deployer/README.md` Action documentation
`.github/workflows/test-update-plugins-deployer.yml` CI: unit tests + action tests (ticket validation, fixture-based anchor update for java/security/go-enterprise/dotnet-enterprise)
`.github/workflows/automated-release.yml` Add `update-plugins-deployer` step alongside `update-sqc`; new `sqc-plugins-deployer-integration` input (default `false`); new `plugins-deployer-pull-request-url` output; updated summaries
`README.md` Add `update-plugins-deployer` to actions table

Artifact → anchor key mapping

`plugin-artifacts-sqc` value → anchor in `versions:` block:

  • `security` → `sonar-security`
  • `go-enterprise` → `sonar-go`
  • `iac-enterprise` → `sonar-iac`
  • `text-enterprise` → `sonar-text`
  • `python-enterprise` → `sonar-python`
  • `csharp-enterprise`, `vbnet-enterprise` → `sonar-dotnet` (shared anchor)
  • `java`, `java-symbolic-execution`, `php`, etc. → `sonar-{plugin-name}`

Test strategy

Automated tests (CI)

  • Unit tests (`test_update_plugins_yaml.sh`): 7 shell tests covering all anchor key-mapping cases and the hard-fail path for unknown plugins. Run without any external dependencies.
  • Action tests (workflow): ticket format validation (SONAR-/INVALID- rejected, SC- required) + fixture-based anchor update tests for java, security (with frontends sharing one anchor), go-enterprise, and dotnet-enterprise. Use a local `test_plugins.yaml` fixture — no vault, no network access to `sonar-plugins-deployer`.

End-to-end test (manual, completed)

A full draft release was triggered from SonarSource/sonar-php using a test branch (`nw/test-plugins-deployer-release`) pointing at this PR's branch with `sqc-plugins-deployer-integration: true`, `is-draft-release: true`, and `use-jira-sandbox: true`.

Result: sonar-plugins-deployer#46 was created as a draft with the correct diff — only the `sonar-php: &version-sonar-php` anchor line updated, all alias references untouched. The PR was closed after verification.

Prerequisites (separate PRs)

🤖 Generated with Claude Code

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented May 19, 2026

GHA-300

@sonar-review-alpha
Copy link
Copy Markdown
Contributor

sonar-review-alpha Bot commented May 19, 2026

Summary

What: Adds a new update-plugins-deployer composite action that updates plugin version anchors in sonar-plugins-deployer/plugins.yaml, and integrates it into the automated release workflow alongside the existing SQC integration.

Why: During the transition to sonar-plugins-deployer, release automation needs to update plugin versions in two places simultaneously. The action handles YAML anchor updates (not direct version fields), which allows all alias references in the plugins: block to inherit the new version automatically.

Scope: The new feature is opt-in — the sqc-plugins-deployer-integration input defaults to false, so existing callers are unaffected until they explicitly enable it.

What reviewers should know

Start here:

  1. Anchor key logic (update_plugins_yaml.sh:4-19): The mapping from plugin-name → anchor key is the critical piece. Review the transformation rules (strip -enterprise, map csharp/vbnetdotnet) and ensure it matches the anchor keys defined in sonar-plugins-deployer.
  2. Integration point (.github/workflows/automated-release.yml:790-796): The new step mirrors the existing update-sqc pattern — same inputs, same conditional guard (sqc-integration && sqc-plugins-deployer-integration).

Key design decisions to verify:

  • The shell script uses sed for inline YAML anchor updates rather than a YAML parser — this is intentional to avoid external dependencies and keep the anchor format exact (format must match sonar-{key}: &version-sonar-{key} VERSION).
  • The test fixture approach (static test_plugins.yaml) avoids vault/network dependencies during testing.
  • Ticket validation happens in the action's bash step (not the script), enforcing SC- prefix only when creating PRs.

Watch for:

  • The anchor pattern matching in update_plugins_yaml.sh is strict — if a plugin is missing from the versions: block in sonar-plugins-deployer, the script fails hard with a clear error. This is intentional (fail-fast behavior), but reviewers should verify the error message is helpful.
  • The test coverage includes both happy paths (successful anchor updates) and failure modes (unknown plugin, invalid ticket prefixes).
  • The mapping for dotnet-enterprise is special — verify that sonar-plugins-deployer's plugins.yaml has a single sonar-dotnet anchor shared by both csharp-enterprise and vbnet-enterprise plugins.

  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

sonar-review-alpha[bot]

This comment was marked as resolved.

sonar-review-alpha[bot]

This comment was marked as outdated.

sonar-review-alpha[bot]

This comment was marked as outdated.

sonar-review-alpha[bot]

This comment was marked as resolved.

sonar-review-alpha[bot]

This comment was marked as resolved.

sonar-review-alpha[bot]

This comment was marked as resolved.

…orkflow

When sqc-integration is true and sqc-plugins-deployer-integration is true,
the automated release opens PRs in both sonarcloud-core (existing) and
sonar-plugins-deployer (new). The deployer PR is opt-in (default false)
during the transition period.

- New update-plugins-deployer action: sparse-checks out plugins.yaml, computes
  anchor key from plugin-name (strips -enterprise, maps csharp/vbnet → dotnet),
  updates the version anchor in the versions: block with sed, fails hard if the
  anchor is not found, creates a draft-aware PR with the standard branch naming
- New sqc-plugins-deployer-integration input on automated-release.yml (default false)
- New plugins-deployer-pull-request-url output
- unit-tests job: bash test script covering all key-mapping cases
- action-tests job: ticket validation + fixture-based update tests for java,
  security (with frontends), go-enterprise, dotnet-enterprise

Prerequisites:
  - re-terraform-aws-vault PR #9142: sonar-plugins-deployer added to release-automation secrets
  - sonar-plugins-deployer PR #41: YAML anchors added to versions: block for all plugins
sonar-review-alpha[bot]

This comment was marked as outdated.

Co-authored-by: sonar-review-alpha[bot] <266116024+sonar-review-alpha[bot]@users.noreply.github.com>
sonar-review-alpha[bot]

This comment was marked as outdated.

Comment thread update-plugins-deployer/action.yml Outdated
Copy link
Copy Markdown
Contributor

@yasen-pavlov-sonarsource yasen-pavlov-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM! Left one comment regarding the plugin-artifacts input.

Copy link
Copy Markdown
Contributor

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

The incremental diff is a clean, focused removal of the plugin-artifacts input — the README, action.yml, test workflow, and script comment are all updated consistently. One stale comment slipped through, and the ticket-validation test coverage concern from the previous review remains unaddressed.

🗣️ Give feedback

Comment thread update-plugins-deployer/update_plugins_yaml.sh Outdated
Co-authored-by: sonar-review-alpha[bot] <266116024+sonar-review-alpha[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@nils-werner-sonarsource nils-werner-sonarsource merged commit 0a8a6ca into master May 21, 2026
5 of 6 checks passed
@nils-werner-sonarsource nils-werner-sonarsource deleted the nw/GHA-300 branch May 21, 2026 14:48
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