diff --git a/README.adoc b/README.adoc index fce6e41..5bd0f7f 100644 --- a/README.adoc +++ b/README.adoc @@ -83,12 +83,24 @@ 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 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 -> + 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 named `main` must be listed with `"isMain":true`: ++ +[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..f7b7279 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 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}\" (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 ""