ci/check: Fix broken regexp and spec version replacement#810
Merged
Conversation
Member
Author
|
Member
Author
Taking fix from #809 |
Member
Author
With another fix, those are the only remaining ones. Second one is fixed by coreos/butane#711. |
Member
Author
|
The single remaining failure is the one fixed in coreos/butane#711 so I think this is good to go. |
dustymabe
approved these changes
Jun 5, 2026
dustymabe
left a comment
Member
There was a problem hiding this comment.
This LGTM.
I have some suggestions about adding context to commit messages, which would be useful to understanding.
In [1], I replaced all hardcoded FCOS Butane spec versions by an AsciiDoc document attribute that is dynamically replaced when generating the docs. This attribute is however not replaced when we run the script to check the configurations snippets in the documentation as we process the source documentation files. Thus we need to manually do the substitution. [1] coreos#612 Fixes: coreos#612
In [1], I replaced all hardcoded FCOS Butane spec versions by an AsciiDoc document attribute that is dynamically replaced when generating the docs. Attributes are not replaced by default in source snippets in AsciiDoc so I had to set the `subs="attributes"` option on those snippets. The script that checks Butane config snippets in the docs relies on a regexp to find the config snippets and extract them for validation. With the change in [1], the regexp did not match anymore and no configuration was thus checked anymore. Thus update the regexp to match the added attribute to Butane config source snippets. [1] coreos#612
In [1], I realized that CI was silently broken since [2] as we dynamically generate our test cases from config snippets in the docs using a regular expression match that did not match anymore with the changes in [2]. Thus count the number of configs checked by this script and fail if it's under an arbitrary number, which the current number of config that we test. We don't strictly need to increase this number as we add tests and we can decrease it if we ever reduce the number of tests cases. [1] coreos#809 [2] coreos#612 Fixes: coreos#612
Match how we recommend running Butane from a container in the documentation: https://coreos.github.io/butane/getting-started/#getting-butane Fixes the following errors: ``` Invalid Butane config at ./modules/ROOT/pages/authentication.adoc:55: error at $.passwd.users.0.ssh_authorized_keys_local.0, line 7 col 11: open /files-dir/users/core/id_rsa.pub: permission denied error at $.passwd.users.1.ssh_authorized_keys_local.0, line 10 col 11: open /files-dir/users/jlebon/id_rsa.pub: permission denied error at $.passwd.users.1.ssh_authorized_keys_local.1, line 11 col 11: open /files-dir/users/jlebon/id_ed25519.pub: permission denied error at $.passwd.users.2.ssh_authorized_keys_local.0, line 14 col 11: open /files-dir/users/miabbott/id_rsa.pub: permission denied Error translating config: source config is invalid Invalid Butane config at ./modules/ROOT/pages/tutorial-containers.adoc:22: error at $.passwd.users.0.ssh_authorized_keys_local.0, line 7 col 11: open /files-dir/ssh-key.pub: permission denied Error translating config: source config is invalid Invalid Butane config at ./modules/ROOT/pages/tutorial-services.adoc:59: error at $.storage.files.2.contents.local, line 33 col 16: open /files-dir/public-ipv4.sh: permission denied error at $.systemd.units.1.contents_local, line 16 col 23: open /files-dir/issuegen-public-ipv4.service: permission denied Error translating config: source config is invalid Invalid Butane config at ./modules/ROOT/pages/tutorial-updates.adoc:53: error at $.passwd.users.0.ssh_authorized_keys_local.0, line 7 col 11: open /files-dir/ssh-key.pub: permission denied Error translating config: source config is invalid Invalid Butane config at ./modules/ROOT/pages/tutorial-user-systemd-unit-on-boot.adoc:121: error at $.passwd.users.0.ssh_authorized_keys_local.0, line 7 col 11: open /files-dir/ssh-key.pub: permission denied Error translating config: source config is invalid ```
- Ignore missing docstrings - Open files as UTF-8 - Split some long lines - Make it explicit that we don't need the subprocess function to check the return code as we will do it ourselves right after
Those configuration snippets are not full Butane configs and they do not include any AsciiDoc attribute to replace, thus this option is not needed and we don't need to validate them.
Starting with Butane spec 1.7.0, boot_device.layout is required when
boot_device.mirror is specified (previously it was only a warning).
Since the examples use {butane-latest-stable-spec} which resolves to
1.7.0, they now fail with:
error at $.boot_device.mirror: boot_device.layout should be
specified when boot_device.mirror is specified
Add layout: x86_64 to both examples that use boot_device.mirror, with
a comment noting users should change this to match their target
architecture.
Fixes: coreos#808
Assisted-by: <anthropic/claude-opus-4.6>
Fixes: ``` Invalid Butane config at ./modules/ROOT/pages/storage.adoc:92: warning at $.storage.disks.0.partitions.0.number, line 8 col 7: partitions cannot be reused by label; number must be specified except on boot disk (/dev/disk/by-id/coreos-boot-disk) or when wipe_table is true Config produced warnings and --strict was specified ``` See: coreos/butane#711 (comment)
Member
Author
|
Thanks, updated. |
Member
Author
|
We will need a Butane release to fix the last warning so I think we should merge this one over red CI to not regress more until we do a release for Butane. |
dustymabe
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci/check: Replace spec version attribute in config snippets
In [1], I replaced all hardcoded FCOS Butane spec versions by an
AsciiDoc document attribute that is dynamically replaced when generating
the docs.
This attribute is however not replaced when we run the script to check
the configurations snippets in the documentation as we process the
source documentation files. Thus we need to manually do the
substitution.
[1] #612
Fixes: #612
ci/check: Fix regexp used to extract Butane config snippets
In [1], I replaced all hardcoded FCOS Butane spec versions by an
AsciiDoc document attribute that is dynamically replaced when generating
the docs. Attributes are not replaced by default in source snippets in
AsciiDoc so I had to set the
subs="attributes"option on thosesnippets.
The script that checks Butane config snippets in the docs relies on a
regexp to find the config snippets and extract them for validation. With
the change in [1], the regexp did not match anymore and no configuration
was thus checked anymore.
Thus update the regexp to match the added attribute to Butane config
source snippets.
[1] #612
ci/check: Fail if less than expected number of configs have been tested
In [1], I realized that CI was silently broken since [2] as we
dynamically generate our test cases from config snippets in the docs
using a regular expression match that did not match anymore with the
changes in [2].
Thus count the number of configs checked by this script and fail if it's
under an arbitrary number, which the current number of config that we
test. We don't strictly need to increase this number as we add tests and
we can decrease it if we ever reduce the number of tests cases.
[1] #809
[2] #612
Fixes: #612
ci/check: Run Butane container with SELinux isolation
Match how we recommend running Butane from a container in the documentation:
https://coreos.github.io/butane/getting-started/#getting-butane
Fixes the following errors:
ci/check: Fix minor Python lints
the return code as we will do it ourselves right after
wireguard: Drop some attributes substitution
Those configuration snippets are not full Butane configs and they do not
include any AsciiDoc attribute to replace, thus this option is not
needed and we don't need to validate them.
storage: add boot_device.layout to mirror examples
Starting with Butane spec 1.7.0, boot_device.layout is required when
boot_device.mirror is specified (previously it was only a warning).
Since the examples use {butane-latest-stable-spec} which resolves to
1.7.0, they now fail with:
error at $.boot_device.mirror: boot_device.layout should be
specified when boot_device.mirror is specified
Add layout: x86_64 to both examples that use boot_device.mirror, with
a comment noting users should change this to match their target
architecture.
Fixes: #808
Assisted-by: <anthropic/claude-opus-4.6>
storage: Fix
/varpartition re-use exampleFixes:
See: coreos/butane#711 (comment)