Skip to content

Commit

Permalink
Merge pull request #11664 from DefectDojo/release/2.42.3
Browse files Browse the repository at this point in the history
Release: Merge release into master from: release/2.42.3
  • Loading branch information
rossops authored Jan 27, 2025
2 parents 250b993 + 1645e04 commit 72ac386
Show file tree
Hide file tree
Showing 63 changed files with 73,641 additions and 51,449 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/update-sample-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Update Sample Data

env:
GIT_USERNAME: "DefectDojo release bot"
GIT_EMAIL: "[email protected]"

on:
workflow_dispatch: # Trigger manually
schedule:
# Run on the 1st day of January, April, July, and October at midnight UTC
- cron: '0 0 1 1,4,7,10 *'

jobs:
run-binary-and-create-pr:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name || 'dev'}}

- name: Run binary
run: |
./fixture-updater dojo/fixtures/defect_dojo_sample_data.json
mv output.json dojo/fixtures/defect_dojo_sample_data.json
- name: Configure git
run: |
git config --global user.name "${{ env.GIT_USERNAME }}"
git config --global user.email "${{ env.GIT_EMAIL }}"
- name: Create and switch to a new branch
run: |
git checkout -b update-file-$(date +%Y%m%d%H%M%S)
git add dojo/fixtures/defect_dojo_sample_data.json
git commit -m "Update sample data"
- name: Push branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update sample data"
branch: ${{ github.ref_name || 'dev'}}
base: dev
title: "Update sample data"
body: "This pull request updates the sample data."
2 changes: 1 addition & 1 deletion components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "defectdojo",
"version": "2.42.2",
"version": "2.42.3",
"license" : "BSD-3-Clause",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion dojo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # noqa: F401

__version__ = "2.42.2"
__version__ = "2.42.3"
__url__ = "https://github.com/DefectDojo/django-DefectDojo"
__docs__ = "https://documentation.defectdojo.com"
8 changes: 6 additions & 2 deletions dojo/api_v2/prefetch/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class PrefetchListMixin(ListModelMixin):
def list(self, request, *args, **kwargs):
prefetch_params = request.GET.get("prefetch", "").split(",")
prefetch_params = request.GET.get("prefetch", "")
prefetch_params = prefetch_params.split(",") if "," in prefetch_params else request.GET.getlist("prefetch")

prefetcher = _Prefetcher()

# Apply the same operations as the standard list method defined in the
Expand All @@ -30,7 +32,9 @@ def list(self, request, *args, **kwargs):

class PrefetchRetrieveMixin(RetrieveModelMixin):
def retrieve(self, request, *args, **kwargs):
prefetch_params = request.GET.get("prefetch", "").split(",")
prefetch_params = request.GET.get("prefetch", "")
prefetch_params = prefetch_params.split(",") if "," in prefetch_params else request.GET.getlist("prefetch")

prefetcher = _Prefetcher()

entry = self.get_object()
Expand Down
8 changes: 0 additions & 8 deletions dojo/components/sql_group_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ def __init__(
**extra,
)

def as_mysql(self, compiler, connection):
return super().as_sql(
compiler,
connection,
template="%(function)s(%(distinct)s%(expressions)s%(ordering)s%(separator)s)",
separator=f" SEPARATOR '{self.separator}'",
)

def as_sql(self, compiler, connection, **extra):
return super().as_sql(
compiler,
Expand Down
Loading

0 comments on commit 72ac386

Please sign in to comment.