Skip to content

Commit b47805e

Browse files
Merge branch 'dev' into reimport_fix_available
2 parents c94b6e6 + 3081970 commit b47805e

File tree

286 files changed

+9186
-3234
lines changed

Some content is hidden

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

286 files changed

+9186
-3234
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This checklist is for your information.
2626
- [ ] Bugfixes should be submitted against the `bugfix` branch.
2727
- [ ] Give a meaningful name to your PR, as it may end up being used in the release notes.
2828
- [ ] Your code is flake8 compliant.
29-
- [ ] Your code is python 3.11 compliant.
29+
- [ ] Your code is python 3.12 compliant.
3030
- [ ] If this is a new feature and not a bug fix, you've included the proper documentation in the docs at https://github.com/DefectDojo/django-DefectDojo/tree/dev/docs as part of this PR.
3131
- [ ] Model changes must include the necessary migrations in the dojo/db_migrations folder.
3232
- [ ] Add applicable tests to the unit tests.

.github/workflows/close-stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Close stale issues and PRs
19-
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
19+
uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
2020
with:
2121
# Disable automatic stale marking - only close manually labeled items
2222
days-before-stale: -1

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
- name: Setup Hugo
1616
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
1717
with:
18-
hugo-version: '0.125.3'
18+
hugo-version: '0.140.1'
1919
extended: true
2020

2121
- name: Setup Node
22-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
22+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2323
with:
24-
node-version: '22.18.0'
24+
node-version: '22.20.0'
2525

2626
- name: Cache dependencies
27-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
27+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2828
with:
2929
path: ~/.npm
3030
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/k8s-tests.yml

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# are tested (https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#available-versions)
2828
- databases: pgsql
2929
brokers: redis
30-
k8s: 'v1.33.4'
30+
k8s: 'v1.34.0'
3131
os: debian
3232
steps:
3333
- name: Checkout
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Minikube
3737
uses: manusa/actions-setup-minikube@b589f2d61bf96695c546929c72b38563e856059d # v2.14.0
3838
with:
39-
minikube version: 'v1.33.1'
39+
minikube version: 'v1.37.0'
4040
kubernetes version: ${{ matrix.k8s }}
4141
driver: docker
4242
start args: '--addons=ingress --cni calico'
@@ -65,7 +65,6 @@ jobs:
6565
6666
- name: Configure HELM repos
6767
run: |-
68-
helm repo add bitnami https://charts.bitnami.com/bitnami
6968
helm dependency list ./helm/defectdojo
7069
helm dependency update ./helm/defectdojo
7170
@@ -109,43 +108,46 @@ jobs:
109108
echo "INFO: status:"
110109
kubectl get pods
111110
echo "INFO: logs:"
112-
kubectl logs --selector=$3 --all-containers=true
111+
kubectl logs --selector=$3 --all-containers=true
113112
exit 1
114113
fi
115114
return ${?}
116115
}
117116
echo "Waiting for init job..."
118-
to_complete "condition=Complete" job "defectdojo.org/component=initializer"
117+
to_complete "condition=Complete" job "defectdojo.org/component=initializer"
119118
echo "Waiting for celery pods..."
120-
to_complete "condition=ready" pod "defectdojo.org/component=celery"
119+
to_complete "condition=ready" pod "defectdojo.org/component=celery"
121120
echo "Waiting for django pod..."
122-
to_complete "condition=ready" pod "defectdojo.org/component=django"
121+
to_complete "condition=ready" pod "defectdojo.org/component=django"
123122
echo "Pods up and ready to rumbole"
124123
kubectl get pods
124+
125+
- name: Test login page
126+
timeout-minutes: 10
127+
run: |-
125128
RETRY=0
126129
while :
127130
do
128131
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
129132
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:8.15.0 \
130-
--overrides='{ "apiVersion": "v1" }' \
131133
--restart=Never -i --rm -- \
132134
--silent \
133135
--max-time 20 \
134136
--head \
135137
--header "Host: $DD_HOSTNAME" \
136-
http://$DJANGO_IP/login?next=/)
138+
"http://${DJANGO_IP}/login?next=/")
137139
echo $OUT
138-
CR=`echo $OUT | egrep "^HTTP" | cut -d' ' -f2`
140+
CR=$(echo $OUT | egrep "^HTTP" | cut -d' ' -f2)
139141
echo $CR
140142
if [[ $CR -ne 200 ]]; then
141143
echo $RETRY
142144
if [[ $RETRY -gt 2 ]]; then
143145
kubectl get pods
144-
echo `kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi`
146+
echo $(kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi)
145147
echo "ERROR: cannot display login screen; got HTTP code $CR"
146148
exit 1
147149
else
148-
((RETRY++))
150+
RETRY=$((RETRY+1))
149151
echo "Attempt $RETRY to get login page"
150152
sleep 5
151153
fi
@@ -154,29 +156,51 @@ jobs:
154156
break
155157
fi
156158
done
159+
160+
- name: Test API auth call
161+
timeout-minutes: 10
162+
run: |-
157163
ADMIN_PASS=$(kubectl get secret/defectdojo -o jsonpath='{.data.DD_ADMIN_PASSWORD}' | base64 -d)
158164
echo "Simple API check"
159165
DJANGO_IP=$(kubectl get svc defectdojo-django -o jsonpath='{.spec.clusterIP}')
160-
CR=$(kubectl run curl --quiet=true --image=curlimages/curl:8.15.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
166+
RETRY=0
167+
while :
168+
do
169+
OUT=$(kubectl run curl --quiet=true --image=curlimages/curl:8.15.0 \
170+
--restart=Never -i --rm -- \
171+
--dump-header - \
172+
--no-progress-meter \
173+
--max-time 20 \
174+
--header "Host: $DD_HOSTNAME" \
175+
--data-raw "username=admin&password=$ADMIN_PASS" \
176+
"http://${DJANGO_IP}/api/v2/api-token-auth/")
177+
CR=$(echo $OUT | egrep "^HTTP" | cut -d' ' -f2)
178+
echo "Return code $CR"
179+
if [[ $CR -ne 200 ]]; then
180+
echo "Retry: $RETRY"
181+
if [[ $RETRY -gt 2 ]]; then
182+
kubectl get pods
183+
echo $(kubectl logs --tail=30 -l defectdojo.org/component=django -c uwsgi)
184+
echo "ERROR: cannot perform API login; got HTTP code $CR; Full response:"
185+
echo $OUT
186+
exit 1
187+
else
188+
RETRY=$((RETRY+1))
189+
echo "Attempt $RETRY to perform API login"
190+
sleep 5
191+
fi
192+
else
193+
echo "Result received"
194+
break
195+
fi
196+
done
197+
198+
- name: Check of logs
199+
timeout-minutes: 10
200+
run: |-
177201
echo "Final Check of components"
178-
errors=`kubectl get pods | grep Error | awk '{print $1}'`
179-
if [[ ! -z $errors ]]; then
202+
errors=$(kubectl get pods | grep Error | awk '{print $1}')
203+
if [[ ! -z $errors ]]; then
180204
echo "Few pods with errors"
181205
for line in $errors; do
182206
echo "Dumping log from $line"
@@ -186,3 +210,11 @@ jobs:
186210
else
187211
echo "DD K8S successfully deployed"
188212
fi
213+
214+
- name: Failed Logs
215+
if: failure()
216+
run: |-
217+
echo "ERROR: Here are logs from deployment/defectdojo-django containers:"
218+
kubectl logs deployment/defectdojo-django --all-pods=true --all-containers=true --tail=100
219+
echo "And all pod status one more time"
220+
kubectl get pods

.github/workflows/pr-labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: "Autolabeler"
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
18+
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
1919
with:
2020
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2121
sync-labels: true

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,23 @@ jobs:
8080
sed -ri "0,/version/s/version: \S+/$NEW_CHART_VERSION/" helm/defectdojo/Chart.yaml
8181
fi
8282
83+
- name: Update values in HELM chart
84+
run: |
85+
yq -i '.annotations."artifacthub.io/prerelease" = "false"' helm/defectdojo/Chart.yaml
86+
yq -i '.annotations."artifacthub.io/changes" += "- kind: changed\n description: Bump DefectDojo to ${{ inputs.release_number }}\n"' helm/defectdojo/Chart.yaml
87+
8388
- name: Check version numbers
8489
run: |
8590
grep -H version dojo/__init__.py
8691
grep -H version components/package.json
8792
grep -H appVersion helm/defectdojo/Chart.yaml
8893
grep -H version helm/defectdojo/Chart.yaml
8994
95+
- name: Run helm-docs
96+
uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
97+
with:
98+
chart-search-root: "helm/defectdojo"
99+
90100
- name: Push version changes
91101
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
92102
with:
@@ -97,7 +107,7 @@ jobs:
97107
branch: ${{ env.NEW_BRANCH }}
98108

99109
- name: Create Pull Request
100-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
110+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
101111
with:
102112
github-token: ${{ secrets.GITHUB_TOKEN }}
103113
script: |

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ jobs:
7474
git add docs/content/en/open_source/upgrading/$minorv.md
7575
if: endsWith(inputs.release_number_new, '.0') && endsWith(inputs.release_number_dev, '.0-dev')
7676

77+
- name: Update values in HELM chart
78+
run: |
79+
yq -i '.annotations = {}' helm/defectdojo/Chart.yaml
80+
yq -i '.annotations."artifacthub.io/prerelease" = "true"' helm/defectdojo/Chart.yaml
81+
yq -i '.annotations."artifacthub.io/changes" = ""' helm/defectdojo/Chart.yaml
82+
83+
- name: Run helm-docs
84+
uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
85+
with:
86+
chart-search-root: "helm/defectdojo"
87+
7788
- name: Push version changes
7889
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
7990
with:
@@ -84,7 +95,7 @@ jobs:
8495
branch: ${{ env.NEW_BRANCH }}
8596

8697
- name: Create Pull Request
87-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
98+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
8899
with:
89100
github-token: ${{ secrets.GITHUB_TOKEN }}
90101
script: |
@@ -139,6 +150,17 @@ jobs:
139150
grep appVersion helm/defectdojo/Chart.yaml
140151
grep version components/package.json
141152
153+
- name: Update values in HELM chart
154+
run: |
155+
yq -i '.annotations = {}' helm/defectdojo/Chart.yaml
156+
yq -i '.annotations."artifacthub.io/prerelease" = "true"' helm/defectdojo/Chart.yaml
157+
yq -i '.annotations."artifacthub.io/changes" = ""' helm/defectdojo/Chart.yaml
158+
159+
- name: Run helm-docs
160+
uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
161+
with:
162+
chart-search-root: "helm/defectdojo"
163+
142164
- name: Push version changes
143165
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
144166
with:
@@ -149,7 +171,7 @@ jobs:
149171
branch: ${{ env.NEW_BRANCH }}
150172

151173
- name: Create Pull Request
152-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
174+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
153175
with:
154176
github-token: ${{ secrets.GITHUB_TOKEN }}
155177
script: |

.github/workflows/release-x-manual-docker-containers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: echo "DOCKER_ORG=$(echo ${GITHUB_REPOSITORY%%/*} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
5353

5454
- name: Login to DockerHub
55-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
55+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
5656
with:
5757
username: ${{ secrets.DOCKERHUB_USERNAME }}
5858
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/release-x-manual-helm-chart.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ jobs:
6666

6767
- name: Configure HELM repos
6868
run: |-
69-
helm repo add bitnami https://charts.bitnami.com/bitnami
7069
helm dependency list ./helm/defectdojo
7170
helm dependency update ./helm/defectdojo
7271
7372
- name: Add yq
74-
uses: mikefarah/yq@f03c9dc599c37bfcaf533427211d05e51e6fee64 # v4.47.1
73+
uses: mikefarah/yq@6251e95af8df3505def48c71f3119836701495d6 # v4.47.2
7574

7675
- name: Pin version docker version
7776
id: pin_image
@@ -88,7 +87,7 @@ jobs:
8887
echo "chart_version=$(ls build | cut -d '-' -f 2,3 | sed 's|\.tgz||')" >> $GITHUB_ENV
8988
9089
- name: Create release ${{ inputs.release_number }}
91-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
90+
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
9291
with:
9392
name: '${{ inputs.release_number }} 🌈'
9493
tag_name: ${{ inputs.release_number }}

.github/workflows/release-x-manual-merge-container-digests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
merge-multiple: true
4949

5050
- name: Login to DockerHub
51-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
51+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
5252
with:
5353
username: ${{ secrets.DOCKERHUB_USERNAME }}
5454
password: ${{ secrets.DOCKERHUB_TOKEN }}

0 commit comments

Comments
 (0)