Skip to content

chore(ci): manage Sonar projects from Github actions #3039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2025

Conversation

mdelapenya
Copy link
Member

What does this PR do?

This PR adds a shell script that uses the Sonarcloud APIs to manage the projects on it. With the script, we are able to:

  • create one project
  • delete one project
  • update the main branch for the project (for some reason it creates it with master as main branch)
  • createAll the projects (not the core)
  • deleteAll the projects (not the core)

The script needs a SONAR_TOKEN env var, which in the CI will be provided as a secret.

The PR also adds three GH workflows to create, delete and perform bulk operations, using an input form with the module name for creating/deleting workflows, and for action to perform in the build one.

Why is it important?

When a new module is created, we need to recreate it on Sonarcloud, and this is tricky to perform when a new module is added. In the meantime, when/if a new-module-detector is in place, we are doing this manually, so maintainers can go the GH actions and trigger a build for the given module.

@mdelapenya mdelapenya requested a review from a team as a code owner March 17, 2025 12:48
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Mar 17, 2025
@mdelapenya mdelapenya self-assigned this Mar 17, 2025
@mdelapenya mdelapenya requested a review from stevenh March 17, 2025 12:48
Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit d6bc7d2
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/67d84153ba2d4f0008a84c23
😎 Deploy Preview https://deploy-preview-3039--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

* main:
  chore!: export DockerCompose type in compose package (testcontainers#2953)
  chore(deps): bump golang.org/x/net from 0.33.0 to 0.36.0 in /modules (testcontainers#3033)
@mdelapenya
Copy link
Member Author

Merging to enable the creation of project in Sonarcloud

@mdelapenya mdelapenya merged commit 4fc2e55 into testcontainers:main Mar 18, 2025
184 checks passed
@mdelapenya mdelapenya deleted the manage-sonar branch March 18, 2025 16:36
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Mar 25, 2025
* main:
  chore(deps): bump golang.org/x/net from 0.23.0 to 0.36.0 in /modules/dynamodb (testcontainers#3059)
  chore(deps): bump github.com/magiconair/properties from 1.8.7 to 1.8.9 (testcontainers#3057)
  chore(deps): bump golangci/golangci-lint-action from 6.3.0 to 6.5.2 (testcontainers#3052)
  chore(deps): bump golang.org/x/sys from 0.28.0 to 0.31.0 (testcontainers#3056)
  chore(deps): bump actions/setup-go from 5.3.0 to 5.4.0 (testcontainers#3054)
  chore(deps): bump golang.org/x/net in /modules/scylladb (testcontainers#3058)
  chore(deps): bump github/codeql-action from 3.28.11 to 3.28.12 (testcontainers#3053)
  chore(deps): bump golang.org/x/net in /modules/databend (testcontainers#3055)
  feat(azure)!: add Azurite, EventHubs and ServiceBus in the new Azure module, deprecating the old Azurite module (testcontainers#3008)
  fix: update script path in chmod
  fix: update sonar script path (testcontainers#3045)
  chore(ci): manage Sonar projects from Github actions (testcontainers#3039)
  chore(deps): bump github.com/docker/buildx in /modules/compose (testcontainers#3043)
mdelapenya added a commit that referenced this pull request Mar 28, 2025
* main:
  chore: prepare for next minor development cycle (0.37.0)
  chore: use new version (v0.36.0) in modules and examples
  chore: dockerise docs build (#3060)
  chore(deps): bump golang.org/x/net from 0.23.0 to 0.36.0 in /modules/dynamodb (#3059)
  chore(deps): bump github.com/magiconair/properties from 1.8.7 to 1.8.9 (#3057)
  chore(deps): bump golangci/golangci-lint-action from 6.3.0 to 6.5.2 (#3052)
  chore(deps): bump golang.org/x/sys from 0.28.0 to 0.31.0 (#3056)
  chore(deps): bump actions/setup-go from 5.3.0 to 5.4.0 (#3054)
  chore(deps): bump golang.org/x/net in /modules/scylladb (#3058)
  chore(deps): bump github/codeql-action from 3.28.11 to 3.28.12 (#3053)
  chore(deps): bump golang.org/x/net in /modules/databend (#3055)
  feat(azure)!: add Azurite, EventHubs and ServiceBus in the new Azure module, deprecating the old Azurite module (#3008)
  fix: update script path in chmod
  fix: update sonar script path (#3045)
  chore(ci): manage Sonar projects from Github actions (#3039)
  chore(deps): bump github.com/docker/buildx in /modules/compose (#3043)
  chore(deps): bump github.com/containerd/containerd/v2 (#3042)
  deps(compose): bump compose to v2.34.0 and compose-go to v2.4.9 (#3041)
  chore(deps): bump golang.org/x/net in /modules/yugabytedb (#3040)
  chore(deps)!: bump github.com/docker/docker from 27.1.1+incompatible to 28.0.1+incompatible (#3017)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant