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

Container flatpak detection #5496

Merged

Conversation

owtaylor
Copy link
Contributor

@owtaylor owtaylor commented Oct 2, 2023

This PR fixes a problem with the new system of building Flatpaks directly with on the builders, rather than using OSBS. The new koji-flatpak plugin doesn't set 'container_koji_task_id' in the extra metadata for the build, which broke content type detection.

See https://pagure.io/releng/issue/11697

There would be more simple ways of fixing things, but I tried to clean up a bit, rather than just leaving things broken so that unknown image types (all images aren't containers or Flatpaks...) were detected as RPM packages.

The cleanup only goes so far - I've left the test case for the new error catching a 500, rather than trying to cleanly catch this in the validatators. This was because I was pretty stumped at how to fit it in - there are multiple code paths that directly or indirectly call infer_content_class() (at least validate_acls and validate_build_uniqueness).

I've also switched the code from extra['image'] to extra['typeinfo']['image'], since that's been the preferred location for the metadata for quite some time.

@owtaylor owtaylor requested a review from a team as a code owner October 2, 2023 17:03
The image specific extra data is canonically inside the 'typeinfo'
dictionary. Koji has mirrored one to the other for koji-containerbuild
builds for a long time. See, e.g.:

 https://koji.fedoraproject.org/koji/buildinfo?buildID=1530154

From June 2020. (This seems to be the first with the mirroring.)

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
@mattiaverga mattiaverga added the 7.2-backports Mergify uses this to backport patches to 7.2 label Oct 3, 2023
Instead of looking for container_koji_task_id in the build extra,
look for typeinfo.image. If we see typeinfo.image without pull specs
(e.g., an ISO image), error out cleanly up front.

Previously the code would assume an RPM update if you passed it the
build NVR of an ISO image.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
Copy link
Contributor

@mattiaverga mattiaverga left a comment

Choose a reason for hiding this comment

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

I've added the news fragment, approving now

@mattiaverga mattiaverga merged commit b32286e into fedora-infra:develop Oct 3, 2023
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.2-backports Mergify uses this to backport patches to 7.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants