Skip to content

BUILD-10724 migrate only when S3 is forced#51

Merged
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/jcarsique/BUILD-10724-migrateOnlyPublic
Mar 25, 2026
Merged

BUILD-10724 migrate only when S3 is forced#51
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/jcarsique/BUILD-10724-migrateOnlyPublic

Conversation

@julien-carsique-sonarsource
Copy link
Copy Markdown
Contributor

@julien-carsique-sonarsource julien-carsique-sonarsource commented Mar 24, 2026

Summary

Change the default for import-github-cache from always true to context-aware:

  • true when the S3 backend was explicitly forced via backend: s3 input or CACHE_BACKEND=s3 env var — the intentional GitHub→S3 migration scenario.
  • false when the S3 backend was auto-detected (private/internal repository) — these repositories have always used S3 and have no GitHub cache entries to migrate.

Changes

  • action.yml: cache-backend step now emits backend-source: forced|auto; import-mode step uses it as the smart default.
  • README.md: updated inputs table and Migration Mode section to document the new default and resolution order.

Note on future default change

When S3 becomes the default backend for all repositories (including public), the auto-detection case will also need to check repository visibility (publictrue, privatefalse). That change is deferred to when the default is actually switched.

Test coverage

gh-action_cache is public → without explicit backend it auto-detects GitHub, so all S3 scenarios require backend: s3 or CACHE_BACKEND=s3.
sonar-dummy is private → auto-detects S3, needed to test backend-source=auto behaviour.

# Repo S3 backend selection Import mode S3 cache Expected Covered
1 public input true (default) miss import from GitHub gh-action_cache
2 public input false (input) miss no import gh-action_cache
3 public input false (env) miss no import gh-action_cache
4 public input true (default) hit S3 content, no import gh-action_cache
5 private env true (default) miss import from GitHub sonar-dummy#573
6 private auto false (default) miss no import (new behaviour) sonar-dummy#573
7 private auto true (env) miss import from GitHub sonar-dummy#573
8 private auto true (input) miss import from GitHub sonar-dummy#573

@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/jcarsique/BUILD-10724-migrateOnlyPublic branch from 98fc655 to 0ab9153 Compare March 24, 2026 18:03
@sonarqube-cloud-us
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@bwalsh434 bwalsh434 left a comment

Choose a reason for hiding this comment

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

Awesome! In theory, ths is must more efficient in number of operations executed 👌

@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as ready for review March 25, 2026 10:54
@julien-carsique-sonarsource julien-carsique-sonarsource requested a review from a team as a code owner March 25, 2026 10:54
@julien-carsique-sonarsource julien-carsique-sonarsource merged commit 0fe268e into master Mar 25, 2026
19 checks passed
@julien-carsique-sonarsource julien-carsique-sonarsource deleted the feat/jcarsique/BUILD-10724-migrateOnlyPublic branch March 25, 2026 10:55
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