Skip to content

Commit d3ee872

Browse files
marshall007Racer159
andauthoredJul 30, 2024··
chore!: update to SonarQube 10, migrate to upstream chart, add unicorn CGR flavor (#100)
## Description ## Related Issue Fixes #82 Fixes #96 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-package-sonarqube/blob/main/CONTRIBUTING.md#developer-workflow) followed --------- Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com> Release-As: v10.6.0-uds.0
1 parent 074db36 commit d3ee872

17 files changed

+98
-63
lines changed
 

‎.github/workflows/commitlint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ on:
88
jobs:
99
validate:
1010
name: Validate
11-
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
11+
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0

‎.github/workflows/lint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121

2222
- name: Environment setup
23-
uses: defenseunicorns/uds-common/.github/actions/setup@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
23+
uses: defenseunicorns/uds-common/.github/actions/setup@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
2424
with:
2525
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
2626
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

‎.github/workflows/tag-and-release.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ${{ matrix.architecture == 'arm64' && 'uds-swf-ubuntu-arm64-4-core' || 'ubuntu-latest' }}
2626
strategy:
2727
matrix:
28-
flavor: [upstream, registry1]
28+
flavor: [upstream, unicorn, registry1]
2929
architecture: [amd64, arm64]
3030
exclude:
3131
- flavor: registry1
@@ -35,26 +35,28 @@ jobs:
3535
permissions:
3636
contents: read
3737
packages: write
38+
id-token: write
3839

3940
steps:
4041
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4142

4243
- name: Environment setup
43-
uses: defenseunicorns/uds-common/.github/actions/setup@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
44+
uses: defenseunicorns/uds-common/.github/actions/setup@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
4445
with:
4546
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
4647
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
4748
ghToken: ${{ secrets.GITHUB_TOKEN }}
49+
chainguardIdentity: ${{ secrets.CHAINGUARD_IDENTITY }}
4850

4951
- name: Publish Package
5052
run: uds run -f tasks/publish.yaml package --set FLAVOR=${{ matrix.flavor }} --no-progress
5153

5254
- name: Debug Output
5355
if: ${{ always() }}
54-
uses: defenseunicorns/uds-common/.github/actions/debug-output@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
56+
uses: defenseunicorns/uds-common/.github/actions/debug-output@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
5557

5658
- name: Save logs
5759
if: always()
58-
uses: defenseunicorns/uds-common/.github/actions/save-logs@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
60+
uses: defenseunicorns/uds-common/.github/actions/save-logs@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
5961
with:
6062
suffix: ${{ matrix.flavor }}-${{ matrix.architecture }}-${{ github.run_id }}-${{ github.run_attempt }}

‎.github/workflows/test.yaml

+13-6
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,48 @@ concurrency:
2929

3030
permissions:
3131
contents: read
32+
id-token: write
3233

3334
jobs:
3435
run-test:
3536
name: ${{ matrix.type }} ${{ matrix.flavor }}
36-
runs-on: ubuntu-latest
37+
runs-on: uds-swf-ubuntu-big-boy-4-core
3738
timeout-minutes: 20
3839
strategy:
3940
matrix:
40-
flavor: [upstream, registry1]
41+
flavor: [upstream, unicorn, registry1]
4142
type: [install, upgrade]
43+
# do not run upgrade tests for unicorn
44+
# TODO @marshall: remove after first unicorn release
45+
exclude:
46+
- flavor: unicorn
47+
type: upgrade
4248

4349
steps:
4450
- name: Checkout repository
4551
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4652

4753
- name: Environment setup
48-
uses: defenseunicorns/uds-common/.github/actions/setup@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
54+
uses: defenseunicorns/uds-common/.github/actions/setup@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
4955
with:
5056
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
5157
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
5258
ghToken: ${{ secrets.GITHUB_TOKEN }}
59+
chainguardIdentity: ${{ secrets.CHAINGUARD_IDENTITY }}
5360

5461
- name: Test
55-
uses: defenseunicorns/uds-common/.github/actions/test@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
62+
uses: defenseunicorns/uds-common/.github/actions/test@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
5663
with:
5764
flavor: ${{ matrix.flavor }}
5865
type: ${{ matrix.type }}
5966

6067
- name: Debug Output
6168
if: ${{ always() }}
62-
uses: defenseunicorns/uds-common/.github/actions/debug-output@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
69+
uses: defenseunicorns/uds-common/.github/actions/debug-output@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
6370

6471
- name: Save logs
6572
if: always()
66-
uses: defenseunicorns/uds-common/.github/actions/save-logs@91515ef86914334356c35ffb4b2c2c5fb4d19174 # v0.9.0
73+
uses: defenseunicorns/uds-common/.github/actions/save-logs@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
6774
with:
6875
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
6976

‎chart/templates/sonarqube-sso-secret.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This secret will be used if sso is disabled, instead of the templated one in uds-package.yaml.
2-
# Sonarqube needs to mount the secret and creating it this way avoids creating an unnecessary
1+
# This secret will be used if sso is disabled, instead of the templated one in uds-package.yaml.
2+
# Sonarqube needs to mount the secret and creating it this way avoids creating an unnecessary
33
# client in the keycloak realm and unnecessary secret data in the cluster.
44
{{- if not .Values.sso.enabled }}
55

‎common/zarf.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ components:
1414
localPath: ../chart
1515
- name: sonarqube
1616
namespace: sonarqube
17-
# see note in README.md about use of registry1 chart for both flavors
18-
url: https://repo1.dso.mil/big-bang/product/packages/sonarqube.git
19-
gitPath: chart
20-
version: "8.0.4-bb.5"
17+
url: https://SonarSource.github.io/helm-chart-sonarqube
18+
version: 10.6.1
2119
valuesFiles:
2220
- ../values/common-values.yaml
2321
actions:
@@ -31,3 +29,7 @@ components:
3129
name: sonarqube
3230
namespace: sonarqube
3331
condition: "'{.status.phase}'=Ready"
32+
- description: Perform DB migrations if necessary
33+
cmd: |
34+
STATUS=$(curl -XPOST -s "https://sonarqube.$ZARF_VAR_DOMAIN/api/system/migrate_db" | ./zarf tools yq '.state')
35+
echo "SonarQube migration state: ${STATUS}"

‎renovate.json

-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
"labels": ["package-deps"],
2323
"commitMessageTopic": "package-deps",
2424
"matchDatasources": ["docker", "helm", "git-tags"]
25-
},
26-
{
27-
"groupName": "SonarQube Package Dependencies",
28-
"labels": ["package-deps"],
29-
"commitMessageTopic": "package-deps",
30-
"matchPackageNames": ["https://repo1.dso.mil/big-bang/product/packages/sonarqube.git"],
31-
"allowedVersions": "/^8.+-bb.+/"
3225
}
3326
]
3427
}

‎tasks.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ includes:
22
- cleanup: ./tasks/cleanup.yaml
33
- dependencies: ./tasks/dependencies.yaml
44
- test: ./tasks/test.yaml
5-
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/create.yaml
6-
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/lint.yaml
7-
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/pull.yaml
8-
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/deploy.yaml
9-
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/setup.yaml
5+
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/create.yaml
6+
- lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/lint.yaml
7+
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/pull.yaml
8+
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/deploy.yaml
9+
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/setup.yaml
1010

1111
tasks:
1212
- name: default

‎tasks/publish.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
includes:
2-
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/create.yaml
3-
- publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/publish.yaml
4-
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/setup.yaml
5-
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.9.0/tasks/deploy.yaml
2+
- create: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/create.yaml
3+
- publish: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/publish.yaml
4+
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/setup.yaml
5+
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/deploy.yaml
66
- dependencies: ./dependencies.yaml
77
- test: ./test.yaml
88

‎tasks/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tasks:
2323
cmd: |
2424
STATUS=$(curl -s 'https://sonarqube.uds.dev/api/system/status' | ./uds zarf tools yq '.status')
2525
echo "SonarQube system status: ${STATUS}"
26-
if [ $STATUS != "UP" ]; then
26+
if [ "$STATUS" != "UP" ]; then
2727
sleep 10
2828
exit 1
2929
fi

‎tests/auth.setup.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { authFile } from './playwright.config';
44
setup('authenticate', async ({ page, context }) => {
55
await page.goto('/sessions/new');
66

7-
await page.locator('.identity-provider-link').click();
7+
await page.getByRole('button', { name: 'Log in with Keycloak' }).click();
88
await page.getByLabel('Username or email').fill('doug');
99
await page.getByLabel('Password').fill('unicorn123!@#UN');
1010

@@ -23,6 +23,4 @@ setup('authenticate', async ({ page, context }) => {
2323
expect(keycloakCookie?.domain).toContain("sso.");
2424

2525
await page.context().storageState({ path: authFile });
26-
27-
await expect(page).toHaveURL('/projects');
2826
})

‎tests/sonarqube.test.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ function randomProjectName() {
55
}
66

77
test('create a project', async ({ page }) => {
8-
await page.goto('/projects/create');
8+
await page.goto('/projects/create?mode=manual');
99

1010
const projectName = randomProjectName();
1111

12-
await page.getByRole('button', { name: 'Manually' }).click();
1312
await page.getByLabel('Project display name*').fill(projectName);
14-
await page.getByRole('button', { name: 'Set Up' }).click();
13+
await page.getByRole('button', { name: 'Next' }).click();
1514

16-
await expect(page).toHaveURL(`/dashboard?id=${projectName}`);
15+
await page.getByLabel('Use the global setting').check();
16+
await page.getByRole('button', { name: 'Create project' }).click();
1717

18-
await expect(page.getByRole('heading', { level: 1 })).toContainText(projectName);
18+
await expect(page).toHaveURL(`/tutorials?id=${projectName}`);
19+
20+
await expect(page.getByRole('heading', { level: 1 })).toContainText('Analysis Method');
1921
});

‎values/common-values.yaml

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
OpenShift:
2-
enabled: false
3-
41
edition: "community"
52

63
# Name of the secret from which to load additional properties: https://community.sonarsource.com/t/additional-sonar-properties-to-load-from-a-secret/73748
74
# This secret will be created by the uds operator based on the sso spec defined in chart/templates/uds-package.yaml
85
sonarSecretProperties: sonarqube-sso
96

10-
monitoring:
11-
enabled: true
7+
prometheusExporter:
8+
enabled: false
9+
10+
prometheusMonitoring:
11+
podMonitor:
12+
enabled: false
1213

1314
initSysctl:
1415
enabled: false
1516

16-
elasticsearch:
17-
configureNode: false
18-
1917
jdbcOverwrite:
20-
enable: true
18+
enable: true # DEPRECATED: use `jdbcOverwrite.enabled` in v10.7.0
19+
enabled: true
2120
jdbcUrl: jdbc:postgresql://###ZARF_VAR_SONARQUBE_DB_ENDPOINT###:5432/###ZARF_VAR_SONARQUBE_DB_NAME###
2221
jdbcUsername: ###ZARF_VAR_SONARQUBE_DB_USERNAME###
2322
jdbcPassword: null
@@ -26,10 +25,3 @@ jdbcOverwrite:
2625

2726
postgresql:
2827
enabled: false
29-
postgresqlServer: ###ZARF_VAR_SONARQUBE_DB_ENDPOINT###
30-
existingSecret: "sonarqube-postgres"
31-
existingSecretPasswordKey: "password"
32-
postgresqlUsername: ###ZARF_VAR_SONARQUBE_DB_USERNAME###
33-
postgresqlDatabase: ###ZARF_VAR_SONARQUBE_DB_NAME###
34-
service:
35-
port: 5432

‎values/registry1-values.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
image:
22
repository: registry1.dso.mil/ironbank/sonarsource/sonarqube/sonarqube
3-
tag: 9.9.5-community
3+
tag: 10.6.0-community
44

55
initContainers:
66
image: registry1.dso.mil/ironbank/big-bang/base:2.1.0
77

88
prometheusExporter:
99
image: registry1.dso.mil/ironbank/big-bang/base:2.1.0
10+
11+
# wget used by default probes not available in registry1 images
12+
livenessProbe:
13+
exec: null
14+
httpGet:
15+
path: /
16+
scheme: HTTP
17+
port: 9000
18+
readinessProbe:
19+
exec: null
20+
httpGet:
21+
path: /api/system/status
22+
scheme: HTTP
23+
port: 9000

‎values/unicorn-values.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
image:
2+
repository: cgr.dev/du-uds-defenseunicorns/sonarqube
3+
tag: 10.6.0
4+
5+
initContainers:
6+
image: cgr.dev/du-uds-defenseunicorns/busybox-fips:1.36
7+
8+
prometheusExporter:
9+
image: cgr.dev/du-uds-defenseunicorns/curl-fips:8-dev

‎values/upstream-values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image:
22
repository: sonarqube
3-
tag: 9.9.5-community
3+
tag: 10.6.0-community
44

55
initContainers:
66
image: busybox:1.36

‎zarf.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ components:
3535
- values/registry1-values.yaml
3636
images:
3737
- "registry1.dso.mil/ironbank/big-bang/base:2.1.0"
38-
- "registry1.dso.mil/ironbank/sonarsource/sonarqube/sonarqube:9.9.5-community"
38+
- "registry1.dso.mil/ironbank/sonarsource/sonarqube/sonarqube:10.6.0-community"
3939

4040
# Note: upstream flavor is experimental
4141
- name: sonarqube
@@ -50,6 +50,22 @@ components:
5050
valuesFiles:
5151
- values/upstream-values.yaml
5252
images:
53-
- "sonarqube:9.9.5-community"
53+
- "sonarqube:10.6.0-community"
5454
- "curlimages/curl:8.8.0"
5555
- "busybox:1.36"
56+
57+
- name: sonarqube
58+
required: true
59+
description: "Deploy sonarqube"
60+
import:
61+
path: common
62+
only:
63+
flavor: unicorn
64+
charts:
65+
- name: sonarqube
66+
valuesFiles:
67+
- values/unicorn-values.yaml
68+
images:
69+
- "cgr.dev/du-uds-defenseunicorns/sonarqube:10.6.0"
70+
- "cgr.dev/du-uds-defenseunicorns/curl-fips:8-dev"
71+
- "cgr.dev/du-uds-defenseunicorns/busybox-fips:1.36"

0 commit comments

Comments
 (0)
Please sign in to comment.