Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: npm
directory: /progress-tracker-frontend
schedule:
interval: weekly
groups:
# One PR for all security fixes, so related advisories (for example
# next plus its pinned postcss) land together and CI's npm audit passes.
frontend-security:
applies-to: security-updates
patterns: [ "*" ]
frontend-minor-and-patch:
applies-to: version-updates
patterns: [ "*" ]
update-types: [ minor, patch ]

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
github-actions:
patterns: [ "*" ]
54 changes: 45 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Continuous integration

on:
push:
branches: [ main]
branches: [ main ]
pull_request:
branches: [ main ]

Expand All @@ -13,16 +13,52 @@ jobs:
cfn-nag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: stelligent/cfn_nag@master
with:
input_path: template.yml
scan:
name: npm audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: stelligent/cfn_nag@97717cb8d6cf9659d9c51d269b00fb24427bef18 # v0.8.10
with:
input_path: template.yml

cfn-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'
- name: Lint SAM template
run: |
pip install cfn-lint
cfn-lint template.yml

handlers:
name: Lambda handlers (Python 3.14)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'
- name: Compile handlers
run: python -W error -m py_compile handlers/*/*/app.py

frontend:
name: Frontend build and npm audit
runs-on: ubuntu-latest
defaults:
run:
working-directory: progress-tracker-frontend
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
cache: npm
cache-dependency-path: progress-tracker-frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Audit packages
run: npm --prefix "progress-tracker-frontend" audit --omit=dev
run: npm audit --omit=dev
- name: Build
run: npm run build
env:
CI: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ This project contains Backend, which you can deploy with AWS SAM `template.yml`,
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured
* [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed
* [Python](https://www.python.org/downloads/) for changing AWS Lambda functions' code
* [NPM](https://www.npmjs.com/get-npm) for changing the frontend code (React)
* [Python 3.14](https://www.python.org/downloads/), the AWS Lambda runtime version, for `sam build`. Without a local Python 3.14, run `sam build --use-container` (requires Docker)
* [Node.js](https://nodejs.org/) 20.9 or later (Node.js 24 LTS recommended) with npm for changing the frontend code (Next.js and React)


## Deployment instructions
Expand Down
10 changes: 4 additions & 6 deletions handlers/websocketHandlers/reportProgress/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ def handler(event, context):
ConnectionId=connection_id,
Data=bytes(json.dumps(event), 'utf-8')
)
except apigw_management_api_client.exceptions.GoneException as e:
if e.response['Error']['Code'] == 410:
print(f"Found stale connection, deleting {connection_id}")
ddb_client.delete_item(TableName=table_name, Key={'connectionId': {'S': connection_id}})
else:
raise e
except apigw_management_api_client.exceptions.GoneException:
# API Gateway returns HTTP 410 (GoneException) when the client has disconnected.
print(f"Found stale connection, deleting {connection_id}")
ddb_client.delete_item(TableName=table_name, Key={'connectionId': {'S': connection_id}})

return {
'ConnectionId': event['ConnectionId']
Expand Down
Loading
Loading