Tweak coreos block in greenwave config to avoid newline issues #2462

Merged
ryanlerch merged 1 commit from greenwave-coreos-newline-fix into main 2025-02-13 01:08:51 +00:00
Contributor

Well, I hope, anyway. This is a nightmare to predict/test because
jinja is weird and ansible puts it in a weird non-standard mode.
But this does the same thing as the product_versions macro we
use for all other releases - just leave out all attempts to avoid
blank lines.

It might cause blank lines in some states, but I think I found
(while testing product_versions) that blank lines don't break the
parsing. I can't find anywhere in the YAML spec where it actually
defines when a block sequence ends, but as a matter of fact it
seems like whatever parser is being used here doesn't choke on
blank lines.

My ideal goal here is that, whatever entries are present or
absent based on the conditionals, we get a clean block sequence
with each entry on its own line and no blank lines, but this
seems to be incredibly hard to get jinja to do.

Signed-off-by: Adam Williamson awilliam@redhat.com

Well, I hope, anyway. This is a nightmare to predict/test because jinja is weird and ansible puts it in a weird non-standard mode. But this does the same thing as the product_versions macro we use for all other releases - just leave out all attempts to avoid blank lines. It *might* cause blank lines in some states, but I *think* I found (while testing product_versions) that blank lines don't break the parsing. I can't find anywhere in the YAML spec where it actually defines when a block sequence *ends*, but as a matter of fact it seems like whatever parser is being used here doesn't choke on blank lines. My ideal goal here is that, whatever entries are present or absent based on the conditionals, we get a clean block sequence with each entry on its own line and no blank lines, but this seems to be *incredibly* hard to get jinja to do. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Author
Contributor

@kevin shall we try this on stg and see what rendering we get, and how greenwave parses it?

@kevin shall we try this on stg and see what rendering we get, and how greenwave parses it?
First-time contributor
Build succeeded. https://fedora.softwarefactory-project.io/zuul/buildset/0728ef6856354c6d85dcdc0db6430922 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/057ed100bf89419db127a8e1bdbbc6bf) : SUCCESS in 2m 21s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/05ace6e25e4047899a43c4b04b8bd574) : SUCCESS in 2m 08s
Author
Contributor

rebased onto 09418d9216

rebased onto 09418d921641188ede0269bb9e860c395285e4f6
First-time contributor
Build succeeded. https://fedora.softwarefactory-project.io/zuul/buildset/1288da88b1f942368f5ce4f844740eb2 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/6446a485123a4063849d407470d294c3) : SUCCESS in 2m 13s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/7ed17fd6c0c542c8b5908a14420b2e29) : SUCCESS in 2m 00s
Author
Contributor

let's do that...

let's do that...
Author
Contributor

Pull-Request has been merged by adamwill

Pull-Request has been merged by adamwill
Author
Contributor

ok, I tested this and it looks OK at least with current state. when we release F42 (and hence branched stops existing) we'd better check it again.

ok, I tested this and it looks OK at least with current state. when we release F42 (and hence branched stops existing) we'd better check it again.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Infrastructure/ansible#2462
No description provided.