Skip to content

Commit

Permalink
Merge pull request #2785 from digitalfabrik/develop
Browse files Browse the repository at this point in the history
Release `2024.6.0`
  • Loading branch information
timobrembeck authored Jun 8, 2024
2 parents c44423f + f4acd5a commit 79f8e29
Show file tree
Hide file tree
Showing 168 changed files with 13,468 additions and 8,304 deletions.
33 changes: 15 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,6 @@ jobs:
- run:
name: Check formatting of Django templates
command: djlint --check --lint integreat_cms
isort:
docker:
- image: cimg/python:3.11.7
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Enable virtual environment
command: echo "source .venv/bin/activate" >> $BASH_ENV
- run:
name: Check isort code style
command: isort --check .
pylint:
docker:
- image: cimg/python:3.11.7
Expand Down Expand Up @@ -210,6 +196,17 @@ jobs:
- run:
name: Check formatting of CSS & JS files
command: npx prettier --check .
vitest:
docker:
- image: "cimg/node:lts"
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run frontend tests
command: npm run test
eslint:
docker:
- image: "cimg/node:lts"
Expand Down Expand Up @@ -467,7 +464,7 @@ jobs:
echo "Current production version: ${CURRENT_VERSION}"
# Bump version to current alpha version if it is newer
# Attention: exit(True) in Python means exit(1) which is False in Bash :)
if python -c "from looseversion import LooseVersion; exit(LooseVersion('${CURRENT_VERSION}') > LooseVersion('${CURRENT_ALPHA_VERSION}'))"; then
if python -c "from bumpver.version import parse_version; exit(parse_version('${CURRENT_VERSION}') > parse_version('${CURRENT_ALPHA_VERSION}'))"; then
echo "Bump to the currently existing version"
bumpver update -n --set-version="${CURRENT_ALPHA_VERSION}" --no-commit
fi
Expand Down Expand Up @@ -609,6 +606,9 @@ workflows:
- prettier:
requires:
- npm-install
- vitest:
requires:
- npm-install
- webpack:
requires:
- npm-install
Expand Down Expand Up @@ -673,9 +673,6 @@ workflows:
- djlint:
requires:
- pip-install
- isort:
requires:
- pip-install
- pylint:
requires:
- pip-install
Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:3.11

RUN apt-get update && \
apt-get install -y nodejs npm && \
npm install -g n && \
n stable && \
apt-get purge -y nodejs npm && \
ln -sf /usr/local/bin/node /usr/bin/node

RUN apt-get install -y netcat-traditional pcregrep

WORKDIR /workspace

CMD ["sleep", "infinity"]
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"batisteo.vscode-django",
"ms-vscode.vscode-typescript-next",
"ms-python.vscode-pylance"
],
"settings": {
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
}
},
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["tests"],
"ruff.enable": true,
"ruff.lint.args": ["--config=${workspaceFolder}/pyproject.toml", "--fix"],
"ruff.format.args": ["--config=${workspaceFolder}/pyproject.toml", "--preview"],
"python.defaultInterpreterPath": "{workspaceFolder}/.venv/bin/python"
}
}
},
"postCreateCommand": "./tools/install.sh --python python3.11 && ./tools/migrate.sh && ./tools/loadtestdata.sh",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"remoteEnv": {
"DJANGO_SETTINGS_MODULE": "integreat_cms.core.settings",
"INTEGREAT_CMS_DEBUG": "1",
"INTEGREAT_CMS_DEEPL_AUTH_KEY": "dummy",
"INTEGREAT_CMS_FCM_KEY": "dummy",
"INTEGREAT_CMS_SECRET_KEY": "dummy",
"INTEGREAT_CMS_BACKGROUND_TASKS_ENABLED": "0",
"INTEGREAT_CMS_SUMM_AI_API_KEY": "dummy",
"INTEGREAT_CMS_LINKCHECK_DISABLE_LISTENERS": "1"
}
}
26 changes: 26 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.8"

services:
devcontainer:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace:cached
network_mode: service:db
depends_on:
- db

db:
container_name: integreat_django_postgres
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: integreat
POSTGRES_DB: integreat
POSTGRES_PASSWORD: password

volumes:
postgres-data:
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
const path = require("path");

module.exports = {
env: {
es6: true,
browser: true,
},
settings: {
"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
typescript: {
project: "./tsconfig.json",
},
alias: {
map: [["~", path.resolve(__dirname, "./src")]],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
},
},
ignorePatterns: [
"**/dist/",
"**/htmlcov/**",
Expand Down
5 changes: 0 additions & 5 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Bug report \U0001F41B"
about: Create a report to help us improve
labels: bug
labels: ':bug: bug'

---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Feature request \U0001F4A1"
about: Suggest an idea for this project
labels: feature
labels: ':bulb: feature'

---

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ docs/src/templates/footer.html*
docs/src/templates/breadcrumbs.html*

# Miscellaneous
.vscode
.idea
.directory
cms-django.iml
Expand Down
28 changes: 16 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
Expand All @@ -17,20 +17,16 @@ repos:
- id: no-commit-to-branch
args: [--branch, main, --branch, develop]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.7
hooks:
- id: ruff
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [--external-sources]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/Riverside-Healthcare/djLint
Expand All @@ -39,15 +35,15 @@ repos:
- id: djlint-django
args: [--reformat, --lint]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.0.0-alpha.2
rev: v8.56.0
hooks:
- id: eslint
files: \.[jt]sx?$
args: [--fix]
types: [file]
additional_dependencies:
- eslint@8.56.0
- "@typescript-eslint/[email protected].0"
- eslint@8.57.0
- "typescript-eslint@7.11.0"
- "[email protected]"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
Expand All @@ -64,8 +60,16 @@ repos:
types_or: [python, html]
language: script
pass_filenames: false
- repo: local
hooks:
- id: frontend-tests
name: frontend-tests
description: Run frontend tests
entry: tools/vitest.sh
language: script
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: [types-python-dateutil, types-PyYAML, types-requests]
96 changes: 96 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Shell Script",
"type": "shell",
"command": "sh",
"args": ["${file}"],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Run all frontend tests",
"type": "shell",
"command": "npm run test",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Check code style",
"type": "shell",
"command": "./tools/code_style.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run prettier tool",
"type": "shell",
"command": "./tools/prettier.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run mypy tool",
"type": "shell",
"command": "./tools/prettier.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run ruff tool",
"type": "shell",
"command": "./tools/ruff.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run eslint tool",
"type": "shell",
"command": "./tools/eslint.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run devserver",
"type": "shell",
"command": "./tools/run.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run translation check",
"type": "shell",
"command": "./tools/check_translations.sh",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
Loading

0 comments on commit 79f8e29

Please sign in to comment.