Skip to content

Commit b15deff

Browse files
authored
Use Required Reviews (#166)
Required reviews github action allows us to enforce PR review without requesting the entire team for review
1 parent cdc466d commit b15deff

File tree

7 files changed

+64
-123
lines changed

7 files changed

+64
-123
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
group: ${{ github.event.repository.name }}-dev-env
8181
cancel-in-progress: false
8282
environment: "AWS DEV"
83-
name: Deploy to DEV and Run Tests
83+
name: Deploy to DEV and Run Live Tests
8484
needs:
8585
- test
8686
- build
@@ -132,13 +132,9 @@ jobs:
132132
- name: Run health check
133133
run: make dev_health_check
134134

135-
- name: Run live testing
136-
run: make test_live_integration
137-
env:
138-
JWT_KEY: ${{ secrets.JWT_KEY }}
139-
140-
- name: Run E2E testing
141-
run: make test_e2e
135+
- name: Run post-deploy testing (Live and E2E)
136+
run: make test_post_deploy -j 2
142137
env:
143138
PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME }}
144139
PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}
140+
JWT_KEY: ${{ secrets.JWT_KEY }}

.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/action-required-review@v4.1.0
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"

CODEOWNERS

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

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ clean:
5454
rm -rf dist_devel/
5555
rm -rf coverage/
5656

57-
build: src/ cloudformation/ docs/
57+
build: src/ cloudformation/
5858
yarn -D
5959
VITE_BUILD_HASH=$(GIT_HASH) yarn build
6060
cp -r src/api/resources/ dist/api/resources
@@ -86,6 +86,7 @@ invalidate_cloudfront:
8686
$(eval DISTRIBUTION_ID_2 := $(shell aws cloudformation describe-stacks --stack-name $(application_key) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontIcalDistributionId'].OutputValue" --output text))
8787
$(eval INVALIDATION_ID := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID) --paths "/*" --query 'Invalidation.Id' --output text --no-cli-page))
8888
$(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)..."
8990
@echo "Waiting on job $(INVALIDATION_ID)..."
9091
aws cloudfront wait invalidation-completed --distribution-id $(DISTRIBUTION_ID) --id $(INVALIDATION_ID)
9192
@echo "Waiting on job $(INVALIDATION_ID_2)..."
@@ -110,6 +111,8 @@ test_e2e: install
110111
yarn playwright install
111112
yarn test:e2e
112113

114+
test_post_deploy: test_live_integration test_e2e
115+
113116
dev_health_check:
114117
curl -f https://core.aws.qa.acmuiuc.org/api/v1/healthz && curl -f https://core.aws.qa.acmuiuc.org/
115118

docs/swagger.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
"scripts": {
1212
"postinstall": "npm run setup",
1313
"setup": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
14-
"build": "yarn workspaces run build && yarn lockfile-manage",
14+
"build": "concurrently --names 'api,ui' 'yarn workspace infra-core-api run build' 'yarn workspace infra-core-ui run build'",
15+
"postbuild": "yarn lockfile-manage",
1516
"dev": "concurrently --names 'api,ui' 'yarn workspace infra-core-api run dev' 'yarn workspace infra-core-ui run dev'",
16-
"lockfile-manage": "synp --with-workspace --source-file yarn.lock && cp package-lock.json dist/lambda/ && cp package-lock.json dist/sqsConsumer/ && cp src/api/package.lambda.json dist/lambda/package.json && cp src/api/package.lambda.json dist/sqsConsumer/package.json && rm package-lock.json",
17+
"lockfile-manage": "synp --with-workspace --source-file yarn.lock",
18+
"postlockfile-manage": "cp package-lock.json dist/lambda/ && cp package-lock.json dist/sqsConsumer/ && cp src/api/package.lambda.json dist/lambda/package.json && cp src/api/package.lambda.json dist/sqsConsumer/package.json && rm package-lock.json",
1719
"prettier": "yarn workspaces run prettier && prettier --check tests/**/*.ts",
1820
"prettier:write": "yarn workspaces run prettier:write && prettier --write tests/**/*.ts",
1921
"lint": "yarn workspaces run lint",
2022
"prepare": "node .husky/install.mjs || true",
2123
"typecheck": "yarn workspaces run typecheck",
22-
"test:unit": "cross-env RunEnvironment='dev' vitest run --coverage --config tests/unit/vitest.config.ts tests/unit && yarn workspace infra-core-ui run test:unit",
24+
"test:unit": "cross-env RunEnvironment='dev' concurrently --names 'api,ui' 'vitest run --coverage --config tests/unit/vitest.config.ts tests/unit' 'yarn workspace infra-core-ui run test:unit'",
2325
"test:unit-ui": "yarn test:unit --ui",
2426
"test:unit-watch": "vitest tests/unit",
2527
"test:live": "vitest tests/live",
@@ -89,4 +91,4 @@
8991
"resolutions": {
9092
"pdfjs-dist": "^4.8.69"
9193
}
92-
}
94+
}

tests/live/membership.test.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getBaseEndpoint } from "./utils.js";
44
const baseEndpoint = getBaseEndpoint();
55

66
describe("Membership API basic checks", async () => {
7-
test("Test that getting member succeeds", { timeout: 3000 }, async () => {
7+
test("Test that getting member succeeds", { timeout: 10000 }, async () => {
88
const response = await fetch(`${baseEndpoint}/api/v1/membership/dsingh14`, {
99
method: "GET",
1010
});
@@ -23,7 +23,7 @@ describe("Membership API basic checks", async () => {
2323
});
2424
test(
2525
"Test that getting member with non-standard casing succeeds",
26-
{ timeout: 3000 },
26+
{ timeout: 10000 },
2727
async () => {
2828
const response = await fetch(
2929
`${baseEndpoint}/api/v1/membership/DSingh14`,
@@ -47,7 +47,7 @@ describe("Membership API basic checks", async () => {
4747
);
4848
test(
4949
"Test that getting non-members succeeds",
50-
{ timeout: 3000 },
50+
{ timeout: 10000 },
5151
async () => {
5252
const response = await fetch(`${baseEndpoint}/api/v1/membership/zzzz`, {
5353
method: "GET",
@@ -62,7 +62,7 @@ describe("Membership API basic checks", async () => {
6262
});
6363
},
6464
);
65-
test("Test that too long NetID is rejected", { timeout: 3000 }, async () => {
65+
test("Test that too long NetID is rejected", { timeout: 10000 }, async () => {
6666
const response = await fetch(
6767
`${baseEndpoint}/api/v1/membership/dsafdsfdsfsdafsfsdfasfsfsfds`,
6868
{
@@ -73,17 +73,21 @@ describe("Membership API basic checks", async () => {
7373
expect(response.status).toBe(400);
7474
expect(response.headers.get("x-acm-data-source")).toBeNull();
7575
});
76-
test("Test that too short NetID is rejected", { timeout: 3000 }, async () => {
77-
const response = await fetch(`${baseEndpoint}/api/v1/membership/ds`, {
78-
method: "GET",
79-
});
76+
test(
77+
"Test that too short NetID is rejected",
78+
{ timeout: 10000 },
79+
async () => {
80+
const response = await fetch(`${baseEndpoint}/api/v1/membership/ds`, {
81+
method: "GET",
82+
});
8083

81-
expect(response.status).toBe(400);
82-
expect(response.headers.get("x-acm-data-source")).toBeNull();
83-
});
84+
expect(response.status).toBe(400);
85+
expect(response.headers.get("x-acm-data-source")).toBeNull();
86+
},
87+
);
8488
test(
8589
"Test that getting external non-members succeeds",
86-
{ timeout: 3000 },
90+
{ timeout: 10000 },
8791
async () => {
8892
const response = await fetch(
8993
`${baseEndpoint}/api/v1/membership/zzzz?list=built`,
@@ -104,7 +108,7 @@ describe("Membership API basic checks", async () => {
104108
);
105109
test(
106110
"Test that getting external members succeeds",
107-
{ timeout: 3000 },
111+
{ timeout: 10000 },
108112
async () => {
109113
const response = await fetch(
110114
`${baseEndpoint}/api/v1/membership/zzzz?list=acmtesting`,

0 commit comments

Comments
 (0)