app check should use diff command for two-way checks #36

Open
opened 2020-11-05 14:23:34 +00:00 by decentral1se · 5 comments
Owner

When the upstream .envrc.sample is edited then some of the env vars change. The "downstream" in this case is usually your ~/.abra/servers/... env vars configuration. They are out of sync.

For example, when I edited the coop-cloup/foodsoft repo env vars, then my local ~/.abra/servers/$domain/$domain foodsoft env var configuration was not updated.

It would be cool to do an env var match (e.g. require_env_var_match) on both the app env vars and the server domain env vars (just name will do) to make sure things are in sync. Manual editing can resolve for now. Just a warning and then erroring out should do it

When the upstream `.envrc.sample` is edited then some of the env vars change. The "downstream" in this case is usually your `~/.abra/servers/...` env vars configuration. They are out of sync. For example, when I edited the `coop-cloup/foodsoft` repo env vars, then my local `~/.abra/servers/$domain/$domain` foodsoft env var configuration was not updated. It would be cool to do an env var match (e.g. `require_env_var_match`) on both the app env vars and the server domain env vars (just name will do) to make sure things are in sync. Manual editing can resolve for now. Just a warning and then erroring out should do it
decentral1se changed title from Syncing ~/.abra/apps/$app env vars with ~/.abra/servers/$server/$domain config env vars to Syncing ~/.abra/apps/$app env vars with ~/.abra/servers/$server/$domain env vars 2020-11-05 14:23:49 +00:00
Owner
$ abra app cloud.domain.com check
ERROR: Found missing variables: 
FOOBAR

(remove export FOOBAR from the file)

$ abra app cloud.doesthisthing.work check
Yay! All the necessary basic variables are defined

Using a brittle regex, maybe a candidate for #34 ..

``` $ abra app cloud.domain.com check ERROR: Found missing variables: FOOBAR ``` (remove `export FOOBAR` from the file) ``` $ abra app cloud.doesthisthing.work check Yay! All the necessary basic variables are defined ``` Using a brittle regex, maybe a candidate for #34 ..
Author
Owner

Awesome, thank you! I think one final thing to think about is how to show which is out of sync? You have your tempoate repo env var file and your server env var file, either one could be out of sync for $reasons. So, I guess a "in this file ..." message added would help point out the inconsistency.

Awesome, thank you! I think one final thing to think about is how to show which is out of sync? You have your tempoate repo env var file and your server env var file, either one could be out of sync for $reasons. So, I guess a "in this file ..." message added would help point out the inconsistency.
decentral1se changed title from Syncing ~/.abra/apps/$app env vars with ~/.abra/servers/$server/$domain env vars to abra app $domain check 2020-11-08 14:23:18 +00:00
Author
Owner

Oh, found another issue: if you leave out # length=$whatever in one of the env var files the regex thinks they don't match and complains but actually the env var is in place? Maybe it could be worth just running instead a diff on the two files because there can be many $reasons it is out of sync?

Oh, found another issue: if you leave out `# length=$whatever` in one of the env var files the regex thinks they don't match and complains but actually the env var is in place? Maybe it could be worth just running instead a diff on the two files because there can be many $reasons it is out of sync?
Owner

I think one final thing to think about is how to show which is out of sync?

Currently it just checks for vars which are in .envrc.sample and not in $ENV_FILE.

If we wanted to verify the converse, that there aren't any extra vars in $ENV_FILE which aren't in .envrc.sample (which I think is maybe what you're suggesting) then a) we need to parse optional vars from .envrc.sample because e.g. EXTRA_DOMAINS is commented out by default and b) we could probably use diff instead of comm.

Thoughts?

> I think one final thing to think about is how to show which is out of sync? Currently it just checks for vars which are in `.envrc.sample` and not in `$ENV_FILE`. If we wanted to verify the converse, that there aren't any extra vars in `$ENV_FILE` which aren't in `.envrc.sample` (which I think is maybe what you're suggesting) then a) we need to parse optional vars from `.envrc.sample` because e.g. `EXTRA_DOMAINS` is commented out by default and b) we could probably use `diff` instead of `comm`. Thoughts?
Author
Owner

Let's diff! :)

Let's diff! :)
decentral1se changed title from abra app $domain check to app check should use `diff` command for two-way checks 2020-12-29 13:02:45 +00:00
decentral1se added the
enhancement
label 2020-12-29 13:13:48 +00:00
decentral1se added this to the Beta release milestone 2021-03-04 16:12:11 +00:00
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/abra#36
No description provided.