canonical / craft-application

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

fix: do not process non-grammar keywords #330

Closed mr-cal closed 5 months ago

mr-cal commented 5 months ago

Another grammar-related fix.

This is caused by this line augmenting data for non-grammar keywords.

It was causing errors like this:

Bad snapcraft.yaml content:
- value is not a valid list (in field 'parts.gnome-calculator.meson-parameters')
Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240429-201308.751985.log'

My solution is not to process grammar for non-grammar keywords.

mr-cal commented 5 months ago

Is snapcraft passing with this?

Yes, I'm testing with this branch here: https://github.com/canonical/snapcraft/pull/4768

I'm not crazy about the path this grammar handling is going (looks like it's getting more complicated instead of less) but I don't think there's much we can do in a bugfix release, so I'm ok with this

Neither am I, this code was already hard to read to begin with...

mr-cal commented 5 months ago

If I rewrote this function, I would simplify it by splitting up the processing of dictionaries, lists, and strings.

mr-cal commented 5 months ago

CI failures unrelated, they are caused by a ruff update