Skip to content
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

Switch to BurntSushi/toml and error out on unknown toml keys #549

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

ondrejbudai
Copy link
Member

This pull request includes two changes. First, it switches from pelletier/go-toml to BurntSushi/toml in the bib module. This change removes a dependency and aligns with the use of BurntSushi elsewhere in the codebase. Second, it adds error handling for unknown toml keys in the buildconfig module. This change improves clarity and prevents confusion when using older versions of bib with recent customizations.

@ondrejbudai ondrejbudai requested a review from achilleas-k July 18, 2024 12:43
achilleas-k
achilleas-k previously approved these changes Jul 18, 2024
mvo5
mvo5 previously approved these changes Jul 29, 2024
Copy link
Collaborator

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I have no preference between these two, but we use BurntSushi
everywhere else, so by doing this switch we have one less dependency.
This should remove some confusion when people use old bib with
recently added customizations.
@mvo5 mvo5 dismissed stale reviews from achilleas-k and themself via 8dd4cfd July 29, 2024 11:54
@mvo5
Copy link
Collaborator

mvo5 commented Jul 29, 2024

I had to rebase because of conflicts.

@mvo5 mvo5 enabled auto-merge July 29, 2024 11:55
@mvo5 mvo5 added this pull request to the merge queue Jul 29, 2024
Merged via the queue into osbuild:main with commit af8321c Jul 29, 2024
7 of 9 checks passed
@bcl
Copy link
Contributor

bcl commented Jul 29, 2024

Looks like this broke a test:

=== RUN   TestReadUserConfigErrorWrongFormat
    config_test.go:100: 
                Error Trace:    /home/bcl/Red_Hat/projs/bootc-image-builder/bib/internal/buildconfig/config_test.go:100
                Error:          Error "cannot decode \"/tmp/TestReadUserConfigErrorWrongFormat3091236278/001/config.toml\": toml: line 1: expected '.' or '=', but got '{' instead" does not contain "parsing error"
                Test:           TestReadUserConfigErrorWrongFormat
--- FAIL: TestReadUserConfigErrorWrongFormat (0.00s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants