From 7be61f24726130c8b86167d965e114634b5a8058 Mon Sep 17 00:00:00 2001 From: Oliver Wolff <23139298+cuioss@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:35:33 +0100 Subject: [PATCH 1/2] docs: do the SonarCloud main-branch setup before the first merge to main CI creates a missing Sonar project itself with the main branch master, so the rename must happen before the first push or merge to main. State the organization (cuioss-github) and add a verification command, in the README and in the customize.sh next steps. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AEE74wh8Lty7n7shHcsVCX --- README.adoc | 23 +++++++++++++++++------ customize.sh | 4 +++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.adoc b/README.adoc index fce6e41..00de020 100644 --- a/README.adoc +++ b/README.adoc @@ -83,12 +83,23 @@ All secrets (GPG, Sonatype, Sonar, Release App) are managed at the https://githu https://github.com/cuioss/cuioss-organization/blob/main/.github/project.yml[`.github/project.yml`], so every org workflow release opens the pin-bump PR here. Apply repository settings and branch protection (merge queue) with the org's `repo-settings` and `branch-protection` scripts. -* *SonarCloud*: create the project `cuioss_`. New projects start with a main branch called - `master`; rename it to `main` (Administration -> Branches and Pull Requests) *before* the first - analysis. Otherwise `main` is analysed as a short-lived branch and the overview stays empty. If it - already happened: delete the short-lived `main`, then rename `master`. Set New Code to "Previous - version". The first analysis of the renamed branch reports quality gate `NONE` (no baseline yet), - which fails `sonar.qualitygate.wait`; the next analysis is green. +* *SonarCloud*, *before the first push or merge to `main`* (CI creates a missing project itself, with the + main branch `master`, as soon as the first analysis runs): +** Create the project `cuioss_` in the organization `cuioss-github`, where all cuioss projects live. + A project in another organization (for example `cuioss`) is not the one CI analyses. +** New projects start with a main branch called `master`; rename it to `main` (Administration -> + Branches and Pull Requests) *before* the first analysis. Otherwise `main` is analysed as a short-lived + branch and the overview stays empty. If it already happened: delete the short-lived `main`, then + rename `master`. +** Set New Code to "Previous version". +** The first analysis of the renamed branch reports quality gate `NONE` (no baseline yet), which fails + `sonar.qualitygate.wait`; re-run the failed job, the next analysis is green. +** Verify (public projects need no token): the branch listed with `"isMain":true` must be `main`: ++ +[source,bash] +---- +curl -s "https://sonarcloud.io/api/project_branches/list?project=cuioss_" +---- * *Release*: leave `release.current-version` alone, see <>. === Further Steps diff --git a/customize.sh b/customize.sh index f551205..3674e9d 100755 --- a/customize.sh +++ b/customize.sh @@ -118,7 +118,9 @@ echo "Customization completed successfully!" echo "" echo "Next steps (see README.adoc, 'After creating the repository'):" echo " - Do NOT change release.current-version in .github/project.yml: merging that change IS a release." -echo " - SonarCloud: create ${PROJECT_SONAR_ID} and rename its main branch 'master' to 'main' before the first analysis." +echo " - SonarCloud, BEFORE the first push or merge to main (CI would create the project itself with main branch 'master'):" +echo " create ${PROJECT_SONAR_ID} in organization cuioss-github and rename its main branch 'master' to 'main'." +echo " Verify: curl -s \"https://sonarcloud.io/api/project_branches/list?project=${PROJECT_SONAR_ID}\" (isMain must be 'main')" echo " - Add ${PROJECT_KEY} to 'consumers:' in cuioss-organization/.github/project.yml." echo " - Apply branch protection / merge queue with cuioss-organization/branch-protection." echo "" From 55c165a943a85f2ed69a82da1f131a77e1d7df71 Mon Sep 17 00:00:00 2001 From: Oliver Wolff <23139298+cuioss@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:38:54 +0100 Subject: [PATCH 2/2] docs: cover pull request analysis and correct the isMain check Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AEE74wh8Lty7n7shHcsVCX --- README.adoc | 7 ++++--- customize.sh | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index 00de020..5bd0f7f 100644 --- a/README.adoc +++ b/README.adoc @@ -83,8 +83,9 @@ All secrets (GPG, Sonatype, Sonar, Release App) are managed at the https://githu https://github.com/cuioss/cuioss-organization/blob/main/.github/project.yml[`.github/project.yml`], so every org workflow release opens the pin-bump PR here. Apply repository settings and branch protection (merge queue) with the org's `repo-settings` and `branch-protection` scripts. -* *SonarCloud*, *before the first push or merge to `main`* (CI creates a missing project itself, with the - main branch `master`, as soon as the first analysis runs): +* *SonarCloud*, *before the first CI run of the new repository*, that is before the first push or pull + request (CI creates a missing project itself, with the main branch `master`, as soon as the first + analysis runs, pull request analysis included): ** Create the project `cuioss_` in the organization `cuioss-github`, where all cuioss projects live. A project in another organization (for example `cuioss`) is not the one CI analyses. ** New projects start with a main branch called `master`; rename it to `main` (Administration -> @@ -94,7 +95,7 @@ All secrets (GPG, Sonatype, Sonar, Release App) are managed at the https://githu ** Set New Code to "Previous version". ** The first analysis of the renamed branch reports quality gate `NONE` (no baseline yet), which fails `sonar.qualitygate.wait`; re-run the failed job, the next analysis is green. -** Verify (public projects need no token): the branch listed with `"isMain":true` must be `main`: +** Verify (public projects need no token): the branch named `main` must be listed with `"isMain":true`: + [source,bash] ---- diff --git a/customize.sh b/customize.sh index 3674e9d..f7b7279 100755 --- a/customize.sh +++ b/customize.sh @@ -118,9 +118,9 @@ echo "Customization completed successfully!" echo "" echo "Next steps (see README.adoc, 'After creating the repository'):" echo " - Do NOT change release.current-version in .github/project.yml: merging that change IS a release." -echo " - SonarCloud, BEFORE the first push or merge to main (CI would create the project itself with main branch 'master'):" +echo " - SonarCloud, BEFORE the first push or pull request (any CI run creates the project itself with main branch 'master'):" echo " create ${PROJECT_SONAR_ID} in organization cuioss-github and rename its main branch 'master' to 'main'." -echo " Verify: curl -s \"https://sonarcloud.io/api/project_branches/list?project=${PROJECT_SONAR_ID}\" (isMain must be 'main')" +echo " Verify: curl -s \"https://sonarcloud.io/api/project_branches/list?project=${PROJECT_SONAR_ID}\" (the branch named main must have isMain true)" echo " - Add ${PROJECT_KEY} to 'consumers:' in cuioss-organization/.github/project.yml." echo " - Apply branch protection / merge queue with cuioss-organization/branch-protection." echo ""