Skip to content

Commit d3cd42c

Browse files
authored
Merge pull request #11936 from DefectDojo/release/2.44.0
Release: Merge release into master from: release/2.44.0
2 parents b14b99f + 9d731ff commit d3cd42c

File tree

299 files changed

+4628
-2721
lines changed

Some content is hidden

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

299 files changed

+4628
-2721
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ A clear and concise description of what you expected to happen.
3333

3434
**Environment information**
3535
- Operating System: [e.g. Ubuntu 18.04]
36+
- Docker Compose or Helm version (Output of `docker compose version` or `helm version`)
3637
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3738

3839
**Logs**

.github/ISSUE_TEMPLATE/support_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ A clear and concise description of what you expected to happen.
3333

3434
**Environment information**
3535
- Operating System: [e.g. Ubuntu 18.04]
36+
- Docker Compose or Helm version (Output of `docker compose version` or `helm version`)
3637
- DefectDojo version (see footer) or commit message: [use `git show -s --format="[%ci] %h: %s [%d]"`]
3738

3839
**Logs**

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,8 @@ localization:
6060
- any-glob-to-any-file:
6161
- dojo/locale/*
6262
- dojo/locale/**/*
63+
64+
lint:
65+
- changed-files:
66+
- any-glob-to-any-file:
67+
- ruff.toml

.github/release-drafter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ categories:
4141
label: 'ui'
4242
- title: '🗣 Updates in localization'
4343
label: 'localization'
44+
- title: '🔧 Improved code quality with linters'
45+
label: 'lint'
4446
- title: '🧰 Maintenance'
4547
collapse-after: 3
4648
labels:
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
11
name: "Build Docker Images For Testing"
22

33
on:
4+
# inspired by https://github.com/orgs/community/discussions/26801 we take the runs-on as parameter so we can run arm64 on native hardwarde
45
workflow_dispatch:
6+
inputs:
7+
runner:
8+
type: string
9+
default: "ubuntu-latest"
510
workflow_call:
11+
inputs:
12+
runner:
13+
type: string
14+
default: "ubuntu-latest"
615

716
jobs:
817
build:
9-
# build with docker so we can use layer caching
1018
name: Build Docker Images
11-
runs-on: ubuntu-latest
19+
runs-on: ${{ inputs.runner }}
1220
strategy:
1321
matrix:
22+
# integration tests are only build (and run) on debian x64
1423
docker-image: [django, nginx, integration-tests]
1524
os: [alpine, debian]
25+
runner: ["${{ inputs.runner }}"]
1626
exclude:
17-
- docker-image: integration-tests
18-
os: alpine
27+
- docker-image: integration-tests
28+
os: alpine
29+
- docker-image: integration-tests
30+
runner: ubuntu-24.04-arm
1931

2032
steps:
33+
- name: Show Platform
34+
run: echo Runner value for this run = ${{ inputs.runner }}
35+
2136
- name: Checkout
2237
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2338
with:
@@ -28,29 +43,26 @@ jobs:
2843
run: echo "IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
2944

3045
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
32-
with:
33-
buildkitd-flags: --debug
34-
driver-opts: image=moby/buildkit:master # needed to get the fix for https://github.com/moby/buildkit/issues/2426
35-
46+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
47+
3648
- name: Build
3749
id: docker_build
38-
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
39-
timeout-minutes: 10
50+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
51+
timeout-minutes: 15
4052
env:
4153
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
4254
with:
4355
context: .
4456
push: false
45-
tags: defectdojo/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }}
57+
tags: defectdojo/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }},${{ env.IMAGE_REPOSITORY }}/defectdojo-${{ matrix.docker-image }}:${{ matrix.os }}
4658
file: Dockerfile.${{ matrix.docker-image }}-${{ matrix.os }}
47-
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}_img
59+
outputs: type=docker,dest=${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}_img
4860

4961
# export docker images to be used in next jobs below
5062
- name: Upload image ${{ matrix.docker-image }} as artifact
51-
timeout-minutes: 10
52-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
63+
timeout-minutes: 15
64+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
5365
with:
54-
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}
55-
path: ${{ matrix.docker-image }}-${{ matrix.os }}_img
66+
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}
67+
path: ${{ matrix.docker-image }}-${{ matrix.os }}-${{ inputs.runner }}_img
5668
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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
54+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
5555
with:
5656
name: oas-${{ matrix.file-type }}
5757
path: oas.${{ matrix.file-type }}

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
node-version: '22.5.1'
2525

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

.github/workflows/integration-tests.yml

Lines changed: 5 additions & 5 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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
48+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
4949
with:
5050
path: built-docker-image
5151
pattern: built-docker-image-*
@@ -54,15 +54,15 @@ jobs:
5454
- name: Load docker images
5555
timeout-minutes: 10
5656
run: |-
57-
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
58-
docker load -i built-docker-image/django-${{ matrix.os }}_img
59-
docker load -i built-docker-image/integration-tests-debian_img
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
6060
docker images
6161
6262
- name: Set integration-test mode
6363
run: ln -s docker-compose.override.integration_tests.yml docker-compose.override.yml
6464

65-
- name: Start Dojo
65+
- name: Start Dojo
6666
run: docker compose up --no-deps -d postgres nginx celerybeat celeryworker mailhog uwsgi redis
6767
env:
6868
DJANGO_VERSION: ${{ matrix.os }}

.github/workflows/k8s-tests.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ jobs:
4848
minikube status
4949
5050
- name: Load images from artifacts
51-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
51+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
5252
with:
5353
path: built-docker-image
5454
pattern: built-docker-image-*
5555
merge-multiple: true
5656

5757
- name: Load docker images
58-
timeout-minutes: 10
58+
timeout-minutes: 15
5959
run: |-
6060
eval $(minikube docker-env)
61-
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
62-
docker load -i built-docker-image/django-${{ matrix.os }}_img
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
6363
docker images
6464
6565
- name: Configure HELM repos
@@ -85,6 +85,7 @@ jobs:
8585
./helm/defectdojo \
8686
--set django.ingress.enabled=true \
8787
--set imagePullPolicy=Never \
88+
--set initializer.keepSeconds="-1" \
8889
${{ env[matrix.databases] }} \
8990
${{ env[matrix.brokers] }} \
9091
--set createSecret=true \
@@ -124,10 +125,15 @@ jobs:
124125
RETRY=0
125126
while :
126127
do
128+
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
127129
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
128130
--overrides='{ "apiVersion": "v1" }' \
129-
--restart=Never -i --rm -- -s -m 20 -I --header "Host: $DD_HOSTNAME" http://`kubectl get service defectdojo-django -o json \
130-
| jq -r '.spec.clusterIP'`/login?next=/)
131+
--restart=Never -i --rm -- \
132+
--silent \
133+
--max-time 20 \
134+
--head \
135+
--header "Host: $DD_HOSTNAME" \
136+
http://$DJANGO_IP/login?next=/)
131137
echo $OUT
132138
CR=`echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
133139
echo $CR
@@ -148,6 +154,26 @@ jobs:
148154
break
149155
fi
150156
done
157+
ADMIN_PASS=$(kubectl get secret/defectdojo -o jsonpath='{.data.DD_ADMIN_PASSWORD}' | base64 -d)
158+
echo "Simple API check"
159+
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
160+
CR=$(kubectl run curl --quiet=true --image=curlimages/curl:7.73.0 \
161+
--overrides='{ "apiVersion": "v1" }' \
162+
--restart=Never -i --rm -- \
163+
--silent \
164+
--max-time 20 \
165+
--header "Host: $DD_HOSTNAME" \
166+
--data-raw "username=admin&password=$ADMIN_PASS" \
167+
--output /dev/null \
168+
--write-out "%{http_code}\n" \
169+
http://$DJANGO_IP/api/v2/api-token-auth/)
170+
echo $CR
171+
if [[ $CR -ne 200 ]]; then
172+
echo "ERROR: login is not possible; got HTTP code $CR"
173+
exit 1
174+
else
175+
echo "Result received"
176+
fi
151177
echo "Final Check of components"
152178
errors=`kubectl get pods | grep Error | awk '{print $1}'`
153179
if [[ ! -z $errors ]]; then

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Release-2: Tag, Release, Push"
33
env:
44
GIT_USERNAME: "DefectDojo release bot"
55
GIT_EMAIL: "dojo-release-bot@users.noreply.github.com"
6-
workflow_name: 'release 2 tag release docker push' # needed in cache key, which doesn't support comma's
6+
77
on:
88
workflow_dispatch:
99
inputs:
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
git tag -a ${{ github.event.inputs.release_number }} -m "[bot] release ${{ github.event.inputs.release_number }}"
3434
git push origin ${{ github.event.inputs.release_number }}
35-
35+
3636
release-helm-chart:
3737
needs: tag
3838
uses: ./.github/workflows/release-x-manual-helm-chart.yml

0 commit comments

Comments
 (0)