Skip to content

Commit 7a40731

Browse files
authored
Merge pull request #749 from cornell-dti/master
Fall 2022 Pre-Enroll Release
2 parents f6a4f3e + c3f309c commit 7a40731

205 files changed

Lines changed: 46102 additions & 24873 deletions

File tree

Some content is hidden

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

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/config/
33
dist/
44
/*.js
5-
functions/deployment-template/index.js

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ module.exports = {
7575
'no-use-before-define': ['off'],
7676
// allow debugger during development
7777
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
78+
'no-shadow': 'off',
79+
'@typescript-eslint/no-shadow': 'error',
7880
},
7981
settings: {
8082
'import/resolver': {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ on:
33
push:
44
branches:
55
- beta-release
6+
- release
67

78
jobs:
89
deploy:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@master
12+
- uses: actions/checkout@v2
1213
- name: Set up Node
1314
uses: actions/setup-node@v2
1415
with:

.github/workflows/cd-snapshot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy PR Snapshot
2+
on: pull_request
3+
4+
jobs:
5+
deploy:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Set up Node
10+
uses: actions/setup-node@v2
11+
with:
12+
node-version: '16'
13+
cache: 'npm'
14+
- name: NPM Install
15+
run: npm install
16+
- name: Build
17+
run: npm run build:staging
18+
- name: Deploy
19+
uses: FirebaseExtended/action-hosting-deploy@v0
20+
if: env.SECRET != null
21+
with:
22+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
23+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
24+
projectId: cornelldti-courseplan-dev
25+
expires: 30d
26+
env:
27+
FIREBASE_CLI_PREVIEWS: hostingchannels
28+
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CD
1+
name: Deploy to Staging
22
on:
33
push:
44
branches:
@@ -8,7 +8,7 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v2
1212
- name: Set up Node
1313
uses: actions/setup-node@v2
1414
with:

.github/workflows/ci-build.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@ name: CI Build
22
on: pull_request
33

44
jobs:
5-
build:
5+
check-lockfile:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@master
8+
- uses: actions/checkout@v2
99
- name: Set up Node
1010
uses: actions/setup-node@v2
1111
with:
1212
node-version: '16'
1313
cache: 'npm'
1414
- name: NPM Install
1515
run: npm install
16-
- name: Build
17-
run: npm run build:staging
18-
- uses: FirebaseExtended/action-hosting-deploy@v0
19-
if: env.SECRET != null
16+
- name: Check that package-lock.json has no changes
17+
run: exit $(git status --porcelain | wc -l)
18+
check-req-json:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Node
23+
uses: actions/setup-node@v2
2024
with:
21-
repoToken: '${{ secrets.GITHUB_TOKEN }}'
22-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
23-
projectId: cornelldti-courseplan-dev
24-
expires: 30d
25-
env:
26-
FIREBASE_CLI_PREVIEWS: hostingchannels
27-
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
25+
node-version: '16'
26+
cache: 'npm'
27+
- name: NPM Install
28+
run: npm install
29+
- name: Run req-gen
30+
run: npm run req-gen
31+
- name: Check that the requirements json has no changes
32+
run: exit $(git status --porcelain | wc -l)

.github/workflows/ci-check.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,33 @@
11
name: CI Check
2-
on: push
2+
on:
3+
push:
4+
workflow_dispatch:
35

46
jobs:
57
check:
68
runs-on: ubuntu-latest
79
steps:
8-
- uses: actions/checkout@master
10+
- uses: actions/checkout@v2
911
- name: Set up Node
1012
uses: actions/setup-node@v2
1113
with:
1214
node-version: '16'
1315
cache: 'npm'
1416
- name: NPM Clean Install
15-
run: npm ci && cd functions && npm ci
17+
run: npm ci
1618
- name: Run Prettier Check
1719
run: npm run format:check
1820
- name: Run Linter
1921
run: npm run lint
20-
- name: Type Check
22+
- name: Run Type Check
2123
run: npm run type-check
22-
- name: Jest Test
24+
- name: Run Unit Tests
2325
run: npm run test
24-
check-lockfile:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@master
28-
- name: Set up Node
29-
uses: actions/setup-node@v2
30-
with:
31-
node-version: '16'
32-
cache: 'npm'
33-
- name: NPM Install
34-
run: npm install && cd functions && npm install
35-
- name: Check that package-lock.json has no changes
36-
run: exit $(git status --porcelain | wc -l)
37-
check-req-json:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@master
41-
- name: Set up Node
42-
uses: actions/setup-node@v2
43-
with:
44-
node-version: '16'
45-
cache: 'npm'
46-
- name: NPM Install
47-
run: npm install
48-
- name: Run req-gen
49-
run: npm run req-gen
50-
- name: Check that the requirements json has no changes
51-
run: exit $(git status --porcelain | wc -l)
5226
frontend-tests:
5327
runs-on: ubuntu-latest
5428
concurrency: cypress-tests
5529
steps:
56-
- uses: actions/checkout@master
30+
- uses: actions/checkout@v2
5731
- name: Set up Node
5832
uses: actions/setup-node@v2
5933
with:

.github/workflows/ci-policies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ jobs:
55
enforce-release-workflow:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@master
8+
- uses: actions/checkout@v2
99
- name: Print base ref and head ref
1010
run: |
1111
echo "Your head ref is ${{ github.head_ref }}."
1212
echo "Your base ref is ${{ github.base_ref }}."
1313
- name: Fail if try to push release from non-master branch
14-
if: github.base_ref == 'beta-release' && github.head_ref != 'master'
14+
if: (github.base_ref == 'beta-release' || github.base_ref == 'release') && github.head_ref != 'master'
1515
run: |
1616
echo "Head ref must be master for release. Everything should go through staging first!"
1717
exit 1
1818
warn-big-diff:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@master
21+
- uses: actions/checkout@v2
2222
- uses: cornell-dti/big-diff-warning@master
2323
env:
2424
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'

.github/workflows/track-users.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: TrackUsers
1+
name: Track User Analytics
22
on:
33
schedule:
4-
- cron: '0 4 * * *'
4+
- cron: '0 4 * * *'
55

66
jobs:
77
track-users:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@master
10+
- uses: actions/checkout@v2
1111
- name: Set up Node
1212
uses: actions/setup-node@v2
1313
with:
1414
node-version: '16'
1515
cache: 'npm'
1616
- name: NPM Clean Install
1717
run: npm ci
18-
- name: Run TrackUsers
18+
- name: Run TrackUsers Script
1919
run: npm run track-users
2020
env:
2121
PROD: true
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update Courses Data
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
semester:
6+
description: 'Semester-Tag (eg. FA22-Nov1)' # ensure there are no spaces
7+
required: true
8+
9+
jobs:
10+
update-courses:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '16'
18+
cache: 'npm'
19+
- name: NPM Clean Install
20+
run: npm ci
21+
- name: Generate Courses Json
22+
run: npm run courses-gen
23+
- name: Generate Requirements Json
24+
run: npm run req-gen
25+
- name: Check Diff
26+
id: diff
27+
run: if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then exit 0; else exit 1; fi;
28+
- name: Log No Diff
29+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
30+
run: echo "Courses and requirements json are up to date."
31+
- name: Create Pull Request
32+
id: cpr
33+
uses: peter-evans/create-pull-request@v4
34+
with:
35+
title: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
36+
body: "Ran `npm run courses-gen` and `npm run req-gen`, as part of the update-courses workflow."
37+
commit-message: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
38+
committer: Cornell DTI GitHub Bot <admin@cornelldti.org>
39+
branch: update-courses/${{ github.event.inputs.semester }}
40+
delete-branch: true
41+
- name: Log Pull Request URL
42+
run: echo "Created pull request - ${{ steps.cpr.outputs.pull-request-url }}"

0 commit comments

Comments
 (0)