Skip to content

Commit f44c400

Browse files
committed
Merge branch 'main' into eeen17/siglead-mainscreen-api
2 parents fa9de10 + 41d85f4 commit f44c400

File tree

91 files changed

+3117
-530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3117
-530
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11+
[*.ics]
12+
insert_final_newline = false
13+
1114
[*.md]
1215
max_line_length = off
1316
trim_trailing_whitespace = false

.github/workflows/autoupdate.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: autoupdate
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
autoupdate:
8+
permissions:
9+
contents: write
10+
name: autoupdate
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: docker://chinthakagodawita/autoupdate-action:v1
14+
env:
15+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16+
PR_FILTER: "protected"
17+
MERGE_MSG: "Auto-update feature branch with changes from the main branch"

.github/workflows/deploy-dev.yml

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- main
99

1010
jobs:
11-
test-unit:
11+
test:
1212
runs-on: ubuntu-latest
1313
name: Run Unit Tests
1414
steps:
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: 22.x
23-
cache: 'yarn'
23+
cache: "yarn"
2424

2525
- name: Restore Yarn Cache
2626
uses: actions/cache@v4
@@ -30,14 +30,47 @@ jobs:
3030
restore-keys: |
3131
yarn-modules-${{ runner.os }}-
3232
33-
- name: Set up Python 3.11 for testing
34-
uses: actions/setup-python@v5
35-
with:
36-
python-version: 3.11
37-
3833
- name: Run unit testing
3934
run: make test_unit
4035

36+
build:
37+
runs-on: ubuntu-latest
38+
name: Build Application
39+
steps:
40+
- uses: actions/checkout@v4
41+
env:
42+
HUSKY: "0"
43+
44+
- name: Set up Node
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 22.x
48+
cache: "yarn"
49+
50+
- name: Restore Yarn Cache
51+
uses: actions/cache@v4
52+
with:
53+
path: node_modules
54+
key: yarn-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev
55+
restore-keys: |
56+
yarn-modules-${{ runner.os }}-
57+
58+
- name: Run build
59+
run: make build
60+
env:
61+
HUSKY: "0"
62+
VITE_RUN_ENVIRONMENT: dev
63+
64+
- name: Upload Build files
65+
uses: actions/upload-artifact@v4
66+
with:
67+
include-hidden-files: true
68+
name: build
69+
path: |
70+
.aws-sam/
71+
dist/
72+
dist_ui/
73+
4174
deploy-test-dev:
4275
runs-on: ubuntu-latest
4376
permissions:
@@ -47,9 +80,10 @@ jobs:
4780
group: ${{ github.event.repository.name }}-dev-env
4881
cancel-in-progress: false
4982
environment: "AWS DEV"
50-
name: Deploy to DEV and Run Tests
83+
name: Deploy to DEV and Run Live Tests
5184
needs:
52-
- test-unit
85+
- test
86+
- build
5387
steps:
5488
- uses: actions/checkout@v4
5589
env:
@@ -59,7 +93,7 @@ jobs:
5993
uses: actions/setup-node@v4
6094
with:
6195
node-version: 22.x
62-
cache: 'yarn'
96+
cache: "yarn"
6397

6498
- name: Restore Yarn Cache
6599
uses: actions/cache@v4
@@ -69,6 +103,11 @@ jobs:
69103
restore-keys: |
70104
yarn-modules-${{ runner.os }}-
71105
106+
- name: Download Build files
107+
uses: actions/download-artifact@v4
108+
with:
109+
name: build
110+
72111
- uses: aws-actions/setup-sam@v2
73112
with:
74113
use-installer: true
@@ -93,13 +132,9 @@ jobs:
93132
- name: Run health check
94133
run: make dev_health_check
95134

96-
- name: Run live testing
97-
run: make test_live_integration
98-
env:
99-
JWT_KEY: ${{ secrets.JWT_KEY }}
100-
101-
- name: Run E2E testing
102-
run: make test_e2e
135+
- name: Run post-deploy testing (Live and E2E)
136+
run: make test_post_deploy -j 2
103137
env:
104138
PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME }}
105139
PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}
140+
JWT_KEY: ${{ secrets.JWT_KEY }}

.github/workflows/deploy-prod.yml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,68 @@ on:
77
branches:
88
- main
99
jobs:
10-
test-unit:
10+
test:
1111
runs-on: ubuntu-latest
1212
name: Run Unit Tests
1313
steps:
14+
- uses: actions/checkout@v4
15+
env:
16+
HUSKY: "0"
17+
1418
- name: Set up Node
1519
uses: actions/setup-node@v4
1620
with:
1721
node-version: 22.x
22+
cache: "yarn"
23+
24+
- name: Restore Yarn Cache
25+
uses: actions/cache@v4
26+
with:
27+
path: node_modules
28+
key: yarn-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev
29+
restore-keys: |
30+
yarn-modules-${{ runner.os }}-
31+
32+
- name: Run unit testing
33+
run: make test_unit
34+
35+
build:
36+
runs-on: ubuntu-latest
37+
name: Build Application
38+
steps:
1839
- uses: actions/checkout@v4
1940
env:
2041
HUSKY: "0"
21-
- name: Set up Python 3.11 for testing
22-
uses: actions/setup-python@v5
42+
43+
- name: Set up Node
44+
uses: actions/setup-node@v4
2345
with:
24-
python-version: 3.11
25-
- name: Run unit testing
26-
run: make test_unit
46+
node-version: 22.x
47+
cache: "yarn"
48+
49+
- name: Restore Yarn Cache
50+
uses: actions/cache@v4
51+
with:
52+
path: node_modules
53+
key: yarn-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-prod
54+
restore-keys: |
55+
yarn-modules-${{ runner.os }}-
56+
57+
- name: Run build
58+
run: make build
59+
env:
60+
HUSKY: "0"
61+
VITE_RUN_ENVIRONMENT: prod
62+
63+
- name: Upload Build files
64+
uses: actions/upload-artifact@v4
65+
with:
66+
include-hidden-files: true
67+
name: build-prod
68+
path: |
69+
.aws-sam/
70+
dist/
71+
dist_ui/
2772
2873
deploy-prod:
2974
runs-on: ubuntu-latest
@@ -35,7 +80,8 @@ jobs:
3580
id-token: write
3681
contents: read
3782
needs:
38-
- test-unit
83+
- test
84+
- build
3985
environment: "AWS PROD"
4086
steps:
4187
- name: Set up Node for testing
@@ -53,6 +99,10 @@ jobs:
5399
uses: actions/setup-python@v5
54100
with:
55101
python-version: 3.11
102+
- name: Download Build files
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: build-prod
56106
- uses: aws-actions/configure-aws-credentials@v4
57107
with:
58108
role-to-assume: arn:aws:iam::298118738376:role/GitHubActionsRole

.github/workflows/review.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Required Reviews
2+
on:
3+
pull_request_review:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
check:
9+
name: Checking required reviews
10+
runs-on: ubuntu-latest
11+
permissions: {}
12+
13+
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
14+
15+
steps:
16+
- uses: Automattic/[email protected]
17+
with:
18+
token: ${{ secrets.REQUIRED_REVIEWS_TOKEN }}
19+
status: Required Reviews
20+
requirements: |
21+
- name: Cloud provider files
22+
paths:
23+
- '.github/'
24+
- 'cloudformation/'
25+
teams:
26+
- "officers"
27+
- "infra-chairs"
28+
- name: Base Requirement
29+
paths: unmatched
30+
teams:
31+
- "officers"
32+
- "infra-chairs"
33+
- "infra-leads"

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@acm-uiuc:registry=https://registry.npmjs.org

CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ clean:
5252
rm -rf dist/
5353
rm -rf dist_ui/
5454
rm -rf dist_devel/
55+
rm -rf coverage/
5556

56-
build: src/ cloudformation/ docs/
57+
build: src/ cloudformation/
5758
yarn -D
5859
VITE_BUILD_HASH=$(GIT_HASH) yarn build
5960
cp -r src/api/resources/ dist/api/resources
@@ -65,14 +66,14 @@ build: src/ cloudformation/ docs/
6566
local:
6667
VITE_BUILD_HASH=$(GIT_HASH) yarn run dev
6768

68-
deploy_prod: check_account_prod build
69+
deploy_prod: check_account_prod
6970
@echo "Deploying CloudFormation stack..."
7071
sam deploy $(common_params) --parameter-overrides $(run_env)=prod $(set_application_prefix)=$(application_key) $(set_application_name)="$(application_name)" S3BucketPrefix="$(s3_bucket_prefix)"
7172
@echo "Syncing S3 bucket..."
7273
aws s3 sync $(dist_ui_directory_root) s3://$(ui_s3_bucket)/ --delete
7374
make invalidate_cloudfront
7475

75-
deploy_dev: check_account_dev build
76+
deploy_dev: check_account_dev
7677
@echo "Deploying CloudFormation stack..."
7778
sam deploy $(common_params) --parameter-overrides $(run_env)=dev $(set_application_prefix)=$(application_key) $(set_application_name)="$(application_name)" S3BucketPrefix="$(s3_bucket_prefix)"
7879
@echo "Syncing S3 bucket..."
@@ -85,6 +86,7 @@ invalidate_cloudfront:
8586
$(eval DISTRIBUTION_ID_2 := $(shell aws cloudformation describe-stacks --stack-name $(application_key) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontIcalDistributionId'].OutputValue" --output text))
8687
$(eval INVALIDATION_ID := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID) --paths "/*" --query 'Invalidation.Id' --output text --no-cli-page))
8788
$(eval INVALIDATION_ID_2 := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID_2) --paths "/*" --query 'Invalidation.Id' --output text --no-cli-page))
89+
@echo "Triggered invalidation jobs $(INVALIDATION_ID) and $(INVALIDATION_ID_2)..."
8890
@echo "Waiting on job $(INVALIDATION_ID)..."
8991
aws cloudfront wait invalidation-completed --distribution-id $(DISTRIBUTION_ID) --id $(INVALIDATION_ID)
9092
@echo "Waiting on job $(INVALIDATION_ID_2)..."
@@ -109,6 +111,8 @@ test_e2e: install
109111
yarn playwright install
110112
yarn test:e2e
111113

114+
test_post_deploy: test_live_integration test_e2e
115+
112116
dev_health_check:
113117
curl -f https://core.aws.qa.acmuiuc.org/api/v1/healthz && curl -f https://core.aws.qa.acmuiuc.org/
114118

cloudformation/iam.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Resources:
4343
Effect: Allow
4444
Resource:
4545
- Fn::Sub: arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:infra-core-api-config*
46+
- Fn::Sub: arn:aws:secretsmanager:${AWS::Region}:427040638965:secret:infra-core-api-testing-credentials* # this secret only exists in awsdev account
4647

4748
- Action:
4849
- dynamodb:DescribeLimits
@@ -153,6 +154,15 @@ Resources:
153154
- lambda.amazonaws.com
154155

155156
Policies:
157+
- PolicyName: lambda-self-invoke
158+
PolicyDocument:
159+
Version: "2012-10-17"
160+
Statement:
161+
- Action:
162+
- lambda:invokeFunction
163+
Effect: Allow
164+
Resource:
165+
- Fn::Sub: "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${LambdaFunctionName}:*"
156166
- PolicyName: lambda-generic
157167
PolicyDocument:
158168
Version: "2012-10-17"

cloudformation/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ Resources:
192192
RestApiId: !Ref AppApiGateway
193193
Path: /{proxy+}
194194
Method: ANY
195+
WarmingSchedule:
196+
Type: Schedule
197+
Properties:
198+
Schedule: !If [
199+
ShouldAttachVpc,
200+
'rate(15 minutes)',
201+
'rate(5 minutes)'
202+
]
203+
Input: '{ "warmer":true,"concurrency":3 }'
204+
195205

196206
AppSqsLambdaFunction:
197207
Type: AWS::Serverless::Function

0 commit comments

Comments
 (0)