-
Notifications
You must be signed in to change notification settings - Fork 21
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
nava-platform infra update --version platform-cli-migration/v0.13 #3925
Draft
coilysiren
wants to merge
31
commits into
main
Choose a base branch
from
kai/v0.13
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,155
−827
Draft
Changes from 13 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2e0ede1
nava-platform infra update-base --version platform-cli-migration/v0.1…
coilysiren e611b09
variables working
coilysiren eb5114c
...stuff?
coilysiren da0c6fc
Delete .github/workflows/e2e-tests.yml
coilysiren 98b6946
git restore
coilysiren cea3707
Merge branch 'main' into kai/v0.13
coilysiren 65df192
reverts load balancer changes
coilysiren b09a62e
reverts load balancer changes
coilysiren 5976725
reverts load balancer changes
coilysiren 15163a2
force ssl
coilysiren 20bdd10
appease checkov
coilysiren 9819b9d
revert
coilysiren 5b9a756
Merge branch 'main' into kai/v0.13
coilysiren b968293
nava-platform infra update-app --version platform-cli-migration/v0.13…
coilysiren 4761947
nava-platform infra update-app --version platform-cli-migration/v0.13…
coilysiren c87545b
nava-platform infra update-app --version platform-cli-migration/v0.13…
coilysiren a580bfc
resolve ci conflicts
coilysiren af09d97
resolves merge conflicts
coilysiren 4138af8
fix duplicate IO
coilysiren 8ff4563
Delete .github/workflows/ci-analytics-pr-environment-checks.yml
coilysiren 28d517a
Delete .github/workflows/ci-analytics-pr-environment-destroy.yml
coilysiren 3b365b0
Delete .github/workflows/ci-api-pr-environment-checks.yml
coilysiren a804ab7
Delete .github/workflows/ci-api-pr-environment-destroy.yml
coilysiren 102b646
Delete .github/workflows/pr-environment-checks.yml
coilysiren 4b06967
Delete .github/workflows/pr-environment-destroy.yml
coilysiren 9f41bf4
remove e2es
coilysiren e1d7754
Merge remote-tracking branch 'origin' into kai/v0.13
coilysiren 217ff48
fixes
coilysiren d926958
puts env vars back
coilysiren dfce233
puts more secrets back
coilysiren 5881cf0
puts final set of secrets back
coilysiren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# This workflow checks the status of infrastructure deployments to see whether | ||
# infrastructure code configuration matches the actual state of the infrastructure. | ||
# It does this by checking that Terraform plans show an empty diff (no changes) | ||
# across all root modules and backend configurations. | ||
name: Check infra deploy status | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Run every day at 07:00 UTC (3am ET, 12am PT) after engineers are likely done with work | ||
- cron: "0 7 * * *" | ||
|
||
jobs: | ||
collect-configs: | ||
name: Collect configs | ||
runs-on: ubuntu-latest | ||
outputs: | ||
root_module_configs: ${{ steps.collect-infra-deploy-status-check-configs.outputs.root_module_configs }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Collect root module configurations | ||
id: collect-infra-deploy-status-check-configs | ||
run: | | ||
root_module_configs="$(./bin/infra-deploy-status-check-configs)" | ||
echo "${root_module_configs}" | ||
echo "root_module_configs=${root_module_configs}" >> "$GITHUB_OUTPUT" | ||
check: | ||
name: ${{ matrix.root_module_subdir }} ${{ matrix.backend_config_name }} | ||
runs-on: ubuntu-latest | ||
needs: collect-configs | ||
|
||
# Skip this job if there are no root module configurations to check, | ||
# otherwise the GitHub actions will give the error: "Matrix must define at least one vector" | ||
if: ${{ needs.collect-configs.outputs.root_module_configs != '[]' }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJson(needs.collect-configs.outputs.root_module_configs) }} | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.8.3 | ||
terraform_wrapper: false | ||
|
||
- name: Configure AWS credentials | ||
uses: ./.github/actions/configure-aws-credentials | ||
with: | ||
account_name: ${{ matrix.infra_layer == 'accounts' && matrix.account_name || null }} | ||
network_name: ${{ matrix.infra_layer == 'networks' && matrix.backend_config_name || null }} | ||
app_name: ${{ contains(fromJSON('["build-repository", "database", "service"]'), matrix.infra_layer) && matrix.app_name || null }} | ||
environment: ${{ contains(fromJSON('["build-repository", "database", "service"]'), matrix.infra_layer) && matrix.backend_config_name || null }} | ||
|
||
- name: Check Terraform plan | ||
run: | | ||
echo "::group::Initialize Terraform" | ||
echo terraform -chdir="infra/${{ matrix.root_module_subdir }}" init -input=false -reconfigure -backend-config="${{ matrix.backend_config_name }}.s3.tfbackend" | ||
terraform -chdir="infra/${{ matrix.root_module_subdir }}" init -input=false -reconfigure -backend-config="${{ matrix.backend_config_name }}.s3.tfbackend" | ||
echo "::endgroup::" | ||
|
||
echo "::group::Check Terraform plan" | ||
echo terraform -chdir="infra/${{ matrix.root_module_subdir }}" plan -input=false -detailed-exitcode ${{ matrix.extra_params }} | ||
terraform -chdir="infra/${{ matrix.root_module_subdir }}" plan -input=false -detailed-exitcode ${{ matrix.extra_params }} | ||
echo "::endgroup::" | ||
env: | ||
TF_IN_AUTOMATION: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: PR Environment Update | ||
run-name: Update PR Environment ${{ inputs.pr_number }} | ||
on: | ||
workflow_call: | ||
inputs: | ||
app_name: | ||
required: true | ||
type: string | ||
environment: | ||
required: true | ||
type: string | ||
pr_number: | ||
required: true | ||
type: string | ||
commit_hash: | ||
required: true | ||
type: string | ||
jobs: | ||
build-and-publish: | ||
name: " " # GitHub UI is noisy when calling reusable workflows, so use whitespace for name to reduce noise | ||
uses: ./.github/workflows/build-and-publish.yml | ||
with: | ||
app_name: ${{ inputs.app_name }} | ||
ref: ${{ inputs.commit_hash }} | ||
|
||
update: | ||
name: Update environment | ||
needs: [build-and-publish] | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
pull-requests: write # Needed to comment on PR | ||
repository-projects: read # Workaround for GitHub CLI bug https://github.com/cli/cli/issues/6274 | ||
|
||
concurrency: pr-environment-${{ inputs.pr_number }} | ||
|
||
outputs: | ||
service_endpoint: ${{ steps.update-environment.outputs.service_endpoint }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.8.3 | ||
terraform_wrapper: false | ||
|
||
- name: Configure AWS credentials | ||
uses: ./.github/actions/configure-aws-credentials | ||
with: | ||
app_name: ${{ inputs.app_name }} | ||
environment: ${{ inputs.environment }} | ||
|
||
- name: Update environment | ||
id: update-environment | ||
run: | | ||
./bin/update-pr-environment "${{ inputs.app_name }}" "${{ inputs.environment }}" "${{ inputs.pr_number }}" "${{ inputs.commit_hash }}" | ||
service_endpoint=$(terraform -chdir="infra/${{ inputs.app_name }}/service" output -raw service_endpoint) | ||
echo "service_endpoint=${service_endpoint}" | ||
echo "service_endpoint=${service_endpoint}" >> "$GITHUB_OUTPUT" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
e2e-tests: | ||
name: " " # GitHub UI is noisy when calling reusable workflows, so use whitespace for name to reduce noise | ||
needs: [update] | ||
uses: ./.github/workflows/e2e-tests.yml | ||
with: | ||
service_endpoint: ${{ needs.update.outputs.service_endpoint }} | ||
app_name: ${{ inputs.app_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: PR Environment Destroy | ||
run-name: Destroy PR Environment ${{ inputs.pr_number }} | ||
on: | ||
workflow_call: | ||
inputs: | ||
app_name: | ||
required: true | ||
type: string | ||
environment: | ||
required: true | ||
type: string | ||
pr_number: | ||
required: true | ||
type: string | ||
jobs: | ||
destroy: | ||
name: Destroy environment | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
pull-requests: write # Needed to comment on PR | ||
repository-projects: read # Workaround for GitHub CLI bug https://github.com/cli/cli/issues/6274 | ||
|
||
concurrency: pr-environment-${{ inputs.pr_number }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.8.3 | ||
terraform_wrapper: false | ||
|
||
- name: Configure AWS credentials | ||
uses: ./.github/actions/configure-aws-credentials | ||
with: | ||
app_name: ${{ inputs.app_name }} | ||
environment: ${{ inputs.environment }} | ||
|
||
- name: Destroy environment | ||
run: ./bin/destroy-pr-environment "${{ inputs.app_name }}" "${{ inputs.environment }}" "${{ inputs.pr_number }}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Changes here will be overwritten by Copier | ||
_commit: platform-cli-migration/v0.10.0 | ||
_commit: platform-cli-migration/v0.13.0 | ||
_src_path: https://github.com/navapbc/template-infra | ||
template: base |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to test via deploying every app