-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support Platform CLI #763
base: main
Are you sure you want to change the base?
Support Platform CLI #763
Conversation
…riginal intention I believe)
79fe466
to
38922e1
Compare
38922e1
to
b6f626e
Compare
* main: Update obsolete GitHub Actions (#774)
@doshitan I see you merged main into this branch, but I was wondering if that's necessary. template-only-cd is supposed to do that automatically now, is that step not working as intended? |
There was a conflict on the auto merge: https://github.com/navapbc/template-infra/actions/runs/11705178511/job/32599329386 |
0125619
to
25904e1
Compare
Not a normal template
Once this PR is merged, things should use `main`/whatever branch it's running from.
Tracked as TODO on the PR
Since platform-cli defaults to `lorenyu/platform-cli` branch still. This should keep things working through the transition period.
* main: Deploy to pfml-starter-kit-app as a part of CD
By specifying `_exclude` in `copier.yml`, we need to re-add the relevant default excludes to the list (`.git` and `copier.yml`). https://copier.readthedocs.io/en/stable/configuring/#exclude
Ticket
Resolves #691
Changes
A new tool, the Platform CLI[1], has been developed to replace the existing install/update scripts. It currently utilizes the copier[2] library to drive most of the logic. Copier by design really prefers one-repo = one-template, which is not quite how we have
template-infra
setup. So the Platform CLI has special logic to treat this repo as effectively two different templates, "base" and "app":{{app_name}}
in the file pathTo support this new tool, a variety of changes are necessary, notable ones being:
copier.yml
config file which holds the questions for templating, with only questions relevant to "base" or "app" templates being asked and saved during the relevant install/update phasesproject-config
is now configuration on the "base" templateapp_has_dev_env_setup
answer, rather than manually finding and un-commenting bits of code.template-infra/
folder to hold the answers files that copier generates in projects{{app_name}}
.github/workflows/ci-infra-service.yml
(and associatedinfra/test/infra_test.go
) to become parameterized/setup per-app (inci-{{app_name}}-infra-service.yml.jinja
)infra/test/infra_test.go
/health
endpoint instead of/
for check since all apps are required to have a health endpoint but not required to respond to a root requestenable_https
.infra/app
to now referenceinfra/<APP_NAME>
(and normalize most of the docs to use<APP_NAME>
as the placeholder for this, instead of the mix of things we were using before)app/
totemplate-only-app/
. Places wanting to use it as their example app for testing can copytemplate-only-app/
to the appropriate app-named directory..github/workflows/template-only-ci-infra.yml
to use the Platform CLI to install the template with example app and run tests against that. Necessitates thetemplate_infra_test.go
changes.infra/networks/main.tf.jinja
with the installed apps[1] https://github.com/navapbc/platform-cli
[2] https://copier.readthedocs.io/en/stable/
Context for reviewers
TODO:
base_<foo>
? Then the CLI tool could read the base answers and auto populate them for "app" stuff? Ideally we'd separate the base and app infra templates to make this cleaner, but in the interim maybe do that? Move "app" questions to anapp_
prefix?app/
. Maybeexample-app/
ortemplate-only-app/
.github/workflows/README.md
,docs/infra/pull-request-environments.md
) to point to blob/main before mergeThe
Template CI Infra Checks / Infra Tests
CI failures are due to #781, the CI was passing before the AWS changes.Potentially resolves #447 (depending on the final decided scope for that ticket)
Potentially resolves #557
Potentially resolves #478
Resolves #569
Resolves #647
Testing
This repo's CD has been updated to use the Platform CLI tool and this branch: https://github.com/navapbc/template-infra/blob/main/.github/workflows/template-only-cd.yml
WIP on getting
pfml-starter-kit-app
using the Platform CLI tool and this branch: https://github.com/navapbc/pfml-starter-kit-app/pull/223And the cleaner
pfml-starter-kit-app
upgrade PR: https://github.com/navapbc/pfml-starter-kit-app/pull/225