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

Deploy to staging #264

Merged
merged 11 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Story
about: Suggest a user story for this product
title: ''
labels: story
assignees: ''
projects: ['GSA-TTS/17']
---

## Overview

As a _, I would like _, so that I can _.

## Context

*Optional: Any reference material or thoughts we may need for later reference, or assumptions of prior or future work that's out of scope for this story.*

- [ ]

## Acceptance Criteria

*Required outcomes of the story*

- [ ]

## Research Questions

- *Optional: Any initial questions for research*

## Tasks

*Research, design, and engineering work needed to complete the story.*

- [ ]

## Definition of done

The "definition of done" ensures our quality standards are met with each bit of user-facing behavior we add. Everything that can be done incrementally should be done incrementally, while the context and details are fresh. If it’s inefficient or “hard” to do so, the team should figure out why and add OPEX/DEVEX backlog items to make it easier and more efficient.

- [ ] Behavior
- [ ] Acceptance criteria met
- [ ] Implementation matches design decisions
- [ ] Documentation
- [ ] ADRs (`/documents/adr` folder)
- [ ] Relevant `README.md`(s)
- [ ] Code quality
- [ ] Code refactored for clarity and no design/technical debt
- [ ] Adhere to separation of concerns; code is not tightly coupled, especially to 3rd party dependencies; dependency rule followed
- [ ] Code is reviewed by team member
- [ ] Code quality checks passed
- [ ] Security and privacy
- [ ] Automated security and privacy gates passed
- [ ] Testing tasks completed
- [ ] Automated tests pass
- [ ] Unit test coverage of our code >= 90%
- [ ] Build and deploy
- [ ] Build process updated
- [ ] API(s) are versioned
- [ ] Feature toggles created and/or deleted. Document the feature toggle
- [ ] Source code is merged to the main branch

## Decisions

- *Optional: Any decisions we've made while working on this story*
12 changes: 12 additions & 0 deletions .github/workflows/_end-to-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: End-to-end tests
on:
workflow_call:
jobs:
end-to-end:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker to run tests
run: |
docker build --platform linux/amd64 --tag 'playwright' . -f ./e2e/Dockerfile --target test
39 changes: 0 additions & 39 deletions .github/workflows/_playwright.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/_terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
Expand All @@ -53,7 +52,7 @@ jobs:

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
pnpm cdktf get
pnpm build:tsc
Expand All @@ -68,7 +67,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
cf api https://api.fr.cloud.gov
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf deploy --auto-approve
9 changes: 4 additions & 5 deletions .github/workflows/_terraform-plan-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
Expand All @@ -55,7 +54,7 @@ jobs:

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
pnpm cdktf get
pnpm build:tsc
Expand All @@ -70,19 +69,19 @@ jobs:
cf api https://api.fr.cloud.gov

- name: Synthesize Terraform configuration
working-directory: infra
working-directory: infra/cdktf
run: |
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf synth

- name: Get Terraform stack name
id: get_stack_name
working-directory: infra
working-directory: infra/cdktf
run: |
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf output --outputs-file outputs.json
echo "stack_name=$(jq -r 'keys[0]' outputs.json)" >> $GITHUB_OUTPUT

- name: Create Terraform plan
uses: dflook/terraform-plan@v1
with:
path: infra/cdktf.out/stacks/${{ steps.get_stack_name.outputs.stack_name }}
path: infra/cdktf/cdktf.out/stacks/${{ steps.get_stack_name.outputs.stack_name }}
label: ${{ steps.get_stack_name.outputs.stack_name }}
15 changes: 7 additions & 8 deletions .github/workflows/_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ jobs:
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)

- name: Install required node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}

- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
Expand All @@ -34,7 +33,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 @@ -56,19 +55,19 @@ jobs:

- name: Run test suite
shell: bash
run: pnpm test:ci
run: AUTH_SECRET=not-super-secret pnpm test:ci

- name: Initialize Terraform CDK configuration
shell: bash
run: |
cd infra
cd infra/cdktf
pnpm cdktf get
pnpm build:tsc

- name: Typecheck source code
shell: bash
run: pnpm typecheck

#- name: Vitest Coverage Report
# if: always()
# uses: davelosert/vitest-coverage-report-action@v2.2.0
# - name: Vitest Coverage Report
# if: always()
# uses: davelosert/vitest-coverage-report-action@v2.5.0
2 changes: 1 addition & 1 deletion .github/workflows/add-terraform-plan-to-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
uses: ./.github/workflows/_terraform-plan-pr-comment.yml
secrets: inherit
with:
deploy-env: staging
deploy-env: ${{ github.base_ref }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
uses: ./.github/workflows/_terraform-apply.yml
secrets: inherit
with:
deploy-env: ${{ github.ref_name }}
deploy-env: ${{ github.ref_name }}
3 changes: 1 addition & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ jobs:
run-tests:
uses: ./.github/workflows/_validate.yml
e2e:
needs: [run-tests]
uses: ./.github/workflows/_playwright.yml
uses: ./.github/workflows/_end-to-end.yml
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.env
.pnpm-store/
*.code-workspace
_site
.turbo/
Expand Down
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
pnpm lint
pnpm format
pnpm test
pnpm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.15.0
v20.16.0
8 changes: 3 additions & 5 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# @atj/cli-app

This package includes a very simple command-line interface.
This package defines the platform's command-line interface.

## Example commands

Examples:
Commands are defined to aid with platform management operations. To see available commands, run:

```bash
pnpm run cli create-workspace-graph
pnpm cli --help
```

## Development
Expand Down
14 changes: 14 additions & 0 deletions apps/cli/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const esbuild = require('esbuild');

esbuild
.build({
bundle: true,
entryPoints: ['./src/index.ts'],
format: 'cjs',
minify: true,
outdir: './dist',
platform: 'node',
sourcemap: true,
target: 'es2020',
})
.catch(() => process.exit(1));
8 changes: 5 additions & 3 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
"name": "@atj/cli-app",
"version": "1.0.0",
"description": "10x ATJ command-line interface",
"type": "commonjs",
"type": "module",
"license": "CC0",
"main": "src/index.ts",
"scripts": {
"build": "echo 'skipping...' #tsc -p .",
"cli": "ts-node src/index.ts",
"build": "tsup src/* --format esm",
"clean": "rimraf dist tsconfig.tsbuildinfo coverage",
"cli": "node dist/index.js",
"dev": "tsup src/* --watch",
"test": "vitest run --coverage"
},
"dependencies": {
"@atj/dependency-graph": "workspace:*",
"@atj/infra-core": "workspace:*",
"commander": "^11.1.0"
}
}
62 changes: 0 additions & 62 deletions apps/cli/src/cli-controller.ts

This file was deleted.

Loading
Loading