-
Notifications
You must be signed in to change notification settings - Fork 524
Mapping Loi 05-20 ↔ ISO/IEC 27001:2022 #2819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ab814c8
4ba2b60
355ff10
bd8a7e9
a2583c4
0833b9c
48ca9c0
79072b7
51c53f1
a09e526
ecfe82b
677cf6a
b2bd004
873e064
7ef0832
50d6b43
067575f
5b0e6fa
4a66714
c775968
127f1c9
5dc2620
ca2b4d8
b8cd83a
2f3b693
24cb967
4affdec
67a3287
a3befc3
90b923f
c65c877
2e307b4
cf00d7d
cc6dfa5
3dc1d84
90d2d8f
ba3cdb6
fc4bb86
3f9201d
863ce60
2603ab7
590eb51
e3bdd8c
4b7d5d2
1000f89
4b7e5bd
4d49cf8
b4cd6ad
5c21be5
0f37f5c
5feeeb0
4a3a2fb
1af2a58
37dadf3
0c5812d
cb7c6f2
edfbc87
1a3093f
120596b
6121c22
da01a30
d8f1e13
d0ccdde
05d0b8d
ae6d5a8
9f33697
5f3942f
fb150f6
a373fef
4238e0f
9906654
435ea91
8301cd9
8f64a1f
eaf175e
4dbe879
ab605c3
d7e1948
d1416f8
7d6bea3
86b3a87
c6ffcd6
6c9229e
8cccab1
1bafaec
ab97e07
dff178c
b1a4df9
a3c01db
2574487
6641b21
f7477ea
de9e21e
17cdee2
7c8ed3b
68e65b4
cb46a23
3712185
682daac
12cffc0
bc2f9a5
3f16a53
d487d2e
eb5ac43
c52fb0b
6d35b29
747e965
1fd9902
3288ac1
df8b758
4b59814
32e2f4e
670be9f
c2bc28b
1d47630
b5ca4c7
ca209d5
8e4ea59
1182436
4e3ca74
1edbaf0
049f83f
351b98f
ae089eb
9823770
f11371c
b2760bf
dc095b3
72cd9da
77e3cd9
e97d49a
1468aa4
f461258
d16acfb
27761a3
ef63e51
10ece5b
93dab82
db55940
c5fb71b
8c80046
6d86023
0defb38
d07e9cd
fa59dbf
e1d9807
f64220c
1ac048e
d67956b
d590179
3077d1a
6ec88c7
ec8b5d0
1d69b53
3eea302
8652818
d13fe25
f94facf
a2602dc
20be244
9753e73
94da01b
b13b6e1
5ce9b0d
ff4a69a
18491e1
9b9c349
6db2bb5
3b8709c
e2cb70b
810b92a
d9cbf97
4a9cf29
4580897
29fa344
7a0f8f6
780a765
9b74963
79c4ea1
eba051b
959f097
c140e1f
5353ebc
ad577ad
72ccfec
6c62550
3dc15d9
0e7df2a
3dc50a1
4a0463e
9380fa7
25269f7
eb2c294
cf49b40
59a651b
5d0a017
2e33291
4f87b0d
b9b60ec
2f1badb
7acf337
57177b7
604b405
2b78b69
4e1e6bf
dfe1d58
6990f18
14454ae
fe8dc70
c01d2e9
6b0fb66
3504e24
362f633
7f732ac
c681577
1b42c1e
834dcad
f5bb029
0babd1b
5016c7b
b8713c9
1ec5a30
9383b2f
adcb8d3
60f7e9c
20b2c96
8e2fd1f
4d4670a
ee4e812
1130357
5af0a26
e2e4b9c
9dd846b
625e07b
10c950f
bb7c019
73570ee
4a867cf
f02055e
5333e14
e752c7d
d37a5c1
b3c334d
8f8edf1
64d591a
255af83
cb71785
9933fdc
3b77b6b
0fc90e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| *.pyc | ||
| *.DS_Store | ||
| *~$* | ||
| **/*.mo | ||
| .git* | ||
| .pytest* | ||
| .idea* | ||
| venv/ | ||
| env/ | ||
| **/node_modules/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "rules": { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "args": "all", | ||
| "argsIgnorePattern": "^_", | ||
| "caughtErrors": "all", | ||
| "caughtErrorsIgnorePattern": "^_", | ||
| "destructuredArrayIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_", | ||
| "ignoreRestSiblings": true | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Feature Request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| about: Suggestions for new features and improvements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: "question" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assignees: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Problem statement** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| I want to be able to do X, but the current implementation only allows for Y. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Expected behavior** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. Go to '...' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. Click on '....' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. Scroll down to '....' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. See error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Mock** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If applicable, add screenshots to help explain the expectation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Additional context** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Add any other context about the problem here. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use markdown headings instead of bold emphasis for section headers. Lines 9, 12, 19, and 22 use bold emphasis ( Apply this diff to use proper markdown headings: -**Problem statement**
+## Problem statement
I want to be able to do X, but the current implementation only allows for Y.
-**Expected behavior**
+## Expected behavior
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-**Mock**
+## Mock
If applicable, add screenshots to help explain the expectation.
-**Additional context**
+## Additional context
Add any other context about the problem here.This aligns with Markdown best practices (MD036 from markdownlint). 📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)12-12: Emphasis used instead of a heading (MD036, no-emphasis-as-heading) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||||||||||||||||||||||||||||
| name: API Tests | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| branches: [main, develop] | ||||||||||||||||||||||||||||||||||
| types: [opened, synchronize] | ||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||
| - "backend/**" | ||||||||||||||||||||||||||||||||||
| - ".github/workflows/backend-api-tests.yml" | ||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix workflow trigger syntax error. The Apply this diff: on:
pull_request:
branches: [main, develop]
types: [opened, synchronize]
paths:
- "backend/**"
- ".github/workflows/backend-api-tests.yml"
+ workflow_dispatch:
- workflow_dispatch:📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.8)10-10: unexpected key "workflow_dispatch" for "pull_request" section. expected one of "branches", "branches-ignore", "paths", "paths-ignore", "tags", "tags-ignore", "types", "workflows" (syntax-check) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||
| GITHUB_WORKFLOW: github_actions | ||||||||||||||||||||||||||||||||||
| PYTHON_VERSION: "3.12" | ||||||||||||||||||||||||||||||||||
| UBUNTU_VERSION: "ubuntu-24.04" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||
| backend-directory: ./backend | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||
| max-parallel: 4 | ||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||
| python-version: ["3.12"] | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||
| - name: Set up python ${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| python-version: ${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||
| cache: "pip" | ||||||||||||||||||||||||||||||||||
| - name: Install Poetry | ||||||||||||||||||||||||||||||||||
| uses: snok/install-poetry@v1 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| virtualenvs-create: false | ||||||||||||||||||||||||||||||||||
| installer-parallel: true | ||||||||||||||||||||||||||||||||||
| - name: Install backend requirements | ||||||||||||||||||||||||||||||||||
| working-directory: ${{ env.backend-directory }} | ||||||||||||||||||||||||||||||||||
| run: poetry install | ||||||||||||||||||||||||||||||||||
| - name: Create environment variables file | ||||||||||||||||||||||||||||||||||
| working-directory: ${{env.backend-directory}} | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| touch .env | ||||||||||||||||||||||||||||||||||
| echo DJANGO_DEBUG='True' >> .env | ||||||||||||||||||||||||||||||||||
| echo DB_HOST=localhost >> .env | ||||||||||||||||||||||||||||||||||
| echo EMAIL_HOST=localhost >> .env | ||||||||||||||||||||||||||||||||||
| echo EMAIL_PORT=1025 >> .env | ||||||||||||||||||||||||||||||||||
| echo EMAIL_HOST_USER='' >> .env | ||||||||||||||||||||||||||||||||||
| echo EMAIL_HOST_PASSWORD='' >> .env | ||||||||||||||||||||||||||||||||||
| #echo EMAIL_USE_TLS=False >> .env | ||||||||||||||||||||||||||||||||||
| echo DEFAULT_FROM_EMAIL='ciso-assistant@alsigo.net' >> .env | ||||||||||||||||||||||||||||||||||
| echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env | ||||||||||||||||||||||||||||||||||
| echo CISO_ASSISTANT_URL=http://127.0.0.1:5173 >> .env | ||||||||||||||||||||||||||||||||||
| - name: Run migrations | ||||||||||||||||||||||||||||||||||
| working-directory: ${{env.backend-directory}} | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| export $(grep -v '^#' .env | xargs) | ||||||||||||||||||||||||||||||||||
| poetry run python manage.py migrate | ||||||||||||||||||||||||||||||||||
| - name: Run API tests | ||||||||||||||||||||||||||||||||||
| working-directory: ${{env.backend-directory}} | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| export $(grep -v '^#' .env | xargs) | ||||||||||||||||||||||||||||||||||
| poetry run pytest app_tests/api --html=pytest-report.html --self-contained-html | ||||||||||||||||||||||||||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| name: api-tests-report | ||||||||||||||||||||||||||||||||||
| path: ${{ env.backend-directory }}/pytest-report.html | ||||||||||||||||||||||||||||||||||
| retention-days: 5 | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: Backend code coverage | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["main"] | ||
| paths: | ||
| - "backend/**" | ||
|
|
||
| env: | ||
| GITHUB_WORKFLOW: github_actions | ||
| POSTGRES_VERSION: "16" | ||
| UBUNTU_VERSION: "ubuntu-24.04" | ||
| PYTHON_VERSION: "3.12" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-24.04 | ||
| env: | ||
| backend-directory: ./backend | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres # test credential | ||
| POSTGRES_DB: postgres | ||
| ports: ["5432:5432"] | ||
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
|
||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: ["3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create: false | ||
| installer-parallel: true | ||
| - name: Install backend requirements | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: poetry install | ||
| - name: Create environment variables file | ||
| working-directory: ${{env.backend-directory}} | ||
| run: | | ||
| touch .env | ||
| echo DJANGO_DEBUG='True' >> .env | ||
| echo POSTGRES_NAME=postgres >> .env | ||
| echo POSTGRES_USER=postgres >> .env | ||
| echo POSTGRES_PASSWORD=postgres >> .env | ||
| echo DB_HOST=localhost >> .env | ||
| echo EMAIL_HOST=localhost >> .env | ||
| echo EMAIL_PORT=1025 >> .env | ||
| echo EMAIL_HOST_USER='' >> .env | ||
| echo EMAIL_HOST_PASSWORD='' >> .env | ||
| #echo EMAIL_USE_TLS=False >> .env | ||
| echo DEFAULT_FROM_EMAIL='ciso-assistant@alsigo.net' >> .env | ||
| echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env | ||
| echo CISO_ASSISTANT_URL=http://127.0.0.1:5173 >> .env | ||
| - name: Run migrations | ||
| working-directory: ${{env.backend-directory}} | ||
| run: | | ||
| export $(grep -v '^#' .env | xargs) | ||
| poetry run python manage.py migrate | ||
| - name: Run coverage | ||
| working-directory: ${{env.backend-directory}} | ||
| env: | ||
| DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix DATABASE_URL port access syntax. The expression Apply this diff: - DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres"
+ DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/postgres"Apply the same fix on line 83. Also applies to: 83-83 🧰 Tools🪛 actionlint (1.7.8)76-76: property access of object must be type of string but got "number" (expression) 🪛 Checkov (3.2.334)[medium] 76-77: Basic Auth Credentials (CKV_SECRET_4) 🤖 Prompt for AI Agents |
||
| run: | | ||
| export $(grep -v '^#' .env | xargs) | ||
| find . -path '*/tests/*' -and -name 'test*.py' -and -not -path "./venv/*" | xargs coverage run -m pytest | ||
| - name: Display coverage report | ||
| working-directory: ${{env.backend-directory}} | ||
| env: | ||
| DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres" | ||
| run: coverage report | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||||||||||||||||||||||||||||||||||
| name: Backend Linters | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||
| - "backend/**" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||
| GITHUB_WORKFLOW: github_actions | ||||||||||||||||||||||||||||||||||||||
| PYTHON_VERSION: "3.12" | ||||||||||||||||||||||||||||||||||||||
| UBUNTU_VERSION: "ubuntu-24.04" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||
| ruff: | ||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||
| working-directory: ./backend | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||
| max-parallel: 4 | ||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||
| python-version: ["3.12"] | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||
| - name: Set up python ${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| python-version: ${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||||||
| cache: "pip" | ||||||||||||||||||||||||||||||||||||||
| - name: Install ruff | ||||||||||||||||||||||||||||||||||||||
| working-directory: ${{env.working-directory}} | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| python -m pip install ruff==0.9.2 | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bump
Use this change: - - name: Set up python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ - name: Set up python ${{ matrix.python-version }}
+ uses: actions/setup-python@v6📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.8)27-27: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| - name: Run ruff format check | ||||||||||||||||||||||||||||||||||||||
| working-directory: ${{env.working-directory}} | ||||||||||||||||||||||||||||||||||||||
| run: ruff format --check . | ||||||||||||||||||||||||||||||||||||||
| # NOTE: The following will be uncommented once the codebase is cleaned up | ||||||||||||||||||||||||||||||||||||||
| # - name: ruff | ||||||||||||||||||||||||||||||||||||||
| # working-directory: ${{env.working-directory}} | ||||||||||||||||||||||||||||||||||||||
| # run: ruff check . | ||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: Backend migrations check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, develop] | ||
| types: [opened, synchronize] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| GITHUB_WORKFLOW: github_actions | ||
| backend-directory: ./backend | ||
| enterprise-backend-directory: ./enterprise/backend | ||
| enterprise-backend-settings-module: enterprise_core.settings | ||
| UBUNTU_VERSION: "ubuntu-24.04" | ||
| PYTHON_VERSION: "3.12" | ||
|
|
||
| jobs: | ||
| migrations-check: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: ["3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create: false | ||
| installer-parallel: true | ||
| - name: Install backend requirements | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: poetry install | ||
| - name: Create backend environment variables file | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: | | ||
| touch .env | ||
| echo DJANGO_DEBUG=True >> .env | ||
| echo DJANGO_SUPERUSER_EMAIL=admin@tests.com >> .env | ||
| echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env | ||
| echo DB_HOST=localhost >> .env | ||
| echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env | ||
| echo CISO_ASSISTANT_URL=http://localhost:4173 >> .env | ||
| echo DEFAULT_FROM_EMAIL='ciso-assistant@tests.net' >> .env | ||
| echo EMAIL_HOST=localhost >> .env | ||
| echo EMAIL_HOST_USER=user@tests.com >> .env | ||
| echo EMAIL_HOST_PASSWORD=password >> .env | ||
| echo EMAIL_PORT=1025 >> .env | ||
| - name: Check that migrations were made | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: | | ||
| export $(grep -v '^#' .env | xargs) | ||
| poetry run python manage.py makemigrations --check --dry-run --verbosity=3 | ||
|
|
||
| enterprise-migrations-check: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: ["3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create: false | ||
| installer-parallel: true | ||
| - name: Install backend requirements | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: poetry install | ||
| - name: Install enterprise backend | ||
| working-directory: ${{ env.enterprise-backend-directory }} | ||
| run: poetry install | ||
| - name: Create backend environment variables file | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: | | ||
| touch .env | ||
| echo DJANGO_DEBUG=True >> .env | ||
| echo DJANGO_SUPERUSER_EMAIL=admin@tests.com >> .env | ||
| echo DJANGO_SUPERUSER_PASSWORD=1234 >> .env | ||
| echo DB_HOST=localhost >> .env | ||
| echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env | ||
| echo CISO_ASSISTANT_URL=http://localhost:4173 >> .env | ||
| echo DEFAULT_FROM_EMAIL='ciso-assistant@tests.net' >> .env | ||
| echo EMAIL_HOST=localhost >> .env | ||
| echo EMAIL_HOST_USER=user@tests.com >> .env | ||
| echo EMAIL_HOST_PASSWORD=password >> .env | ||
| echo EMAIL_PORT=1025 >> .env | ||
| echo DJANGO_SETTINGS_MODULE=enterprise_core.settings >> .env | ||
| echo LICENSE_SEATS=999 >> .env | ||
| - name: Check that migrations were made | ||
| working-directory: ${{ env.backend-directory }} | ||
| run: | | ||
| export $(grep -v '^#' .env | xargs) | ||
| poetry run python manage.py makemigrations --check --dry-run --verbosity=3 --settings=${{ env.enterprise-backend-settings-module }} | ||
| if [ $? -ne 0 ]; then echo "::error Migrations were not made, please run the makemigrations command." && exit 1; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Invalid file format - JSON content in .js file.
The file has a
.jsextension but contains pure JSON syntax, which is invalid JavaScript. ESLint will fail to load this configuration file.Two solutions:
.eslintrc.json(simpler):The Biome static analysis errors confirm this issue.
Additional concern: The PR objectives describe adding a YAML mapping file for Loi 05-20 ↔ ISO/IEC 27001:2022 compliance, but this file is an ESLint configuration. Please verify this is the intended file for this PR.
🧰 Tools
🪛 Biome (2.1.2)
[error] 2-2: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 3-3: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 6-6: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 14-14: Expected a statement but instead found ']'.
Expected a statement here.
(parse)
🤖 Prompt for AI Agents