Ensure compose.**.yml files are validated #254

Closed
opened 2021-11-21 14:22:18 +00:00 by decentral1se · 3 comments
Owner

Describe the current behavior

Upstream validation isn't great. Broken compose files get deployed. Some things get handled, some things not. E.g. no image: ... doesn't get caught but a missing version: ... does?

➜  abra (main) ✔ ./abra app deploy --force --chaos git.autonomic.zone                
WARN[0000] 'gitea' is already deployed but continuing (--force/--chaos) 
WARN[0000] chaos mode engaged                           
FATA[0000] unsupported Compose file version: 1.0    

This also has a confusing error message (I simply removed version: ... from the gitea recipe compose config...). That could be improved also.

Steps to reproduce

#243 (comment)

Describe the expected behavior

abra bails out if anything is broken in the compose config.

Any idea how this might be fixed?

Idk because we're just running 9bc104eff0/cli/compose/schema/schema.go (L63-L83) and that loads https://github.com/docker/cli/blob/master/cli/compose/schema/data/config_schema_v3.8.json which then is perhaps wrong or they had a good reason to avoid setting required properties like image: ...? It looks right tho?

We could override fdf4fc6737/pkg/upstream/stack/loader.go (L29-L36) and give a better error message anyway.

## Describe the current behavior Upstream validation isn't great. Broken compose files get deployed. Some things get handled, some things not. E.g. no `image: ...` doesn't get caught but a missing `version: ...` does? ``` ➜ abra (main) ✔ ./abra app deploy --force --chaos git.autonomic.zone WARN[0000] 'gitea' is already deployed but continuing (--force/--chaos) WARN[0000] chaos mode engaged FATA[0000] unsupported Compose file version: 1.0 ``` This also has a confusing error message (I simply removed `version: ...` from the gitea recipe compose config...). That could be improved also. ## Steps to reproduce https://git.coopcloud.tech/coop-cloud/organising/issues/243#issuecomment-10434 ## Describe the expected behavior `abra` bails out if anything is broken in the compose config. ## Any idea how this might be fixed? Idk because we're just running https://github.com/docker/cli/blob/9bc104eff0798097954f5d9bc25ca93f892e63f5/cli/compose/schema/schema.go#L63-L83 and that loads https://github.com/docker/cli/blob/master/cli/compose/schema/data/config_schema_v3.8.json which then is perhaps wrong or they had a good reason to avoid setting required properties like `image: ...`? It looks right tho? We could override https://git.coopcloud.tech/coop-cloud/abra/src/commit/fdf4fc6737b3e3203508d8b3cbc0bf22cdeda92c/pkg/upstream/stack/loader.go#L29-L36 and give a better error message anyway.
decentral1se added this to the UI / UX testing milestone 2021-11-21 14:22:18 +00:00
decentral1se added the
bug
abra
labels 2021-11-21 14:22:18 +00:00
decentral1se added this to the Beta release (software) project 2021-11-21 14:22:19 +00:00
Author
Owner

We could just re-use the logic from abra recipe lint to do our own validation 🤔

We could just re-use the logic from `abra recipe lint` to do our own validation 🤔
Owner

We could just re-use the logic from abra recipe lint to do our own validation 🤔

Love it. Maybe we'd want to have recipe lint know the difference between a critical error like missing image: and a warning like use of latest tag?

> We could just re-use the logic from `abra recipe lint` to do our own validation 🤔 Love it. Maybe we'd want to have `recipe lint` know the difference between a critical error like missing `image:` and a warning like use of `latest` tag?
Author
Owner
https://git.coopcloud.tech/coop-cloud/abra/commit/a84a5bc320c2c3ade99cfffc3968ce9580af3e84 https://git.coopcloud.tech/coop-cloud/abra/commit/8735a8f0eaf29d54afd957ab8d772f3e82b7e566
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
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/organising#254
No description provided.