Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smoke test test #7085

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5b581f6
frontend component and script
fzhao99 Dec 13, 2023
61bec6c
backend config
fzhao99 Dec 13, 2023
e754b8d
actions
fzhao99 Dec 13, 2023
1b95fdd
rename
fzhao99 Dec 13, 2023
ea353ae
final
fzhao99 Dec 13, 2023
0573b6c
comment workflows
fzhao99 Dec 13, 2023
a087147
frontend component and script
fzhao99 Dec 13, 2023
f4e58fb
backend config
fzhao99 Dec 13, 2023
988c7e8
actions
fzhao99 Dec 13, 2023
6659490
rename
fzhao99 Dec 13, 2023
d309561
some other stuff
fzhao99 Dec 13, 2023
8b18c85
add slack alert back in
fzhao99 Dec 13, 2023
8a14470
remove slack comment
fzhao99 Dec 13, 2023
1dbb98c
move slack alert over
fzhao99 Dec 13, 2023
a33000c
dan feedback
fzhao99 Dec 14, 2023
67e9a1c
add okta call and update script config
fzhao99 Dec 15, 2023
284a458
Merge branch 'bob/7019-prod-e2e-health-check' into bob/smoke-test-test
fzhao99 Dec 15, 2023
f6938ed
change to push to prove script works
fzhao99 Dec 15, 2023
91dca0a
lint
fzhao99 Dec 15, 2023
f80ccb3
remove trailing slash
fzhao99 Dec 15, 2023
d89583a
remove trailing slash
fzhao99 Dec 15, 2023
8f287b1
remove empty var
fzhao99 Dec 15, 2023
12f74c4
remove comment
fzhao99 Dec 15, 2023
347bd14
move url to one place
fzhao99 Dec 15, 2023
72d5e40
move url to one place
fzhao99 Dec 15, 2023
6d8ecf3
use existing status check instead
fzhao99 Dec 15, 2023
2eb0fee
start merge pt 1
fzhao99 Dec 15, 2023
3ef003b
lint
fzhao99 Dec 15, 2023
b678b5b
string format and equality
fzhao99 Dec 15, 2023
2236029
string
fzhao99 Dec 15, 2023
0af5696
Merge branch 'bob/7019-prod-e2e-health-check' into bob/smoke-test-test
fzhao99 Dec 15, 2023
5703bba
kick for a fresh deploy
fzhao99 Dec 15, 2023
2655882
frontend component and script
fzhao99 Dec 13, 2023
26f7891
backend config
fzhao99 Dec 13, 2023
f749843
actions
fzhao99 Dec 13, 2023
1b5612f
rename
fzhao99 Dec 13, 2023
b984e00
some other stuff
fzhao99 Dec 13, 2023
9e25175
add slack alert back in
fzhao99 Dec 13, 2023
f1d0d6e
remove slack comment
fzhao99 Dec 13, 2023
20f99da
move slack alert over
fzhao99 Dec 13, 2023
e6757bb
dan feedback
fzhao99 Dec 14, 2023
edaf50e
add okta call and update script config
fzhao99 Dec 15, 2023
c640d3e
lint
fzhao99 Dec 15, 2023
4ee1215
remove trailing slash
fzhao99 Dec 15, 2023
87a6249
remove empty var
fzhao99 Dec 15, 2023
6db0690
remove comment
fzhao99 Dec 15, 2023
d30c568
move url to one place
fzhao99 Dec 15, 2023
03236e9
use existing status check instead
fzhao99 Dec 15, 2023
9463564
string format and equality
fzhao99 Dec 15, 2023
286ccc5
move literal to left
fzhao99 Dec 15, 2023
bc22644
lol it's friday alright
fzhao99 Dec 15, 2023
aa87bd7
add comment to document workflow
fzhao99 Dec 15, 2023
f74a96f
better comment
fzhao99 Dec 15, 2023
503b3fd
use base domain env var instead
fzhao99 Dec 15, 2023
663933a
set env var
fzhao99 Dec 15, 2023
215afe5
don't hard code node version
fzhao99 Dec 19, 2023
be2209f
add endpoint annotation
fzhao99 Jan 8, 2024
f3a3ee3
remove filter chain reference to endpoint
fzhao99 Jan 8, 2024
183d6e4
merge conflicts for new changes
fzhao99 Jan 8, 2024
38fb619
change var pass in to match new version
fzhao99 Jan 8, 2024
d1410d5
second try
fzhao99 Jan 8, 2024
a501da6
add a third argument catch
fzhao99 Jan 8, 2024
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
19 changes: 19 additions & 0 deletions .github/actions/post-deploy-smoke-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Smoke test post deploy
description: Invoke a script that visits a deploy smoke check page that displays whether the backend / db are healthy.
inputs:
base_domain_name:
description: The domain where the application is deployed (e.g. "simplereport.gov" or "test.simplereport.gov")
required: true
runs:
using: composite
steps:
- name: create env file
shell: bash
working-directory: frontend
run: |
touch .env
echo REACT_APP_BASE_URL=${{ inputs.base_domain_name }}>> .env.production.local
- name: Run smoke test script
shell: bash
working-directory: frontend
run: yarn smoke:deploy:ci
66 changes: 33 additions & 33 deletions .github/workflows/checkForChanges.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Check for Changes
# Reusable workflow, compatible with push and pull_request events
on:
workflow_call:
inputs:
# can be a file or a folder
what_to_check:
required: true
type: string
outputs:
has_changes:
description: true or false string
value: ${{ jobs.check_for_changes.outputs.has_changes }}
jobs:
check_for_changes:
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.check_for_changes.outputs.has_changes }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- shell: bash
id: check_for_changes
run: |
echo "::group::Set has_changes output"
diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}")
echo "Diff: $diff"
diff_length=$(echo ${#diff})
has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false")
echo "The Changes: ${has_diff}"
echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT"
echo "::endgroup::"
#name: Check for Changes
## Reusable workflow, compatible with push and pull_request events
#on:
# workflow_call:
# inputs:
# # can be a file or a folder
# what_to_check:
# required: true
# type: string
# outputs:
# has_changes:
# description: true or false string
# value: ${{ jobs.check_for_changes.outputs.has_changes }}
#jobs:
# check_for_changes:
# runs-on: ubuntu-latest
# outputs:
# has_changes: ${{ steps.check_for_changes.outputs.has_changes }}
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - shell: bash
# id: check_for_changes
# run: |
# echo "::group::Set has_changes output"
# diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}")
# echo "Diff: $diff"
# diff_length=$(echo ${#diff})
# has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false")
# echo "The Changes: ${has_diff}"
# echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT"
# echo "::endgroup::"
118 changes: 59 additions & 59 deletions .github/workflows/checkGraphql.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
name: Check Graphql

on:
workflow_dispatch:
pull_request:
branches:
- "**"
merge_group:
types:
- checks_requested
push:
branches:
- main

env:
NODE_VERSION: 18

defaults:
run:
working-directory: frontend

jobs:
check-graphql-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{env.NODE_VERSION}}
uses: actions/[email protected].1
with:
node-version: ${{env.NODE_VERSION}}
- name: Cache yarn
uses: actions/[email protected]
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Node setup
run: yarn install --prefer-offline
- name: Generate grahpql types
run: yarn codegen
- name: Lint generated files
run: yarn lint:write
- name: Check for changes
run: |
if [[ -z "$(git status --porcelain)" ]]; then
exit 0
else
echo "Current generated code does not match code in latest commit. try running cd frontend/ && yarn codegen"
git diff >> diff.txt
exit 1
fi
- name: Archive git diff
uses: actions/upload-artifact@v4
if: failure()
with:
name: files changed
path: frontend/diff.txt
retention-days: 7
#name: Check Graphql
#
#on:
# workflow_dispatch:
# pull_request:
# branches:
# - "**"
# merge_group:
# types:
# - checks_requested
# push:
# branches:
# - main
#
#env:
# NODE_VERSION: 18
#
#defaults:
# run:
# working-directory: frontend
#
#jobs:
# check-graphql-types:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js ${{env.NODE_VERSION}}
# uses: actions/[email protected].0
# with:
# node-version: ${{env.NODE_VERSION}}
# - name: Cache yarn
# uses: actions/[email protected]
# with:
# path: ~/.cache/yarn
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - name: Node setup
# run: yarn install --prefer-offline
# - name: Generate grahpql types
# run: yarn codegen
# - name: Lint generated files
# run: yarn lint:write
# - name: Check for changes
# run: |
# if [[ -z "$(git status --porcelain)" ]]; then
# exit 0
# else
# echo "Current generated code does not match code in latest commit. try running cd frontend/ && yarn codegen"
# git diff >> diff.txt
# exit 1
# fi
# - name: Archive git diff
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: files changed
# path: frontend/diff.txt
# retention-days: 7
128 changes: 64 additions & 64 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: Chromatic

on:
workflow_dispatch:
pull_request:
branches:
- "**"
paths:
- "frontend/**"
push:
branches:
- main
paths:
- "frontend/**"

env:
NODE_VERSION: 18

jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0 # Chromatic wants the history

- uses: actions/[email protected].1
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn
working-directory: frontend

- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
uses: chromaui/action@v10
with:
workingDir: frontend
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
ignoreLastBuildOnBranch: "**" # Better comparisons after rebasing
exitZeroOnChanges: true
exitOnceUploaded: true

- name: Publish to Chromatic (auto-accept changes on merge main)
if: github.ref == 'refs/heads/main'
uses: chromaui/action@v10
with:
workingDir: frontend
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
ignoreLastBuildOnBranch: "**"
exitZeroOnChanges: true
exitOnceUploaded: true
autoAcceptChanges: true # handle squash-on-merge

- name: Artifact Chromatic logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs
path: frontend/*.log
#name: Chromatic
#
#on:
# workflow_dispatch:
# pull_request:
# branches:
# - "**"
# paths:
# - "frontend/**"
# push:
# branches:
# - main
# paths:
# - "frontend/**"
#
#env:
# NODE_VERSION: 18
#
#jobs:
# chromatic-deployment:
# runs-on: ubuntu-latest
# steps:
#
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0 # Chromatic wants the history
#
# - uses: actions/[email protected].0
# with:
# node-version: ${{ env.NODE_VERSION }}
#
# - name: Install dependencies
# run: yarn
# working-directory: frontend
#
# - name: Publish to Chromatic
# if: github.ref != 'refs/heads/main'
# uses: chromaui/action@v10
# with:
# workingDir: frontend
# token: ${{ secrets.GITHUB_TOKEN }}
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# ignoreLastBuildOnBranch: "**" # Better comparisons after rebasing
# exitZeroOnChanges: true
# exitOnceUploaded: true
#
# - name: Publish to Chromatic (auto-accept changes on merge main)
# if: github.ref == 'refs/heads/main'
# uses: chromaui/action@v10
# with:
# workingDir: frontend
# token: ${{ secrets.GITHUB_TOKEN }}
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# ignoreLastBuildOnBranch: "**"
# exitZeroOnChanges: true
# exitOnceUploaded: true
# autoAcceptChanges: true # handle squash-on-merge
#
# - name: Artifact Chromatic logs
# if: failure()
# uses: actions/upload-artifact@v3
# with:
# name: logs
# path: frontend/*.log
Loading