Skip to content
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

SONARGO-75 Onboard sonar-go to Develocity #39

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
ORG_GRADLE_PROJECT_signingKeyId: VAULT[development/kv/data/sign data.key_id]

GRADLE_USER_HOME: ${CIRRUS_WORKING_DIR}/.gradle
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}

linux_image_template: &LINUX_IMAGE
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-g7-latest
Expand Down Expand Up @@ -45,6 +47,18 @@

## Build tasks

on_failure_template: &ON_FAILURE
on_failure:
junit_artifacts:
path: '**/test-results/**/*.xml'
format: junit
reports_artifacts:
path: '**/build/reports/**/*'
error_log_artifacts:
path: "hs_err_pid*.log"
heap_dump_artifacts:
path: "*.hprof"

setup_gradle_cache_template: &SETUP_GRADLE_CACHE
gradle_cache:
folder: .gradle/caches
Expand Down Expand Up @@ -72,11 +86,7 @@
- gradle --version
- source set_gradle_build_version
- regular_gradle_build_deploy_analyze
on_failure:
error_log_artifacts:
path: "hs_err_pid*.log"
heap_dump_artifacts:
path: "*.hprof"
<<: *ON_FAILURE
<<: *CLEANUP_GRADLE_CACHE_SCRIPT

### QA tasks
Expand All @@ -102,7 +112,7 @@
-Pqa --info --stacktrace --console plain --no-daemon --build-cache
<<: *CLEANUP_GRADLE_CACHE_SCRIPT

qa_plugin_task:

Check warning on line 115 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L115

task "qa_plugin" depends on task "build", but their only_if conditions are different

Check warning on line 115 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L115

task "qa_plugin" depends on task "build", but their only_if conditions are different

Check warning on line 115 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L115

task "qa_plugin" depends on task "build", but their only_if conditions are different

Check warning on line 115 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L115

task "qa_plugin" depends on task "build", but their only_if conditions are different
<<: *QA_TASK_FILTER
env:
ITS_PROJECT: "plugin"
Expand All @@ -112,8 +122,10 @@
- SQ_VERSION: "LATEST_RELEASE"
<<: *LINUX_4_CPU_6G_JAVA_17
<<: *GRADLE_ITS_TEMPLATE
<<: *ON_FAILURE


qa_ruling_task:

Check warning on line 128 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L128

task "qa_ruling" depends on task "build", but their only_if conditions are different

Check warning on line 128 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L128

task "qa_ruling" depends on task "build", but their only_if conditions are different
<<: *QA_TASK_FILTER
env:
SQ_VERSION: "LATEST_RELEASE"
Expand All @@ -121,6 +133,7 @@
ITS_PROJECT: "ruling"
<<: *LINUX_4_CPU_6G_JAVA_17
<<: *GRADLE_ITS_TEMPLATE
<<: *ON_FAILURE

### Mend tasks

Expand Down Expand Up @@ -152,7 +165,7 @@

### Promote tasks

promote_task:

Check warning on line 168 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L168

task "promote" depends on task "build", but their only_if conditions are different

Check warning on line 168 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L168

task "promote" depends on task "build", but their only_if conditions are different
depends_on:
- build
- qa_plugin
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,40 @@ If you are on Windows, read the [sonar-go-to-slang/README.md](sonar-go-to-slang/
### Build
Build and run Unit Tests:

./gradlew build

```shell
./gradlew build
```
`
## Integration Tests

By default, Integration Tests (ITs) are skipped during builds.
If you want to run them, you need first to retrieve the related projects which are used as input:

git submodule update --init its/sources
```shell
git submodule update --init
```

Then build and run the Integration Tests using the `its` property:

```shell
./gradlew build -Pits --info --no-daemon
```

You can also build and run only Ruling Tests using the `ruling` property:

./gradlew build -Pruling --info --no-daemon
```shell
./gradlew build -Pruling --info --no-daemon
```

## License headers

License headers are automatically updated by the spotless plugin but only for Java files.
Furthermore, there are files such as `package-info.java` and `module-info.java` that spotless ignores.
Also the Go source files are not handled. For those files use a manual script like below to update the license:
`find . -type f -name "*.go" -exec sed -i '' 's/2018-2023/2018-2024/' "{}" \;`

```shell
`find . -type f -name "*.go" -exec sed -i '' 's/2018-2023/2018-2024/' "{}" \;`
```

## License

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ version=1.19.0-SNAPSHOT
description=Code Analyzer for Go
projectTitle=Go
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1024m
org.gradle.caching=true
21 changes: 21 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ pluginManagement {
}
}

plugins {
id 'com.gradle.develocity' version '3.18.2'
}

develocity {
server = 'https://develocity.sonar.build'
}

def isCI = System.getenv('CI') != null
buildCache {
local {
enabled = !isCI
}
remote(develocity.buildCache) {
enabled = true
push = isCI
}
}



dependencyResolutionManagement {
def slangDependenciesVersion = '1.17.0.6351'
def analyzerCommonsVersion = '2.16.0.3141'
Expand Down
Loading