Skip to content

SONARRUBY-136 Set up orchestrator cache#121

Merged
alban-auzeill merged 4 commits intomasterfrom
tt/setup-orchestrator-cache
Apr 16, 2026
Merged

SONARRUBY-136 Set up orchestrator cache#121
alban-auzeill merged 4 commits intomasterfrom
tt/setup-orchestrator-cache

Conversation

@tomasz-tylenda-sonarsource
Copy link
Copy Markdown
Contributor

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource commented Apr 16, 2026

  • Add orchestrator cache action
  • Use the new cache action in the QA job of the build workflow
  • Add a cleanup-cache workflow for S3 cache inspection and manual cleanup

Tested: Checked the logs of https://github.com/SonarSource/sonar-ruby/actions/runs/24499072420/job/71601394007 (second run on the PR branch) and verified that sonarqube-enterprise-lw-2026.2.1.121354.zip was found in the cache.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha bot commented Apr 16, 2026

Summary

This PR implements caching for the SonarQube orchestrator (downloaded binary) to speed up QA test runs. It introduces a reusable composite action that caches the orchestrator directory with a year-week cache key (auto-rotates weekly), and integrates it into the build workflow's QA job. A separate cleanup-cache workflow enables S3 cache inspection and manual deletion, with dry-run enabled by default for safety.

Tested on the PR's second workflow run with a real SonarQube build, confirming the orchestrator zip was successfully cached and retrieved.

What reviewers should know

Start here: Review the new orchestrator-cache action first (.github/actions/orchestrator-cache/action.yml) — it's the core implementation. Then check the integration point in build.yml where the action is called in the QA job.

Key design decisions:

  • Cache key format (orchestrator-<version>-<year-week>-<run-id>) ensures weekly rotation and per-run uniqueness
  • Caching is disabled for sq-version: 'DEV' to avoid stale dev artifacts
  • The cleanup workflow uses workflow_dispatch (manual trigger) rather than scheduled, giving ops control over cache cleanup timing

Worth noting: The action sets environment variables (ORCHESTRATOR_CACHE_KEY and ORCHESTRATOR_HOME) that downstream steps can use. The mkdir -p and ls -lRh at the end of the action are useful for debugging and visibility into cache state across runs.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Set up orchestrator cache SONARRUBY-136 Set up orchestrator cache Apr 16, 2026
@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod bot commented Apr 16, 2026

SONARRUBY-136

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 outdated.

Copy link
Copy Markdown

@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.

LGTM! ✅

🗣️ Give feedback

@sonarqube-next
Copy link
Copy Markdown


jobs:
cleanup:
runs-on: github-ubuntu-latest-s
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we don't need github-ubuntu-latest-s (4 CPU, 16GB) and could use sonar-xs-public (1 CPU, 4GB) here. WDYT?

@alban-auzeill alban-auzeill merged commit d51efcb into master Apr 16, 2026
9 checks passed
@alban-auzeill alban-auzeill deleted the tt/setup-orchestrator-cache branch April 16, 2026 12:41
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