Open MangelMaxime opened 1 year ago
This is as expected. The default configuration is a fixed set of folders, but it would be a bit demanding to require that all of the folders exist, even if they do not make sense for a particular user (see https://erikbra.github.io/grate/folder-configuration/#default-folder-configuration).
It might be an idea to introduce a --strict
, --validate
, --fail-on-missing-folders
option, if there are more people needing it. Do you think this would be a useful, much used feature?
@erikbra I understand that grate by default as some pre defined folders. When doing dotnet grate --folders <path to a folder>
doesn't the users say all the files/folders should be under <path to a folder>
?
If yes, I think it is a good idea to warn the user that nothing was found. To me it was not immediately obvious that I mess up something, perhaps do to the fact that grate is kind of verbose and also everything was in green which kind of biased me :).
If I need to use a flag to activate this behaviour because it is against grate philosophy, I will take that for sure :)
I do see your point, @MangelMaxime. Maybe we could output a warning if the verbosity level is one of the higher ones?
@erikbra Having the using need to increase the verbosity level means that this is not "supported" out of the box.
And I think that it is a bit too indirect to hide this report behind the verbosity level. Personally, I almost never increase verbosity level of the tool I use.
If the choice is between hiding the feature behind a verbosity level or having a dedicated flag. I think having the dedicated flag is better in term of discoverability.
I often use RoundhousE (the predecessor) against partial folder strcutures, sometimes our db repos don't have certain folders. I'm planning to migrate to grate, and this would be a no deal for me if it erros whena single follder is missing.
I like the idea of flags to validate, but only if it's actually a valid requirement.
@willsmith9182 IHMO there is a difference in:
From what I understood unfortunately the second case is not inlined with Grate philosophy. Therefore, the idea of ussing --strict
flag to opt-in in generating errors if a folder is missing when asked by the user.
But indeed, the idea is to keep the compatibility with the predecessor project.
To sum up, @MangelMaxime and @willsmith9182 - would this approach work for you both?
@erikbra For me this work yes 👍
Describe the bug
If a folder is invalid Grate "just" skip it and return a successful error code.
To Reproduce
Run
dotnet grate --connectionstring "XXX" --folders thisFolderDoesnTExist --noninteractive
and see that print:Expected behavior A clear and concise description of what you expected to happen.
I think Grate should fail if an expected folder doesn't exist. It took me 30min to understand why I didn't have any tables created in my database even if Grave was saying all is fine.
It was both due to the fact that an invalid folder is not an error and that the output was green (tracked here #282)
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):