Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into logic-1
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Jan 17, 2025
2 parents 59e98cf + 7b27866 commit cbcc1cd
Show file tree
Hide file tree
Showing 200 changed files with 6,607 additions and 4,115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_pr-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: check-pr
run: |
PR=$(gh pr list --base ${BASE} --head ${HEAD} --json number --jq '.[0].number')
echo "::set-output name=pr_exists::$PR"
echo "pr_exists=$PR" >> $GITHUB_OUTPUT
- name: Create pull request
if: steps.check-pr.outputs.pr_exists == ''
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/_terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Read node version from `.nvmrc` file
id: nvmrc
shell: bash
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Install required node.js version
uses: actions/setup-node@v3
Expand All @@ -39,7 +39,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -50,6 +50,11 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.10.4"

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra/cdktf
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/_terraform-plan-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Read node version from `.nvmrc` file
id: nvmrc
shell: bash
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Install required node.js version
uses: actions/setup-node@v3
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -52,6 +52,11 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.10.4"

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra/cdktf
Expand Down
45 changes: 41 additions & 4 deletions .github/workflows/_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Validate

on:
workflow_call:
inputs:
playwright_version:
description: Installed playwright version
required: false
default: "1.48.1"
type: string

jobs:
run-tests:
Expand All @@ -14,7 +20,7 @@ jobs:
- name: Read node version from `.nvmrc` file
id: nvmrc
shell: bash
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Install required node.js version
uses: actions/setup-node@v4
Expand Down Expand Up @@ -44,14 +50,40 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Install playwright
run: pnpm dlx [email protected] install --with-deps
- name: Cache Playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ inputs.playwright_version }}

- name: Install Playwright
run: pnpm dlx playwright@${{ inputs.playwright_version }} install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

# While most of the test suite is self-contained, the tests for the demo
# servers require a prod build of @atj/server.
- name: Build
run: pnpm build

- name: Make directory for build artifacts
run: mkdir -p output/build-artifacts


- name: Spotlight app performance budget
run: pnpm --filter @atj/spotlight size:ci > output/build-artifacts/spotlight-size-output.txt

- name: Design package performance budget
run: pnpm --filter @atj/design size:ci > output/build-artifacts/design-size-output.txt

- name: Upload size:ci results
uses: actions/upload-artifact@v4
with:
name: size-limit-results
path: |
output/build-artifacts/spotlight-size-output.txt
output/build-artifacts/design-size-output.txt
- name: Lint source code
shell: bash
run: pnpm lint
Expand All @@ -60,10 +92,15 @@ jobs:
shell: bash
run: AUTH_SECRET=not-super-secret pnpm test:ci

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.10.4"

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra/cdktf
run: |
cd infra/cdktf
pnpm cdktf get
pnpm build:tsc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/add-terraform-plan-to-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Post Terraform plan to PR comment
on:
pull_request:
branches:
- staging
- demo
- main
types:
- opened
- synchronize
- reopened

jobs:
add-terraform-plan-to-staging-pr:
add-terraform-plan-to-demo-pr:
uses: ./.github/workflows/_terraform-plan-pr-comment.yml
secrets: inherit
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-pr-to-staging.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Create PR from main to staging
name: Create PR from main to demo

on:
push:
branches:
- main

jobs:
create-pr-to-staging:
create-pr-to-demo:
uses: ./.github/workflows/_pr-create.yml
secrets: inherit
with:
base: staging
base: demo
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- staging
- demo
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.18.0
v22.12.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bookworm AS base
FROM node:22-bookworm AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ To run tests in watch mode (except the `infra` tests, which use Jest):
pnpm vitest
```

If you start having unexplained build errors, the following commands are useful to clean up and start fresh.

```bash
pnpm clean:dist # removes previously built files recursively
pnpm clean:modules # removes node_module directories recursively

# ... run more commands like pnpm install and pnpm build after you have run these
```


To start developing with hot reloading, use:

```bash
Expand Down
14 changes: 13 additions & 1 deletion apps/cli/src/cli-controller/secrets.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { promises as fs } from 'fs';
import path from 'path';
import { Command } from 'commander';

Expand Down Expand Up @@ -41,6 +42,17 @@ export const addSecretCommands = (ctx: Context, cli: Command) => {
await commands.setSecret(vault, key, value);
});

cmd
.command('set-bulk')
.description('sets secret values from a JSON file')
.argument('<string>', 'Source JSON file for secrets.')
.action(async inputFile => {
const vault = await getSecretsVault(ctx.file);
const maybeJsonString = (await fs.readFile(inputFile)).toString();
const secrets = JSON.parse(maybeJsonString);
await commands.setSecrets(vault, secrets);
});

cmd
.command('list')
.description('list all secret keys')
Expand All @@ -65,7 +77,7 @@ export const addSecretCommands = (ctx: Context, cli: Command) => {
'generate and save login.gov keypair; if it already exists, it is not ' +
'updated (future work might include adding key rotation)'
)
.argument('<deploy-env>', 'deployment environment (dev, staging)')
.argument('<deploy-env>', 'deployment environment (dev, demo)')
.argument('<app-key>', 'application key')
.action(async (env: DeployEnv, appKey: string) => {
const vault = await getSecretsVault(ctx.file);
Expand Down
22 changes: 19 additions & 3 deletions apps/spotlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,40 @@
"build": "astro build",
"clean": "rimraf dist tsconfig.tsbuildinfo coverage",
"dev": "astro dev",
"preview": "astro preview"
"preview": "astro preview",
"size": "pnpm build && size-limit",
"size:ci": "size-limit --json"
},
"size-limit": [
{
"path": "dist/_astro/*.css",
"limit": "50 kB"
},
{
"path": "dist/_astro/*.js",
"limit": "425 kB"
}
],
"dependencies": {
"@astrojs/react": "^3.6.1",
"@atj/common": "workspace:*",
"@atj/design": "workspace:*",
"@atj/forms": "workspace:*",
"astro": "^4.13.2",
"astro": "^4.16.18",
"qs": "^6.13.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-router-dom": "^6.26.0",
"sharp": "^0.33.5",
"zustand": "^4.5.4"
},
"devDependencies": {
"@astrojs/check": "^0.4.1",
"@size-limit/preset-app": "^11.1.6",
"@types/qs": "^6.9.15",
"@types/react": "^18.3.3"
"@types/react": "^18.3.3",
"sharp": "^0.33.5",
"size-limit": "^11.1.6"
}
}
5 changes: 5 additions & 0 deletions apps/spotlight/public/images/10x-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions apps/spotlight/public/images/gsa-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cbcc1cd

Please sign in to comment.