Skip to content

manifest: remove most panics()#1883

Merged
lzap merged 3 commits into
osbuild:mainfrom
mvo5:no-manifests-errs2
Sep 20, 2025
Merged

manifest: remove most panics()#1883
lzap merged 3 commits into
osbuild:mainfrom
mvo5:no-manifests-errs2

Conversation

@mvo5

@mvo5 mvo5 commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

With #1882 we can not return errors in more places and need to panic less. This PR contains some followups to eliminate more panics. With it merged we go from 95 panics() in pkg/manifest to just 20 (most in serializeEnd, the rest in things like getBuildPackages() which can be caused by unsupported architecutures, see https://github.com/osbuild/images/blob/v0.193.0/pkg/manifest/anaconda_installer.go#L127)

@schutzbot

schutzbot commented Sep 19, 2025

Copy link
Copy Markdown
Collaborator

A previous version of this PR changed the images API or behaviour causing integration issues with image-builder-cli.
This is now fixed.

Similar to the previous commits, move panics into errors.
Some test needed adjustment and use `ErrorEqual()` now
to show that the error message is also reasonable.
By making Pipeline.fileRefs() return an error we avoid another
panic().
@mvo5
mvo5 force-pushed the no-manifests-errs2 branch from 55ad0ac to cbf3a6c Compare September 19, 2025 14:03
@mvo5
mvo5 marked this pull request as ready for review September 19, 2025 14:04
@mvo5
mvo5 requested a review from a team as a code owner September 19, 2025 14:04
@lzap
lzap enabled auto-merge September 19, 2025 17:54

@bcl bcl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good!

@lzap
lzap added this pull request to the merge queue Sep 19, 2025
Merged via the queue into osbuild:main with commit fbc7adf Sep 20, 2025
26 checks passed
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