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

Proposal: CLI command checking missing secrets against environments #605

Open
pksieminski opened this issue Feb 7, 2023 · 9 comments · May be fixed by #1017
Open

Proposal: CLI command checking missing secrets against environments #605

pksieminski opened this issue Feb 7, 2023 · 9 comments · May be fixed by #1017
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pksieminski
Copy link

pksieminski commented Feb 7, 2023

General idea is to use this new command in GitHub Workflows, which would allow us to check PR before merge if all secrets for development and production environments are properly set in Encore.

Right now it is possible to get very late feedback loop if for example you set the secrets only on development environment and after some time you deploy to production, where it fails on deploy step.

With new command, which would list missing secrets & error if any is missing:
encore secret check [envs...]

Example usage:

encore secret check prod dev
Secret Key Production   Development 
MySecret   ✗                   ✓

Error: There is 1 secret missing.
@eandre eandre added enhancement New feature or request good first issue Good for newcomers labels Feb 20, 2023
@aneshas
Copy link

aneshas commented May 6, 2023

Hey, if this one is still up for grabs I would like to take it.

@aneshas
Copy link

aneshas commented Jan 20, 2024

Hey @pksieminski @eandre

Since secrets list already pretty much does everything listed here apart from reporting an error, I was wondering if it makes sense to instead add a flag to the list command eg:

list --compare-envs=prod,dev (or whatever flag name makes more sense eg. --report-inconsistent ...)

which would then additionally exit with an error.
I know it would not be as explicit as having a separate check command but just wanted to bring it up.

Let me know what you think.

@aneshas
Copy link

aneshas commented Jan 26, 2024

Actually, now looking at what you initially wrote:

General idea is to use this new command in GitHub Workflows, which would allow us to check PR before merge if all secrets for development and production environments are properly set in Encore.

Does it then even make sense to provide environments as arguments since judging by the requirement we always want to compare dev <-> prod environments ?

@eandre
Copy link
Member

eandre commented Jan 26, 2024

The desired behavior isn't really about comparing environments. It should accept a list of environment types and report whether any secret doesn't have a value for any of the provided environment types. (If no environment types are provided it would default to check all environment types)

@aneshas
Copy link

aneshas commented Jan 26, 2024

Ok makes sense, but still, the reason I am asking is as far as I know (correct me if I am wrong), currently there are only two environment types as defined here ?

So the only possible combination is dev prod ...

I get it if we want to cover future cases where we would have more environment types but I do hope you see my confusion?

Thanks

@eandre
Copy link
Member

eandre commented Jan 26, 2024

No, secrets can be configured for four different environment types (local, PR envs, dev, and prod). See https://encore.dev/docs/primitives/secrets

@aneshas
Copy link

aneshas commented Jan 26, 2024

Now it makes more sense ;)

@aneshas aneshas linked a pull request Jan 27, 2024 that will close this issue
@aneshas
Copy link

aneshas commented Jan 30, 2024

Hey, I submitted a PR

@aneshas
Copy link

aneshas commented Mar 22, 2024

Hey, just wanted to follow up - are we gonna move forward with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants