Skip to content

Commit

Permalink
Merge branch 'main' into acouch/issue-1657-next-intl
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed May 2, 2024
2 parents 3afbf5d + 80313c9 commit c090e9b
Show file tree
Hide file tree
Showing 132 changed files with 2,295 additions and 705 deletions.
40 changes: 40 additions & 0 deletions .github/linters/scripts/check-wiki-pages-linked-to-summary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#! /bin/bash
# Usage: ./scripts/check-wiki-pages-linked-to-summary.sh
# Checks that all pages in the documentation/wiki/ sub-directory are linked to SUMMARY.md

REPO_ROOT="../.."
WIKI_DIR="${REPO_ROOT}/documentation/wiki"
TEMP_DIR="./tmp"
WIKI_FILES="${TEMP_DIR}/wiki-files.txt"
SUMMARY_FILES="${TEMP_DIR}/summary-files.txt"
MISSING_FILES="${TEMP_DIR}/missing-from-summary.txt"
mkdir -p tmp # create tmp directory

# list all of the markdown files in the wiki directory
find "${WIKI_DIR}" -name "*.md" |\
# make file paths relative to the root of the wiki directory
sed -E "s|${WIKI_DIR}/(.*)|\1|" |\
# filter out the SUMMARY.md file
grep -Ev '(SUMMARY.md)' |\
# sort the files alphabetically and write to a temporary file
sort > $WIKI_FILES

# list all of the markdown files linked in the SUMMARY.md file
grep -oE '\((.*\.md)\)' "${WIKI_DIR}/SUMMARY.md" |\
# remove the extra parantheses around the markdown files
sed -E "s|\((.+)\)|\1|" |\
# sort the files alphabetically and write to a temporary file
sort > $SUMMARY_FILES

# find files that are in the wiki but not in the summary
comm -2 -3 $WIKI_FILES $SUMMARY_FILES > $MISSING_FILES

# if there are missing files exit with a non-zero code and print them
if [[ -z "$(cat ${MISSING_FILES})" ]]; then
echo "All files added to summary"
exit 0
else
echo "The following files need to be added to documentation/wiki/SUMMARY.md:"
cat $MISSING_FILES
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/cd-analytics-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/cd-analytics.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Analytics
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to Analytics ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
run-name: Deploy ${{ github.ref_name }} to Analytics ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod'}} # changed for consistency with other files

on:
push:
Expand Down Expand Up @@ -33,6 +33,9 @@ jobs:
name: Deploy
needs: analytics-checks
uses: ./.github/workflows/deploy.yml
strategy:
matrix:
envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev", "staging"]') || fromJSON('["dev"]') }}
with:
app_name: "analytics"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ matrix.envs }}
4 changes: 2 additions & 2 deletions .github/workflows/cd-api-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/cd-api.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy API
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }}

on:
push:
Expand All @@ -20,6 +20,7 @@ on:
type: choice
options:
- dev
- staging
- prod

jobs:
Expand All @@ -31,6 +32,9 @@ jobs:
name: Deploy
needs: api-checks
uses: ./.github/workflows/deploy.yml
strategy:
matrix:
envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev", "staging"]') || fromJSON('["dev"]') }}
with:
app_name: "api"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ matrix.envs }}
4 changes: 2 additions & 2 deletions .github/workflows/cd-frontend-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- name: Configure AWS credentials
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/cd-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Deploy Frontend
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}

run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }}
on:
push:
branches:
Expand All @@ -20,6 +19,7 @@ on:
type: choice
options:
- dev
- staging
- prod

jobs:
Expand All @@ -31,6 +31,9 @@ jobs:
name: Deploy
needs: frontend-checks
uses: ./.github/workflows/deploy.yml
strategy:
matrix:
envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev", "staging"]') || fromJSON('["dev"]') }}
with:
app_name: "frontend"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
environment: ${{ matrix.envs }}
13 changes: 11 additions & 2 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ jobs:
- name: Run format
run: npm run format-check

- name: Run tests
run: npm run test
- run: npm run test -- --testLocationInResults --json --outputFile=coverage/report.json
- uses: ArtiomTr/jest-coverage-report-action@v2
with:
coverage-file: coverage/report.json
test-script: npm test
working-directory: ./frontend
annotations: failed-tests
package-manager: npm
icons: emoji
skip-step: none
output: comment

- name: Run e2e tests
run: npm run test:e2e
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false
- name: Run infra-lint-terraform
run: |
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false
- name: Validate
run: make infra-validate-modules
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ci-wiki-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Checks that all of the markdown files in /documentation/wiki/
# have been added to documenation/wiki/SUMMARY.md
name: CI - Check wiki links

on:
pull_request:
paths:
- documentation/wiki/**
- .github/workflows/ci-wiki-links.yml
- .github/linters/scripts/check-wiki-pages-linked-to-summary.sh

defaults:
run:
working-directory: ./.github/linters # ensures that this job runs from the ./linters sub-directory

jobs:
check-wiki-links:
name: Check wiki links in SUMMARY.md
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Check all wiki files are linked in SUMMARY.md
run: ./scripts/check-wiki-pages-linked-to-summary.sh
2 changes: 1 addition & 1 deletion .github/workflows/infra-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.7.1
terraform_version: 1.8.2
terraform_wrapper: false

- uses: actions/setup-go@v3
Expand Down
15 changes: 15 additions & 0 deletions analytics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ version: '3'

services:

grants-analytics-db:
image: postgres:15-alpine
container_name: grants-analytics-db
command: postgres -c "log_lock_waits=on" -N 1000 -c "fsync=off"
env_file: ./local.env
ports:
- "5432:5432"
volumes:
- grantsanalyticsdbdata:/var/lib/postgresql/data

grants-analytics:
build:
context: .
Expand All @@ -13,3 +23,8 @@ services:
volumes:
- .:/analytics
- ~/.ssh:/home/${RUN_USER:-analytics}/.ssh
depends_on:
- grants-analytics-db

volumes:
grantsanalyticsdbdata:
19 changes: 19 additions & 0 deletions analytics/local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
############################
# DB Environment Variables
############################

# These are used by the Postgres image to create the admin user
POSTGRES_USER=app
POSTGRES_PASSWORD=secret123

# Set DB_HOST to localhost if accessing a non-dockerized database
DB_HOST=grants-analytics-db
DB_NAME=app
DB_USER=app
DB_PASSWORD=secret123
DB_SSL_MODE=allow

# When an error occurs with a SQL query,
# whether or not to hide the parameters which
# could contain sensitive information.
HIDE_SQL_PARAMETER_LOGS=TRUE
2 changes: 1 addition & 1 deletion api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:

grants-db:
image: postgres:14-alpine
image: postgres:15-alpine
container_name: grants-db
command: postgres -c "log_lock_waits=on" -N 1000 -c "fsync=off"
env_file: ./local.env
Expand Down

0 comments on commit c090e9b

Please sign in to comment.