Skip to content

Commit 2740240

Browse files
authored
Merge pull request #12187 from DefectDojo/release/2.45.0
Release: Merge release into master from: release/2.45.0
2 parents ed6b9e3 + 5a93e63 commit 2740240

File tree

135 files changed

+1367
-512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1367
-512
lines changed

.github/workflows/build-docker-images-for-testing.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,38 @@ on:
44
# inspired by https://github.com/orgs/community/discussions/26801 we take the runs-on as parameter so we can run arm64 on native hardwarde
55
workflow_dispatch:
66
inputs:
7-
runner:
7+
platform:
88
type: string
9-
default: "ubuntu-latest"
9+
default: "linux/amd64"
1010
workflow_call:
1111
inputs:
12-
runner:
12+
platform:
1313
type: string
14-
default: "ubuntu-latest"
14+
default: "linux/amd64"
1515

1616
jobs:
1717
build:
1818
name: Build Docker Images
19-
runs-on: ${{ inputs.runner }}
19+
runs-on: ${{ inputs.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
2020
strategy:
2121
matrix:
22-
# integration tests are only build (and run) on debian x64
22+
# integration tests are only build (and run) on debian linux/amd64
2323
docker-image: [django, nginx, integration-tests]
2424
os: [alpine, debian]
25-
runner: ["${{ inputs.runner }}"]
25+
platform: ["${{ inputs.platform }}"]
2626
exclude:
2727
- docker-image: integration-tests
2828
os: alpine
2929
- docker-image: integration-tests
30-
runner: ubuntu-24.04-arm
30+
platform: linux/arm64
3131

3232
steps:
33-
- name: Show Platform
34-
run: echo Runner value for this run = ${{ inputs.runner }}
33+
# Replace slashes so we can use this in filenames
34+
- name: Set-platform
35+
run: |
36+
platform=${{ inputs.platform }}
37+
echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV
38+
echo $GITHUB_ENV
3539
3640
- name: Checkout
3741
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -56,13 +60,13 @@ jobs:
5660
push: false
5761
tags: defectdojo/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }},${{ env.IMAGE_REPOSITORY }}/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }}
5862
file: Dockerfile.${{ matrix.docker-image }}-${{ matrix.os }}
59-
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}_img
63+
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}-${{ env.PLATFORM }}_img
6064

6165
# export docker images to be used in next jobs below
6266
- name: Upload image ${{ matrix.docker-image }} as artifact
6367
timeout-minutes: 15
64-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
68+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6569
with:
66-
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}
67-
path: ${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}_img
70+
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}-${{ env.PLATFORM }}
71+
path: ${{ matrix.docker-image }}-${{ matrix.os }}-${{ env.PLATFORM }}_img
6872
retention-days: 1

.github/workflows/fetch-oas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: docker compose down
5252

5353
- name: Upload oas.${{ matrix.file-type }} as artifact
54-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
54+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5555
with:
5656
name: oas-${{ matrix.file-type }}
5757
path: oas.${{ matrix.file-type }}

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
extended: true
2020

2121
- name: Setup Node
22-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
22+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2323
with:
24-
node-version: '22.5.1'
24+
node-version: '22.14.0'
2525

2626
- name: Cache dependencies
27-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
27+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2828
with:
2929
path: ~/.npm
3030
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# load docker images from build jobs
4747
- name: Load images from artifacts
48-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
48+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
4949
with:
5050
path: built-docker-image
5151
pattern: built-docker-image-*
@@ -54,9 +54,9 @@ jobs:
5454
- name: Load docker images
5555
timeout-minutes: 10
5656
run: |-
57-
docker load -i built-docker-image/nginx-${{ matrix.os }}-ubuntu-latest_img
58-
docker load -i built-docker-image/django-${{ matrix.os }}-ubuntu-latest_img
59-
docker load -i built-docker-image/integration-tests-debian-ubuntu-latest_img
57+
docker load -i built-docker-image/nginx-${{ matrix.os }}-linux-amd64_img
58+
docker load -i built-docker-image/django-${{ matrix.os }}-linux-amd64_img
59+
docker load -i built-docker-image/integration-tests-debian-linux-amd64_img
6060
docker images
6161
6262
- name: Set integration-test mode

.github/workflows/k8s-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
minikube status
4949
5050
- name: Load images from artifacts
51-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
51+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
5252
with:
5353
path: built-docker-image
5454
pattern: built-docker-image-*
@@ -58,8 +58,8 @@ jobs:
5858
timeout-minutes: 15
5959
run: |-
6060
eval $(minikube docker-env)
61-
docker load -i built-docker-image/nginx-${{ matrix.os }}-ubuntu-latest_img
62-
docker load -i built-docker-image/django-${{ matrix.os }}-ubuntu-latest_img
61+
docker load -i built-docker-image/nginx-${{ matrix.os }}-linux-amd64_img
62+
docker load -i built-docker-image/django-${{ matrix.os }}-linux-amd64_img
6363
docker images
6464
6565
- name: Configure HELM repos
@@ -75,7 +75,7 @@ jobs:
7575
echo "redis=${{ env.HELM_REDIS_BROKER_SETTINGS }}" >> $GITHUB_ENV
7676
7777
- name: Deploying Django application with ${{ matrix.databases }} ${{ matrix.brokers }}
78-
timeout-minutes: 15
78+
timeout-minutes: 15
7979
run: |-
8080
helm install \
8181
--timeout 800s \

.github/workflows/release-1-create-pr.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,38 @@ jobs:
1919
create_pr:
2020
runs-on: ubuntu-latest
2121
steps:
22-
22+
- id: Set-GitHub-org
23+
run: echo "GITHUB_ORG=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
24+
2325
- name: Checkout from_branch branch
2426
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2527
with:
2628
ref: ${{ github.event.inputs.from_branch }}
27-
29+
2830
- name: Create release branch
2931
if: ${{ !startsWith(github.event.inputs.from_branch, 'release/') }}
3032
run: |
3133
echo "NEW_BRANCH=release/${{ github.event.inputs.release_number }}" >> $GITHUB_ENV
32-
34+
3335
- name: Use existing release branch
3436
if: startsWith(github.event.inputs.from_branch, 'release/')
3537
run: |
3638
echo "NEW_BRANCH=${{ github.event.inputs.from_branch }}" >> $GITHUB_ENV
37-
39+
3840
- name: Configure git
3941
run: |
4042
git config --global user.name "${{ env.GIT_USERNAME }}"
4143
git config --global user.email "${{ env.GIT_EMAIL }}"
42-
44+
4345
- name: Push branch
4446
if: "!startsWith('${{ github.event.inputs.from_branch }}', 'release/')"
4547
run: git push origin HEAD:${NEW_BRANCH}
46-
48+
4749
- name: Checkout release branch
4850
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4951
with:
5052
ref: ${{ env.NEW_BRANCH }}
51-
53+
5254
- name: Update version numbers in key files
5355
run: |
5456
sed -ri 's/__version__ = ".*"/__version__ = "${{ github.event.inputs.release_number }}"/' dojo/__init__.py
@@ -82,18 +84,14 @@ jobs:
8284
commit_author: "${{ env.GIT_USERNAME }} <${{ env.GIT_EMAIL }}>"
8385
commit_message: "Update versions in application files"
8486
branch: ${{ env.NEW_BRANCH }}
85-
- id: set-repo-org
86-
run: echo "repoorg=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
87-
87+
8888
- name: Create Pull Request
89-
env:
90-
REPO_ORG: ${{ env.repoorg }}
9189
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
9290
with:
9391
github-token: ${{ secrets.GITHUB_TOKEN }}
9492
script: |
9593
github.rest.pulls.create({
96-
owner: '${{ env.REPO_ORG }}',
94+
owner: '${{ env.GITHUB_ORG }}',
9795
repo: 'django-DefectDojo',
9896
title: 'Release: Merge release into master from: ${{ env.NEW_BRANCH }}',
9997
body: `Release triggered by \`${ process.env.GITHUB_ACTOR }\``,

.github/workflows/release-2-tag-docker-push.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,27 @@ jobs:
4040
release_number: ${{ github.event.inputs.release_number }}
4141
secrets: inherit
4242

43-
release-docker-containers:
43+
publish-docker-containers:
44+
strategy:
45+
matrix:
46+
platform: ['linux/amd64', 'linux/arm64']
47+
fail-fast: false
4448
needs: tag
4549
uses: ./.github/workflows/release-x-manual-docker-containers.yml
4650
with:
4751
release_number: ${{ github.event.inputs.release_number }}
52+
platform: ${{ matrix.platform }}
53+
secrets: inherit
54+
55+
publish-container-digests:
56+
needs: publish-docker-containers
57+
uses: ./.github/workflows/release-x-manual-merge-container-digests.yml
58+
with:
59+
release_number: ${{ github.event.inputs.release_number }}
4860
secrets: inherit
4961

5062
release-drafter:
51-
needs: release-docker-containers
63+
needs: publish-container-digests
5264
uses: ./.github/workflows/release-drafter.yml
5365
with:
5466
version: ${{ github.event.inputs.release_number }}

.github/workflows/release-3-master-into-dev.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,39 @@ jobs:
1919
create_pr_for_merge_back_into_dev:
2020
runs-on: ubuntu-latest
2121
steps:
22-
22+
- id: Set-GitHub-org
23+
run: echo "GITHUB_ORG=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
24+
2325
- name: Checkout master
2426
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2527
with:
2628
ref: master
27-
29+
2830
- name: Create merge back branch
2931
run: |
3032
echo "NEW_BRANCH=master-into-dev/${{ github.event.inputs.release_number_new }}-${{ github.event.inputs.release_number_dev }}" >> $GITHUB_ENV
31-
33+
3234
- name: Configure git
3335
run: |
3436
git config --global user.name "${{ env.GIT_USERNAME }}"
3537
git config --global user.email "${{ env.GIT_EMAIL }}"
36-
38+
3739
- name: Push new branch
3840
run: git push origin HEAD:${NEW_BRANCH}
39-
41+
4042
- name: Checkout new branch
4143
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4244
with:
4345
ref: ${{ env.NEW_BRANCH }}
44-
46+
4547
- name: Update version numbers in key files
4648
run: |
4749
sed -ri 's/__version__ = ".*"/__version__ = "${{ github.event.inputs.release_number_dev }}"/' dojo/__init__.py
4850
sed -ri 's/"version": ".*"/"version": "${{ github.event.inputs.release_number_dev }}"/' components/package.json
4951
sed -ri 's/appVersion: ".*"/appVersion: "${{ github.event.inputs.release_number_dev }}"/' helm/defectdojo/Chart.yaml
5052
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
5153
sed -ri "0,/version/s/version: \S+/$(echo "version: $CURRENT_CHART_VERSION" | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-dev/" helm/defectdojo/Chart.yaml
52-
54+
5355
- name: Check numbers
5456
run: |
5557
grep version dojo/__init__.py
@@ -80,64 +82,63 @@ jobs:
8082
commit_author: "${{ env.GIT_USERNAME }} <${{ env.GIT_EMAIL }}>"
8183
commit_message: "Update versions in application files"
8284
branch: ${{ env.NEW_BRANCH }}
83-
- id: set-repo-org
84-
run: echo "repoorg=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
85-
85+
8686
- name: Create Pull Request
87-
env:
88-
REPO_ORG: ${{ env.repoorg }}
8987
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
9088
with:
9189
github-token: ${{ secrets.GITHUB_TOKEN }}
9290
script: |
9391
github.rest.pulls.create({
94-
owner: '${{ env.REPO_ORG }}',
92+
owner: '${{ env.GITHUB_ORG }}',
9593
repo: 'django-DefectDojo',
9694
title: 'Release: Merge back ${{ github.event.inputs.release_number_new }} into dev from: ${{ env.NEW_BRANCH }}',
9795
body: `Release triggered by \`${ process.env.GITHUB_ACTOR }\``,
9896
head: '${{ env.NEW_BRANCH }}',
9997
base: 'dev'
10098
})
99+
101100
create_pr_for_merge_back_into_bugfix:
102101
runs-on: ubuntu-latest
103102
steps:
104-
103+
- id: Set-GitHub-org
104+
run: echo "GITHUB_ORG=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
105+
105106
- name: Checkout master
106107
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
107108
with:
108109
ref: master
109-
110+
110111
- name: Create merge back branch
111112
run: |
112113
echo "NEW_BRANCH=master-into-bugfix/${{ github.event.inputs.release_number_new }}-${{ github.event.inputs.release_number_dev }}" >> $GITHUB_ENV
113-
114+
114115
- name: Configure git
115116
run: |
116117
git config --global user.name "${{ env.GIT_USERNAME }}"
117118
git config --global user.email "${{ env.GIT_EMAIL }}"
118-
119+
119120
- name: Push new branch
120121
run: git push origin HEAD:${NEW_BRANCH}
121-
122+
122123
- name: Checkout new branch
123124
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124125
with:
125126
ref: ${{ env.NEW_BRANCH }}
126-
127+
127128
- name: Update version numbers in key files
128129
run: |
129130
sed -ri "s/__version__ = '.*'/__version__ = '${{ github.event.inputs.release_number_dev }}'/" dojo/__init__.py
130131
sed -ri "s/appVersion: \".*\"/appVersion: \"${{ github.event.inputs.release_number_dev }}\"/" helm/defectdojo/Chart.yaml
131132
sed -ri "s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.release_number_dev }}\"/" components/package.json
132133
CURRENT_CHART_VERSION=$(grep -oP 'version: (\K\S*)?' helm/defectdojo/Chart.yaml | head -1)
133134
sed -ri "0,/version/s/version: \S+/$(echo "version: $CURRENT_CHART_VERSION" | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-dev/" helm/defectdojo/Chart.yaml
134-
135+
135136
- name: Check numbers
136137
run: |
137138
grep version dojo/__init__.py
138139
grep appVersion helm/defectdojo/Chart.yaml
139140
grep version components/package.json
140-
141+
141142
- name: Push version changes
142143
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
143144
with:
@@ -146,18 +147,14 @@ jobs:
146147
commit_author: "${{ env.GIT_USERNAME }} <${{ env.GIT_EMAIL }}>"
147148
commit_message: "Update versions in application files"
148149
branch: ${{ env.NEW_BRANCH }}
149-
- id: set-repo-org
150-
run: echo "repoorg=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
151-
150+
152151
- name: Create Pull Request
153-
env:
154-
REPO_ORG: ${{ env.repoorg }}
155152
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
156153
with:
157154
github-token: ${{ secrets.GITHUB_TOKEN }}
158155
script: |
159156
github.rest.pulls.create({
160-
owner: '${{ env.REPO_ORG }}',
157+
owner: '${{ env.GITHUB_ORG }}',
161158
repo: 'django-DefectDojo',
162159
title: 'Release: Merge back ${{ github.event.inputs.release_number_new }} into bugfix from: ${{ env.NEW_BRANCH }}',
163160
body: `Release triggered by \`${ process.env.GITHUB_ACTOR }\``,

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Load OAS files from artifacts
50-
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
50+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
5151
with:
5252
pattern: oas-*
5353

0 commit comments

Comments
 (0)