-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
censorProjectWarnings in monorepo workspace spago.yaml
#1316
base: master
Are you sure you want to change the base?
censorProjectWarnings in monorepo workspace spago.yaml
#1316
Conversation
No, that's just a warning. The real error is further down below, this one:
|
Isn't that error caused by it not being able to parse
|
Almost: Spago is supposed to ignore configurations that are in subfolders with respect to configurations that contain a Lines 246 to 248 in 1060f46
We might have to fix this detection bug here. |
Ah yea that makes sense -
So Maybe here for Otherwise maybe we could make the decoder ignore unknown fields and log the warning in |
Hmm good points. @fsoikin any preferences/suggestions on this? |
Let me make sure I understand the problem correctly. In a subdirectory there may be a config file belonging to a different (presumably newer) version of Spago, which we would fail to read, and as a result consider all its projects part of the top workspace? |
@fsoikin yes - more specifically, here "fail to parse" means that we reject extra fields that are present in new versions of the config file, which we parsed correctly before #1272. I wouldn't like to roll that patch back, so @noisyscanner mentioned, we have two options here:
I am leaning towards option 2 since it would be cheap both performance-wise and code-wise, but looking for things I might have missed here. |
I see a few more options.
My choice would be option 4. I think it's totally reasonable to error out in this case. What would be a real-world scenario where there is an unreadable My second choice would be option 5. It's kind of like option 4, in that it may lead to errors due to unparseable Options 2 and 3 I don't like at all. Not only are they very labour-intensive, but they also feel like band-aids, fixing just the current symptom, and not addressing the deeper problem. |
Makes a lot of sense - 2 and 3 are a lot of work for what should be a fairly uncommon case, and with 4 you are going to find out straight away if your config is broken for whatever reason. Sounded like 1 is worth doing as well either way so I added that to this PR, like you say it shouldn't be going into those dirs anyway. That should sort the CI. As for 4, happy to also add that here or open another PR if you'd prefer |
There is already a PR that retractors config discovery quite a bit: #1310 It would be trivial to add either option 4 or option 5 there, which I'll do as soon as we come to a consensus. |
@noisyscanner the bug is related to this PR: we are changing the configuration format in a way that is not forwards-compatible. I would like Spago to be robust against this kind of configuration format evolution (which is something that we didn't do in the previous codebase, and came back to bite us), so we should handle that case. In this direction I would like to have the dummy
My preferred option would be 5, because as I said above we should be able to fail gracefully. The "automatic traversal of subfolder" is a feature that is not welcome by everyone, so we should be careful to handle all the edge cases gracefully. A real world scenario (that happened to me at some point) could be multi-backend projects that need different spago versions (and compiler versions, etc) because they are dealing with different enough ecosystems. |
Then it is agreed. Option 5 shall be implemented in #1310 ere next sunrise. |
Done: 171b93f |
This reverts commit 0979c30.
Thanks both - I've reverted adding |
Closes #1311
Description of the change
Allows
censorProjectWarnings
to be specified in a workspaces'sspago.yaml
and apply to all packages in a workspace.Can override it in a package's own
spago.yaml
either toall
or[]
to censor no warnings for that particular workspace.Checklist:
README