canonical / craft-application

The basis for *craft applications
https://canonical-craft-application.readthedocs-hosted.com/en/latest
GNU Lesser General Public License v3.0
5 stars 7 forks source link

fix: make project directory loading less strict. #229

Closed lengau closed 4 months ago

lengau commented 4 months ago

Some commands (e.g. init) might want to provide a project directory but not require it to exist. In these cases, we should only fail if what exists already is incompatible.


sergiusens commented 4 months ago

what use case is this for?

lengau commented 4 months ago

@sergiusens An example here is charmcraft's init command. I was overzealous checking for a nonexistent project directory and it ended up breaking a lot of spread tests (e.g. https://github.com/canonical/charmcraft/blob/main/tests/spread/smoketests/basic/task.yaml)

sergiusens commented 4 months ago

I am not certain this use case is a good one to allow for this though

lengau commented 4 months ago

@sergiusens by "this" are you referring to loading the project directory altogether in craft-application or only to the change here?

If the former, I think it's reasonable to roll back the entire change (we can implement it per-application) - the latter is necessary for the former though