From 0e83312d14fc650209932e1a23b303a59aca02ff Mon Sep 17 00:00:00 2001 From: Cheryl Chen Date: Sat, 18 Nov 2023 22:43:23 -0800 Subject: [PATCH 1/6] added create table users statement --- server/schema/users.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 server/schema/users.sql diff --git a/server/schema/users.sql b/server/schema/users.sql new file mode 100644 index 0000000..2aa8112 --- /dev/null +++ b/server/schema/users.sql @@ -0,0 +1,8 @@ +CREATE TYPE account_type as ENUM ('superadmin', 'admin'); + +CREATE TABLE IF NOT EXISTS users ( + id VARCHAR ( 256 ) PRIMARY KEY, + email VARCHAR ( 50 ) NOT NULL, + type account_type NOT NULL, + approved BOOLEAN NOT NULL +); \ No newline at end of file From e2e0b73f988db4cb9cd213a38c38ea40aa0ca523 Mon Sep 17 00:00:00 2001 From: Cheryl Chen Date: Sat, 18 Nov 2023 22:57:09 -0800 Subject: [PATCH 2/6] added drop table if exists --- server/schema/users.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/schema/users.sql b/server/schema/users.sql index 2aa8112..b652586 100644 --- a/server/schema/users.sql +++ b/server/schema/users.sql @@ -1,6 +1,8 @@ CREATE TYPE account_type as ENUM ('superadmin', 'admin'); -CREATE TABLE IF NOT EXISTS users ( +DROP TABLE IF EXISTS users; + +CREATE TABLE users ( id VARCHAR ( 256 ) PRIMARY KEY, email VARCHAR ( 50 ) NOT NULL, type account_type NOT NULL, From 589e5370c9e0f58252a9c0a813dfab3c7e705638 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 21 Nov 2023 17:42:53 -0800 Subject: [PATCH 3/6] Attempt to figure out ENV variable issue with workflows --- .github/workflows/CI.yml | 10 ++++++---- .github/workflows/scripts/reviewReviewed.js | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 318a41d..f43ddc4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,13 +2,15 @@ name: CI on: [pull_request] - + permissions: read-all jobs: - eslint: + eslint: + env: + REVIEWDOG_GITHUB_API_TOKEN: $${{ secret.sCTC_DEVOPS_ORG_PAT }} runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: @@ -21,7 +23,7 @@ jobs: reporter: github-pr-review fail_on_error: false eslint_flags: '**/*.{js,jsx}' - + detect-secrets: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/scripts/reviewReviewed.js b/.github/workflows/scripts/reviewReviewed.js index 9d83536..9dd2f44 100644 --- a/.github/workflows/scripts/reviewReviewed.js +++ b/.github/workflows/scripts/reviewReviewed.js @@ -40,11 +40,11 @@ const messageAssignee = async ({ context }) => { try { const UserModel = getUserModel(); const slackAssignees = await Promise.allSettled( - githubAssignees.map(assignee => UserModel.findOne({ github: assignee.login })), + githubAssignees.map((assignee) => UserModel.findOne({ github: assignee.login })), ); if (context.payload.review.state === 'approved') { await Promise.all( - slackAssignees.map(assignee => + slackAssignees.map((assignee) => Bot.client.chat.postMessage({ channel: assignee.value?.slackId, text: `One of your pull requests has been APPROVED by ${reviewer}! <${url}|View Review> :shrek::thumbsup:`, @@ -53,7 +53,7 @@ const messageAssignee = async ({ context }) => { ); } else { await Promise.all( - slackAssignees.map(assignee => + slackAssignees.map((assignee) => Bot.client.chat.postMessage({ channel: assignee.value?.slackId, text: `One of your pull requests has been REVIEWED by ${reviewer}! <${url}|View Review> :shrek:`, From 9f350b022e5a77e7b8f96199fa0fff0fe47d08c9 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 21 Nov 2023 18:06:59 -0800 Subject: [PATCH 4/6] fix typo --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f43ddc4..ca945b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,7 +8,7 @@ permissions: read-all jobs: eslint: env: - REVIEWDOG_GITHUB_API_TOKEN: $${{ secret.sCTC_DEVOPS_ORG_PAT }} + REVIEWDOG_GITHUB_API_TOKEN: $${{ secret.CTC_DEVOPS_ORG_PAT }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 559dab73494a8ad80c0604f991ce354872937c4a Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 21 Nov 2023 18:15:28 -0800 Subject: [PATCH 5/6] try moving env variables --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ca945b5..9b40f2f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,5 +1,8 @@ name: CI +env: + $REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CTC_DEVOPS_ORG_PAT }} + on: [pull_request] @@ -7,8 +10,6 @@ permissions: read-all jobs: eslint: - env: - REVIEWDOG_GITHUB_API_TOKEN: $${{ secret.CTC_DEVOPS_ORG_PAT }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From f810b9d8b671ebda9cb0287416cc85d419a2a026 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 21 Nov 2023 18:24:01 -0800 Subject: [PATCH 6/6] Revert changes --- .github/workflows/CI.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9b40f2f..3d96503 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,8 +1,5 @@ name: CI -env: - $REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CTC_DEVOPS_ORG_PAT }} - on: [pull_request]