Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

configure should validate that all dependecies exists #75

Open
vieiralucas opened this issue Sep 11, 2023 · 2 comments · May be fixed by #97
Open

configure should validate that all dependecies exists #75

vieiralucas opened this issue Sep 11, 2023 · 2 comments · May be fixed by #97
Assignees
Labels
bug Something isn't working

Comments

@vieiralucas
Copy link
Member

Bug

If I write a layerform.json like this:

{
  "layers": [
    {
      "name": "foo",
      "files": ["foo.tf"]
    },
    {
      "name"  : "bar",
      "files": ["bar.tf"],
      "dependencies": ["foo", "this_layer_does_not_exist"]
    },
    {
      "name"  : "baz",
      "files": ["baz.tf"],
      "dependencies": ["foo"]
    }
  ]
}

Then run layerform configure on this file, layerform will just panic. See video below:

configure-panic.mov

Solution

We should not assume that all layer listed in dependencies array always exists, we should check if that is the case and fail with a good error message to the user.

This validation can be performed in this method:
https://github.com/ergomake/layerform/blob/a4f6211eb76c602ca5ad8f6429d0afa531499d48/internal/layerfile/layerfile.go#L37

@vieiralucas vieiralucas added the bug Something isn't working label Sep 11, 2023
@rafiramadhana
Copy link
Contributor

@vieiralucas Hi, can I work on this? Thanks

@vieiralucas
Copy link
Member Author

Yes @rafiramadhana, let me know if you need some guidance. Thank you in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants