Skip to content

Commit

Permalink
Merge pull request #2627 from ohcnetwork/staging
Browse files Browse the repository at this point in the history
Production Release 24.49.0
  • Loading branch information
gigincg authored Dec 2, 2024
2 parents 8fcd70e + 8268b25 commit 4322258
Show file tree
Hide file tree
Showing 39 changed files with 1,213 additions and 1,477 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hostRequirements": {
"cpus": 4
},
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/node:1": {},
Expand All @@ -20,5 +20,5 @@
},
"postCreateCommand": "echo 'eval \"$(direnv hook bash)\"' >> ~/.bashrc && cp .env.example .env",
"postStartCommand": "make up",
"forwardPorts": [8000, 9000, 4000]
"forwardPorts": [4566, 8000, 9000, 4000]
}
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ POSTGRES_HOST=db
POSTGRES_DB=care
POSTGRES_PORT=5432
DATABASE_URL=postgres://postgres:postgres@localhost:5433/care
BACKUP_DIR="./care-backups"
DB_BACKUP_RETENTION_PERIOD=7
REDIS_URL=redis://localhost:6380
CELERY_BROKER_URL=redis://localhost:6380/0

Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
*.cache-to=type=local,dest=/tmp/.buildx-cache-new
files: docker-compose.yaml,docker-compose.local.yaml
env:
DOCKER_BUILD_NO_SUMMARY: true
DOCKER_BUILD_SUMMARY: false

- name: Start services
run: |
Expand All @@ -57,11 +57,15 @@ jobs:
- name: Validate integrity of fixtures
run: make load-dummy-data

- name: Dump db
if: ${{ inputs.event_name == 'push' || github.event_name == 'push' }}
run: make dump-db

- name: Run tests
run: make test-coverage

- name: Upload coverage report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -76,3 +80,13 @@ jobs:
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Pipfile.lock', 'docker/dev.Dockerfile') }}

- name: Upload db artifact
if: ${{ inputs.event_name == 'push' || github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: care-db-dump
path: care_db.dump
retention-days: 30
compression-level: 0 # file is already compressed
overwrite: true # keep only the last artifact
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,5 @@ secrets.sh
*.rdb

jwks.b64.txt

care_db.dump
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -17,7 +17,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.3
hooks:
- id: ruff
args: [ --fix ]
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Any support is welcome. You could help by writing documentation, pull-requests,

### Getting Started

An issue wih the [good first](https://github.com/ohcnetwork/care/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22) or [help wanted](https://github.com/ohcnetwork/care/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3A%22help+wanted%22+is%3Aopen) label might be a good place to start with.
An issue with the [good first](https://github.com/ohcnetwork/care/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22) or [help wanted](https://github.com/ohcnetwork/care/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3A%22help+wanted%22+is%3Aopen) label might be a good place to start with.

### Setting up the development environment

Expand Down Expand Up @@ -34,11 +34,13 @@ Make sure you have docker and docker-compose installed. Then run:
make build
```



#### Using Virtualenv

Make sure you have Postgres and Redis installed on your system.

##### Setting up postgtres for the first time
##### Setting up postgres for the first time

```bash
sudo -u postgres psql
Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build, re-build, up, down, list, logs, test, makemigrations, reset_db
.PHONY: logs


DOCKER_VERSION := $(shell docker --version 2>/dev/null)
Expand All @@ -19,6 +19,9 @@ re-build:
build:
docker compose -f docker-compose.yaml -f $(docker_config_file) build

pull:
docker compose -f docker-compose.yaml -f $(docker_config_file) pull

up:
docker compose -f docker-compose.yaml -f $(docker_config_file) up -d --wait

Expand All @@ -40,6 +43,9 @@ checkmigration:
makemigrations:
docker compose exec backend bash -c "python manage.py makemigrations"

migrate:
docker compose exec backend bash -c "python manage.py migrate"

test:
docker compose exec backend bash -c "python manage.py test --keepdb --parallel --shuffle"

Expand All @@ -48,9 +54,16 @@ test-coverage:
docker compose exec backend bash -c "coverage combine || true; coverage xml"
docker compose cp backend:/app/coverage.xml coverage.xml

reset_db:
dump-db:
docker compose exec db sh -c "pg_dump -U postgres -Fc care > /tmp/care_db.dump"
docker compose cp db:/tmp/care_db.dump care_db.dump

load-db:
docker compose cp care_db.dump db:/tmp/care_db.dump
docker compose exec db sh -c "pg_restore -U postgres --clean --if-exists -d care /tmp/care_db.dump"

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 .
Expand Down
32 changes: 16 additions & 16 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ name = "pypi"
[packages]
argon2-cffi = "==23.1.0"
authlib = "==1.3.2"
boto3 = "==1.35.49"
boto3 = "==1.35.59"
celery = "==5.4.0"
django = "==5.1.2"
django = "==5.1.3"
django-environ = "==0.11.2"
django-cors-headers = "==4.5.0"
django-cors-headers = "==4.6.0"
django-filter = "==24.3"
django-maintenance-mode = "==0.21.1"
django-queryset-csv = "==1.1.0"
django-ratelimit = "==4.1.0"
django-redis = "==5.4.0"
django-rest-passwordreset = "==1.4.2"
django-rest-passwordreset = "==1.5.0"
django-simple-history = "==3.7.0"
djangoql = "==0.18.1"
djangorestframework = "==3.15.2"
Expand All @@ -35,34 +35,34 @@ pydantic = "==1.10.18" # fix for fhir.resources < 7.0.2
pyjwt = "==2.9.0"
python-slugify = "==8.0.4"
pywebpush = "==2.0.1"
redis = { extras = ["hiredis"], version = "==5.0.8" } # constraint for redis-om
redis-om = "==0.3.1" # > 0.3.1 broken with pydantic < 2
redis = { extras = ["hiredis"], version = "==5.2.0" }
redis-om = "==0.3.3"
requests = "==2.32.3"
sentry-sdk = "==2.17.0"
whitenoise = "==6.7.0"
sentry-sdk = "==2.18.0"
whitenoise = "==6.8.2"

[dev-packages]
boto3-stubs = { extras = ["s3", "boto3"], version = "==1.35.49" }
boto3-stubs = { extras = ["s3", "boto3"], version = "*" }
coverage = "==7.6.4"
debugpy = "==1.8.7"
debugpy = "==1.8.8"
django-coverage-plugin = "==3.1.0"
django-extensions = "==3.2.3"
django-silk = "==5.2.0"
djangorestframework-stubs = "==3.15.1"
factory-boy = "==3.3.1"
freezegun = "==1.5.1"
ipython = "==8.28.0"
mypy = "==1.12.1"
ipython = "==8.29.0"
mypy = "==1.13.0"
pre-commit = "==4.0.1"
requests-mock = "==1.12.1"
tblib = "==3.0.0"
watchdog = "==5.0.3"
werkzeug = "==3.0.6"
ruff = "==0.7.0"
watchdog = "==6.0.0"
werkzeug = "==3.1.3"
ruff = "==0.7.3"

[docs]
furo = "==2024.8.6"
sphinx = "==8.0.2"
sphinx = "==8.1.3"
myst-parser = "==4.0.0"

[requires]
Expand Down
Loading

0 comments on commit 4322258

Please sign in to comment.