Skip to content

Commit

Permalink
Merge branch 'master' into issue#1210
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Jul 17, 2023
2 parents a978282 + 43a47ea commit 2372862
Show file tree
Hide file tree
Showing 10,286 changed files with 1,189,996 additions and 25,492 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source .venv/bin/activate; unset PS1
dotenv
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ exclude =
__pycache__,
.venv,
*/migrations/*,
*/migrations_old/*,
*/static/CACHE/*,
docs
16 changes: 10 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
## Proposed Changes

- Change 1
- Change 2
- Brief of changes made.

### Associated Issue
-

- Link to issue here, explain how the proposed solution will solve the reported issue/ feature request.

### Architecture changes
-

@coronasafe/code-reviewers

- Remove this section if not used

## Merge Checklist

- [ ] Tests added/fixed
- [ ] Update docs in `/docs`
- [ ] Linting Complete
- [ ] Any other necessary step

_*Only PR's with test cases included and passing lint and test pipelines will be reviewed*_

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins
29 changes: 0 additions & 29 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/deployment-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: Branch based deploy

on:
workflow_dispatch:

push:
branches:
- abdm-m2
- hcx-communications
paths-ignore:
- "docs/**"

Expand All @@ -26,10 +27,7 @@ jobs:
tags: |
type=raw,value=${{ github.ref_name}}-${{ github.run_number }}
type=raw,value=${{ github.ref_name}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
flavor: |
latest=true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/deployment-lambda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Lambda Deployment

on:
workflow_dispatch:

pull_request:
branches:
- devops/lambda-changes
paths-ignore:
- "docs/**"

jobs:

build-image:
name: Build & Push Staging to container registries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.head_ref}}-${{ github.run_number }}
type=raw,value=${{ github.head_ref}}
flavor: |
latest=true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('r*/base.txt', 'r*/production.txt', 'Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v3
with:
context: .
file: lambda_Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
37 changes: 7 additions & 30 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ jobs:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy-staging-egov-api:
deploy-staging-egov:
needs: build-staging
name: Deploy to ECS API Egov
runs-on: ubuntu-latest
environment:
name: Staging-egov
url: https://careapi.coronasafe.in
url: https://careapi.ohc.network
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -279,29 +279,6 @@ jobs:
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

deploy-staging-egov-celery:
needs: build-staging
name: Deploy to Egov CELERY ECS
runs-on: ubuntu-latest
environment:
name: Staging-egov
url: https://careapi.coronasafe.in
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: IMAGE Tagging
env:
IMAGE_TAG: latest-${{ github.run_number }}
run: echo "IMAGE_VALUE=`echo ghcr.io/${{ github.repository }}:$IMAGE_TAG`" >> $GITHUB_ENV

- name: Fill Celery Cron definition
id: task-def-celery-cron
uses: aws-actions/amazon-ecs-render-task-definition@v1
Expand Down Expand Up @@ -357,7 +334,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v3.0
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -403,7 +380,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v3.0
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -449,7 +426,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v3.0
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -495,7 +472,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v3.0
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -541,7 +518,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v3.0
with:
version: "v1.23.6"
id: install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
if: github.repository == 'coronasafe/care'
name: Lint Code Base
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout Code
Expand All @@ -17,7 +21,7 @@ jobs:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter/slim@v4
uses: github/super-linter/slim@v5
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Python 3.x
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"

- name: Cache pip
Expand Down Expand Up @@ -71,6 +71,3 @@ jobs:
coverage combine || true
coverage xml
coverage report -m
- name: Upload coverage report
uses: codecov/codecov-action@v2
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ typings/

### VisualStudioCode template
.vscode/*
# !.vscode/settings.json
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
exclude: "docs|node_modules|migrations|.git|.tox"
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: no-commit-to-branch
args: [--branch, master, --branch, production]
- id: check-merge-conflict
- id: check-builtin-literals
- id: mixed-line-ending
args: [--fix=lf]
- id: end-of-file-fixer
- id: check-yaml
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-yaml
- id: check-toml

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
additional_dependencies: ["isort[pyproject]"]

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

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: [flake8-isort]

ci:
autoupdate_schedule: weekly
skip: []
submodules: false
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"boto3typed.boto3-ide",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort"
]
}
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,14 @@
"django": true,
"justMyCode": false
},
{
"name": "Python: Django test",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": ["test", "--keepdb"],
"django": true,
"justMyCode": false
},
]
}
Loading

0 comments on commit 2372862

Please sign in to comment.