Skip to content

Commit 56a7ed3

Browse files
BUILD-8677 Simplify README by removing redundant Features sections
Remove all ### Features sections that were either redundant with the action description or contained generic boilerplate. Rescue the branch-strategy information from build-maven as a proper Deployment Strategy table, and rescue the build-gradle gradlew fallback note into the action description. Move Deployment Strategy to standalone section and fix inaccuracies Move the deployment strategy table out of build-maven into a shared standalone section (grouped with Provenance Attestation) since it applies to all build actions. Fix inaccuracies verified against implementation: - feature/long/* branches DO deploy (was incorrectly marked as no) - "master" renamed to "Default branch" (configured via DEFAULT_BRANCH) - Remove Maven-specific "Notes" column that did not apply to other actions - Add build-gradle exception: sonar analysis not branch-filtered in Gradle Note build-gradle sonar branch filtering as a known bug Add a TODO comment in build-gradle/build.sh and update the README to flag that sonar analysis is not filtered by branch type in build-gradle, unlike all other build actions. Should add a should_scan() guard to skip sonar on dogfood/other branches consistently. Fix deploy input verification: document inconsistencies and add TODOs - Fix README Deployment Strategy table: long-lived feature branches only deploy for build-maven and build-gradle, not for build-npm/build-yarn/build-poetry - Add note that deploy:'false' override is only supported by build-maven and build-gradle - Add TODO comments to build-npm, build-yarn, build-poetry noting the missing DEPLOY env var support and long-lived feature branch deploy discrepancy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 06c24e8 commit 56a7ed3

5 files changed

Lines changed: 84 additions & 102 deletions

File tree

README.md

Lines changed: 71 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ These badges show the status of workflows in dummy repositories that use (or sho
4343
[![Pre-commit checks](https://github.com/SonarSource/sonar-dummy-yarn/actions/workflows/pre-commit.yml/badge.svg?branch=master)](https://github.com/SonarSource/sonar-dummy-yarn/actions/workflows/pre-commit.yml)
4444
[![Unified Dogfooding scans](https://github.com/SonarSource/sonar-dummy-yarn/actions/workflows/unified-dogfooding.yml/badge.svg?branch=master)](https://github.com/SonarSource/sonar-dummy-yarn/actions/workflows/unified-dogfooding.yml)
4545

46-
## Using AI for Cirrus CI to GitHub Actions Migration
47-
48-
It is recommended to use AI tools like Cursor or Claude code to assist with Cirrus CI to GitHub actions migration.
49-
This repository contains a comprehensive guide to be passed as a context to AI. The guide is shared with Sonar developers using Cursor,
50-
accessible using `@Doc` tag.
51-
52-
See the [documentation](https://xtranet-sonarsource.atlassian.net/wiki/spaces/Platform/pages/4232970266/Migration+From+Cirrus+CI+-+GitHub)
53-
for details on how to use it.
54-
5546
---
5647

5748
## Actions provided in this repository
@@ -70,6 +61,8 @@ for details on how to use it.
7061
- [`pr_cleanup`](#pr_cleanup)
7162
- [`code-signing`](#code-signing)
7263

64+
---
65+
7366
## `get-build-number`
7467

7568
Manage the build number in GitHub Actions.
@@ -125,12 +118,7 @@ No inputs are required for this action.
125118
|----------------------|--------------------------|
126119
| `BUILD_NUMBER` | The current build number |
127120

128-
### Features
129-
130-
- Automatic build number management with GitHub repository properties
131-
- Build number uniqueness per workflow run ID
132-
- No increment on workflow reruns
133-
- Sets both environment variable and output variable
121+
---
134122

135123
## `config-maven`
136124

@@ -250,6 +238,8 @@ steps:
250238

251239
See also [`get-build-number`](#get-build-number) output environment variables.
252240

241+
---
242+
253243
## `build-maven`
254244

255245
Build and deploy a Maven project with SonarQube analysis and Artifactory deployment.
@@ -372,23 +362,7 @@ for the public values, and by setting the environment variables for the private
372362

373363
See also [`config-maven`](#config-maven) output environment variables.
374364

375-
### Features
376-
377-
- Build context detection with automatic deployment strategies
378-
- SonarQube analysis for code quality
379-
- Artifact signing with GPG keys
380-
- Conditional deployment based on branch patterns
381-
- Develocity integration for build optimization (optional)
382-
- Maven local repository caching with customization options
383-
- Support for different branch types:
384-
- **master**: Deploy + SonarQube analysis with full profiles
385-
- **maintenance** (`branch-*`): Deploy with full profiles + separate SonarQube analysis
386-
- **pr**: Conditional deployment with SonarQube analysis
387-
- **dogfood** (`dogfood-on-*`): Deploy only with dogfood profiles
388-
- **feature** (`feature/long/*`): Verify + SonarQube analysis only
389-
- **default**: Basic verify goal only
390-
- Mixed privacy repository support for combined public and private artifacts
391-
- GitHub workflow job summary with build information and deployment status
365+
---
392366

393367
## `build-poetry`
394368

@@ -486,6 +460,8 @@ jobs:
486460
| `project-version` | The project version from pyproject.toml with build number. Also set as environment variable `PROJECT_VERSION` |
487461
| `deployed` | `true` if the build succeed and was supposed to deploy |
488462

463+
---
464+
489465
## `config-gradle`
490466

491467
Configure Gradle build environment with build number, authentication, and default settings.
@@ -610,11 +586,14 @@ If provided, `SONARSOURCE_REPOSITORY` is used at runtime by the Gradle init scri
610586

611587
See also [`get-build-number`](#get-build-number) output environment variables.
612588

589+
---
590+
613591
## `build-gradle`
614592

615593
Build and publish a Gradle project with SonarQube analysis and Artifactory deployment.
616594

617595
> **Note:** This action automatically calls [`config-gradle`](#config-gradle) to set up the Gradle environment.
596+
> **Note:** Uses the Gradle wrapper (`./gradlew`) by default, falling back to the `gradle` binary if not found.
618597

619598
### Requirements
620599

@@ -741,21 +720,6 @@ See also [`config-gradle`](#config-gradle) input environment variables.
741720
| `BUILD_NUMBER` | The current build number. Also set as environment variable `BUILD_NUMBER` |
742721
| `deployed` | `true` if the build succeed and was supposed to deploy |
743722

744-
### Features
745-
746-
- Uses the gradle wrapper (`./gradlew`) by default and falls back to the `gradle` binary in case it is not found
747-
- Automated version management with build numbers
748-
- SonarQube analysis for code quality with multi-platform support
749-
- Unified platform dogfooding - analyze across all 3 SonarQube platforms (next, sqc-eu, sqc-us)
750-
- Automatic deployment prevention during shadow scans to avoid duplicate artifacts
751-
- Conditional deployment based on branch patterns
752-
- Automatic artifact signing with credentials from Vault
753-
- Pull request support with optional deployment
754-
- Develocity integration for build scans
755-
- Gradle caching with customization options
756-
- Comprehensive build logging and error handling
757-
- GitHub workflow job summary with build information and deployment status
758-
759723
### Caching Configuration
760724

761725
By default, Gradle caches `~/.gradle/caches` and `~/.gradle/wrapper`. You can customize this behavior:
@@ -849,6 +813,8 @@ artifactory {
849813
}
850814
```
851815

816+
---
817+
852818
## `config-npm`
853819

854820
Configure NPM and JFrog build environment with build number, authentication, and settings.
@@ -922,6 +888,8 @@ See also [`get-build-number`](#get-build-number) input environment variables.
922888

923889
See also [`get-build-number`](#get-build-number) output environment variables.
924890

891+
---
892+
925893
## `build-npm`
926894

927895
Build, test, analyze with SonarQube, and deploy an NPM project to JFrog Artifactory.
@@ -1023,19 +991,7 @@ See also [`config-npm`](#config-npm) input environment variables.
1023991

1024992
See also [`config-npm`](#config-npm) output environment variables.
1025993

1026-
### Features
1027-
1028-
- Automated version management with build numbers and SNAPSHOT handling
1029-
- SonarQube analysis for code quality with multi-platform support
1030-
- Unified platform dogfooding - analyze across all 3 SonarQube platforms (next, sqc-eu, sqc-us)
1031-
- Automatic deployment prevention during shadow scans to avoid duplicate artifacts
1032-
- Conditional deployment based on branch patterns
1033-
- NPM dependency caching for faster builds (configurable)
1034-
- Pull request support with optional deployment
1035-
- JFrog build info publishing with UI links
1036-
- Support for different branch types (default, maintenance, PR, dogfood, long-lived feature)
1037-
- Comprehensive build logging and error handling
1038-
- GitHub workflow job summary with build information and deployment status
994+
---
1039995

1040996
## `build-yarn`
1041997

@@ -1125,19 +1081,7 @@ jobs:
11251081
| `project-version` | The project version from package.json |
11261082
| `deployed` | `true` if the build succeed and was supposed to deploy |
11271083

1128-
### Features
1129-
1130-
- Automated version management with build numbers and SNAPSHOT handling
1131-
- SonarQube analysis for code quality with multi-platform support
1132-
- Unified platform dogfooding - analyze across all 3 SonarQube platforms (next, sqc-eu, sqc-us)
1133-
- Automatic deployment prevention during shadow scans to avoid duplicate artifacts
1134-
- Conditional deployment based on branch patterns
1135-
- Yarn dependency caching for faster builds (configurable)
1136-
- Pull request support with optional deployment
1137-
- JFrog build info publishing with UI links
1138-
- Support for different branch types (default, maintenance, PR, dogfood, long-lived feature)
1139-
- Comprehensive build logging and error handling
1140-
- GitHub workflow job summary with build information and deployment status
1084+
---
11411085

11421086
## `config-pip`
11431087

@@ -1218,14 +1162,6 @@ steps:
12181162

12191163
See also [`get-build-number`](#get-build-number) output environment variables.
12201164

1221-
### Features
1222-
1223-
- Build number management via [`get-build-number`](#get-build-number)
1224-
- Automatic Artifactory authentication via Vault
1225-
- Auto-detection of reader role based on repository visibility
1226-
- Pip dependency caching with customization options
1227-
- Global pip configuration for all subsequent `pip install` commands
1228-
12291165
### Migration from configure-pipx-repox
12301166

12311167
If you're currently using `SonarSource/sonarqube-cloud-github-actions/configure-pipx-repox@master`, you can replace it with:
@@ -1240,6 +1176,8 @@ If you're currently using `SonarSource/sonarqube-cloud-github-actions/configure-
12401176

12411177
Both actions produce the same configuration and are functionally equivalent.
12421178

1179+
---
1180+
12431181
## `promote`
12441182

12451183
This action promotes a build in JFrog Artifactory and updates the GitHub status check accordingly.
@@ -1320,15 +1258,6 @@ promote:
13201258

13211259
This action does not provide any outputs.
13221260

1323-
### Features
1324-
1325-
- Automatic promotion of build artifacts in JFrog Artifactory
1326-
- GitHub status check updates with promotion status
1327-
- Support for both single and multi-repository promotions
1328-
- Automatic target repository determination based on branch type
1329-
- Pull request artifact promotion support
1330-
- GitHub workflow job summary with promotion information and deployment link
1331-
13321261
---
13331262

13341263
## `pr_cleanup`
@@ -1367,13 +1296,7 @@ No inputs are required for this action.
13671296

13681297
No outputs are provided by this action.
13691298

1370-
### Features
1371-
1372-
- Remove GitHub Actions caches associated with the PR
1373-
- Clean up artifacts created during PR workflows
1374-
- Provide detailed output of the deleted resources
1375-
- Show before/after state of caches and artifacts
1376-
- Automatic triggering on PR closure
1299+
---
13771300

13781301
## `code-signing`
13791302

@@ -1435,12 +1358,32 @@ After running this action, the following environment variables are available:
14351358
- `SM_CODE_SIGNING_CERT_SHA1_HASH`: Certificate fingerprint for signing
14361359
- `SMTOOLS_PATH`: Path where SMTools are installed, certificate and `.cfg` file is stored.
14371360

1438-
### Features
1361+
---
1362+
1363+
## Deployment Strategy
1364+
1365+
All build actions (`build-maven`, `build-gradle`, `build-npm`, `build-yarn`, `build-poetry`) share the same branch-based deployment and
1366+
SonarQube analysis strategy. Shared helper predicates and orchestration utilities are provided by `shared/common-functions.sh`, while the
1367+
concrete deploy and scan behavior is implemented in each build script:
1368+
1369+
| Branch | Deploy | SonarQube |
1370+
|---------------------------------------|----------|-----------|
1371+
| Default branch (`master`, `main`) | yes | yes |
1372+
| Maintenance (`branch-*`) | yes | yes |
1373+
| Pull request | optional | yes |
1374+
| Dogfood (`dogfood-on-*`) | yes | no |
1375+
| Long-lived feature (`feature/long/*`) | yes ¹ | yes |
1376+
| Other branches | no | no |
1377+
1378+
- Pull request deployment requires `deploy-pull-request: 'true'`.
1379+
- SonarQube analysis also requires `sonar-platform` to be set (not `none`).
1380+
- ¹ `build-maven` and `build-gradle` only; `build-npm`, `build-yarn`, and `build-poetry` do not deploy on long-lived feature branches.
1381+
- `build-maven` and `build-gradle` support a `deploy: 'false'` input to override deployment regardless of branch. `build-npm`,
1382+
`build-yarn`, and `build-poetry` do not have this input (TODO: add for consistency).
1383+
- **`build-gradle` known bug**: SonarQube analysis is not filtered by branch type. When `sonar-platform ≠ none`, analysis runs on all
1384+
branches, including dogfood and other branches (unlike all other build actions).
14391385

1440-
- **Official DigiCert Integration**: Uses the official DigiCert `ssm-code-signing` action for reliable smctl installation
1441-
- **Unified Caching Strategy**: Single cache key for both smctl and jsign tools to optimize cache efficiency
1442-
- **Smart Cache Management**: Caches smctl installation directory and jsign .deb package for faster subsequent runs
1443-
- **Automatic Setup**: Handles all DigiCert authentication and environment configuration
1386+
---
14441387

14451388
## Provenance Attestation
14461389

@@ -1588,3 +1531,29 @@ improvements, fixes, documentation, and **breaking changes**).
15881531
Communicate major updates, changes and migrations that require action from users following as indicated in
15891532
the [Updates, Changes and Migrations for Squads - Platform](https://xtranet-sonarsource.atlassian.net/wiki/spaces/Platform/pages/4385374219/Updates+Changes+and+Migrations+for+Squads+-+Platform#Usage-of-Communication-Channels)
15901533
xtranet page.
1534+
1535+
---
1536+
1537+
## Using AI for Cirrus CI to GitHub Actions Migration
1538+
1539+
It is recommended to use AI tools like Cursor or Claude code to assist with Cirrus CI to GitHub actions migration.
1540+
1541+
This repository contains a comprehensive guide to be passed as a context to
1542+
AI: [.cursor/cirrus-github-migration.md](.cursor/cirrus-github-migration.md). Here are some example prompts:
1543+
1544+
```md
1545+
Refer @https://github.com/SonarSource/ci-github-actions/blob/master/.cursor/cirrus-github-migration.md
1546+
Migrate @.cirrus.yml to GitHub Actions
1547+
```
1548+
1549+
Or, in the [re-terraform-aws-vault](https://github.com/SonarSource/re-terraform-aws-vault) repository, you can use it to check for missing
1550+
vault secrets before migration:
1551+
1552+
```md
1553+
Refer @https://github.com/SonarSource/ci-github-actions/blob/master/.cursor/cirrus-github-migration.md
1554+
Give me a report of the missing vault secrets for the repository `sonar-dummy`
1555+
```
1556+
1557+
See
1558+
the ["Migration From Cirrus CI - GitHub" xtranet documentation](https://xtranet-sonarsource.atlassian.net/wiki/spaces/Platform/pages/4232970266/Migration+From+Cirrus+CI+-+GitHub)
1559+
for more details.

build-gradle/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ gradle_build() {
223223
echo "::endgroup::"
224224
else
225225
# Build with sonar analysis via orchestrator
226+
# TODO BUILD-10586: sonar analysis is not filtered by branch type here — it runs on all branches
227+
# (including dogfood and other branches) when sonar-platform != none. This differs from
228+
# build-maven/build-npm/build-yarn/build-poetry which skip sonar on dogfood/other branches.
229+
# Should add a should_scan() guard consistent with the other build scripts.
226230
# shellcheck disable=SC2119
227231
orchestrate_sonar_platforms
228232
fi

build-npm/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ jfrog_npm_publish() {
123123
}
124124

125125
# Determine build configuration based on branch type
126+
# TODO BUILD-10586: this function does not support a DEPLOY env var to override deployment (unlike build-maven and build-gradle).
127+
# Should add a DEPLOY=${DEPLOY:=true} check consistent with those build scripts.
128+
# Note: unlike build-maven and build-gradle, long-lived feature branches (feature/long/*) do not deploy here.
126129
get_build_config() {
127130
local enable_sonar enable_deploy
128131
local sonar_args=()

build-poetry/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ set_project_version() {
193193
}
194194

195195
# Determine build configuration based on branch type
196+
# TODO BUILD-10586: this function does not support a DEPLOY env var to override deployment (unlike build-maven and build-gradle).
197+
# Should add a DEPLOY=${DEPLOY:=true} check consistent with those build scripts.
198+
# Note: unlike build-maven and build-gradle, long-lived feature branches (feature/long/*) do not deploy here.
196199
get_build_config() {
197200
local enable_sonar enable_deploy
198201
local sonar_args=()

build-yarn/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ jfrog_yarn_publish() {
193193
}
194194

195195
# Determine build configuration based on branch type
196+
# TODO BUILD-10586: this function does not support a DEPLOY env var to override deployment (unlike build-maven and build-gradle).
197+
# Should add a DEPLOY=${DEPLOY:=true} check consistent with those build scripts.
198+
# Note: unlike build-maven and build-gradle, long-lived feature branches (feature/long/*) do not deploy here.
196199
get_build_config() {
197200
local enable_sonar enable_deploy
198201
local sonar_args=()

0 commit comments

Comments
 (0)