Skip to content

Commit

Permalink
Merge pull request #2504 from ohcnetwork/staging
Browse files Browse the repository at this point in the history
Production Release v24.40.0
  • Loading branch information
gigincg authored Oct 3, 2024
2 parents 6560998 + d6e4aa0 commit 597f3ce
Show file tree
Hide file tree
Showing 304 changed files with 6,284 additions and 7,528 deletions.
14 changes: 0 additions & 14 deletions .flake8

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/combine-dependencies.yml

This file was deleted.

38 changes: 19 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
${{ runner.os }}-buildx-build-
- name: Build and push image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: docker/prod.Dockerfile
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -154,22 +154,6 @@ jobs:
IMAGE_TAG: latest-${{ github.run_number }}
run: echo "IMAGE_VALUE=`echo ghcr.io/${{ github.repository }}:$IMAGE_TAG`" >> $GITHUB_ENV

- name: Fill Backend Api definition
id: task-def-api
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION_BACKEND }}
container-name: ${{ env.CONTAINER_NAME_BACKEND }}
image: ${{env.IMAGE_VALUE}}

- name: Deploy Backend Api
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def-api.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_BACKEND }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Fill Celery Cron definition
id: task-def-celery-cron
uses: aws-actions/amazon-ecs-render-task-definition@v1
Expand All @@ -187,13 +171,29 @@ jobs:
image: ${{env.IMAGE_VALUE}}

- name: Deploy Backend Celery
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.task-def-celery-worker.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_CELERY }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Fill Backend Api definition
id: task-def-api
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION_BACKEND }}
container-name: ${{ env.CONTAINER_NAME_BACKEND }}
image: ${{env.IMAGE_VALUE}}

- name: Deploy Backend Api
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.task-def-api.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_BACKEND }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

deploy-staging-gcp:
needs: build
if: github.ref == 'refs/heads/staging'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pipenv'

- name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
run: pip install pipenv

- name: Install dependencies
run: pipenv sync --categories "docs"
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download sphinx documentation
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: sphinx-docs
path: ./build
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,14 @@ on:
- staging
merge_group:

permissions: { }

jobs:
build:
name: Lint Code Base
lint:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint Code Base
uses: super-linter/super-linter/slim@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_PYTHON_ISORT: true
LINTER_RULES_PATH: /
PYTHON_BLACK_CONFIG_FILE: "pyproject.toml"
PYTHON_FLAKE8_CONFIG_FILE: ".flake8"
PYTHON_ISORT_CONFIG_FILE: "pyproject.toml"
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
4 changes: 3 additions & 1 deletion .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ jobs:
${{ runner.os }}-buildx-
- name: Bake docker images
uses: docker/bake-action@v4
uses: docker/bake-action@v5
with:
load: true
set: |
*.cache-from=type=local,src=/tmp/.buildx-cache
*.cache-to=type=local,dest=/tmp/.buildx-cache-new
files: docker-compose.yaml,docker-compose.local.yaml
env:
DOCKER_BUILD_NO_SUMMARY: true

- name: Start services
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,5 @@ secrets.sh

# Redis
*.rdb

jwks.b64.txt
22 changes: 5 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,9 @@ repos:
- id: check-yaml
- id: check-toml

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.7
hooks:
- id: isort
additional_dependencies: ["isort[pyproject]"]

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: ["--config=pyproject.toml"]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: [flake8-isort]
- id: ruff
args: [ --fix ]
- id: ruff-format
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"boto3typed.boto3-ide",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort"
"charliermarsh.ruff"
]
}
11 changes: 4 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"editor.formatOnSave": false
},
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true
"editor.defaultFormatter": "charliermarsh.ruff"
},
"files.associations": {
"*.envrc": "shellscript",
Expand All @@ -19,10 +21,5 @@
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"githubPullRequests.ignoredPullRequestBranches": ["develop", "staging"],
"python.formatting.blackPath": "${workspaceFolder}/.venv/bin/black",
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"python.linting.flake8Args": ["--config=.flake8"],
"python.linting.flake8Path": "${workspaceFolder}/.venv/bin/flake8",
"isort.args": ["--profile", "black"]
"python.languageServer": "Pylance"
}
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,20 @@ reset_db:
docker compose exec backend bash -c "python manage.py reset_db --noinput"
docker compose exec backend bash -c "python manage.py migrate"

ruff-all:
ruff check .

ruff-fix-all:
ruff check --fix .

ruff:
ruff check --fix $(shell git diff --name-only --staged | grep -E '\.py$$|\/pyproject.toml$$')

ruff-all-docker:
docker exec care bash -c "ruff check ."

ruff-docker:
docker exec care bash -c "ruff check --fix $(shell git diff --name-only --staged | grep -E '\.py$$|\/pyproject.toml$$')"

%:
docker compose exec backend bash -c "python manage.py $*"
67 changes: 31 additions & 36 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ name = "pypi"

[packages]
argon2-cffi = "==23.1.0"
authlib = "==1.3.1"
boto3 = "==1.35.0"
authlib = "==1.3.2"
boto3 = "==1.35.25"
celery = "==5.4.0"
django = "==4.2.15"
django = "==5.1.1"
django-environ = "==0.11.2"
django-cors-headers = "==4.3.1"
django-filter = "==24.2"
django-cors-headers = "==4.4.0"
django-filter = "==24.3"
django-maintenance-mode = "==0.21.1"
django-model-utils = "==4.5.1"
django-queryset-csv = "==1.1.0"
django-ratelimit = "==4.1.0"
django-redis = "==5.4.0"
Expand All @@ -26,51 +25,47 @@ dry-rest-permissions = "==0.1.10"
drf-nested-routers = "==0.94.1"
drf-spectacular = "==0.27.2"
"fhir.resources" = "==6.5.0"
gunicorn = "==22.0.0"
gunicorn = "==23.0.0"
healthy-django = "==0.1.0"
jsonschema = "==4.22.0"
jsonschema = "==4.23.0"
jwcrypto = "==1.5.6"
newrelic = "==9.13.0"
pillow = "==10.3.0"
psycopg = { extras = ["c"], version = "==3.1.19" }
pillow = "==10.4.0"
psycopg = { extras = ["c"], version = "==3.2.2" }
pycryptodome = "==3.20.0"
pydantic = "==1.10.15" # fix for fhir.resources < 7.0.2
pyjwt = "==2.8.0"
pydantic = "==1.10.18" # fix for fhir.resources < 7.0.2
pyjwt = "==2.9.0"
python-slugify = "==8.0.4"
pywebpush = "==2.0.0"
redis = { extras = ["hiredis"], version = "==5.0.5" } # constraint for redis-om
redis-om = "==0.3.1"
redis = { extras = ["hiredis"], version = "==5.0.8" } # constraint for redis-om
redis-om = "==0.3.1" # > 0.3.1 broken with pydantic < 2
requests = "==2.32.3"
sentry-sdk = "==2.13.0"
whitenoise = "==6.6.0"
sentry-sdk = "==2.14.0"
whitenoise = "==6.7.0"

[dev-packages]
black = "==24.4.2"
boto3-stubs = { extras = ["s3", "boto3"], version = "==1.35.0" }
coverage = "==7.5.3"
debugpy = "==1.8.1"
boto3-stubs = { extras = ["s3", "boto3"], version = "==1.35.25" }
coverage = "==7.6.1"
debugpy = "==1.8.5"
django-coverage-plugin = "==3.1.0"
django-debug-toolbar = "==4.4.2"
django-extensions = "==3.2.3"
django-silk = "==5.1.0"
django-stubs = "==5.0.2"
djangorestframework-stubs = "==3.15.0"
factory-boy = "==3.3.0"
flake8 = "==7.1.1"
django-silk = "==5.2.0"
djangorestframework-stubs = "==3.15.1"
factory-boy = "==3.3.1"
freezegun = "==1.5.1"
ipython = "==8.25.0"
isort = "==5.13.2"
mypy = "==1.10.0"
pre-commit = "==3.7.1"
ipython = "==8.27.0"
mypy = "==1.11.2"
pre-commit = "==3.8.0"
requests-mock = "==1.12.1"
tblib = "==3.0.0"
watchdog = "==4.0.1"
werkzeug = "==3.0.3"
watchdog = "==5.0.2"
werkzeug = "==3.0.4"
ruff = "==0.6.7"

[docs]
furo = "==2024.5.6"
sphinx = "==7.3.7"
myst-parser = "==3.0.1"
furo = "==2024.8.6"
sphinx = "==8.0.2"
myst-parser = "==4.0.0"

[requires]
python_version = "3.11"
python_version = "3.12"
Loading

0 comments on commit 597f3ce

Please sign in to comment.