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

depsolve: add modules support #1163

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

supakeen
Copy link
Member

@supakeen supakeen commented Jan 23, 2025

Since the modularity PR osbuild/osbuild#1933 landed in osbuild the depsolve result now contains a modules key with data if modules were resolved.

Add the appropriate structures to the depsolve result, without propagating them into rpmmd for now.

Also adds a quick test for the internal depsolveResult type deserialization to ensure it understands some JSON serialized data that contains a modules key.

This PR will serve as the basis for #1095 where the types will be propagated to rpmmd and the stage will be implemented; but this one is important to unblock our CI as everything now fails on the unexpected field.


Note that, as opposed to the nevra field on packages which was a big red herring today; this field is actually expected to be added. Hence we can't just remove it from the depsolve response. This also means that the DNF JSON version will need to be bumped; even though we didn't want to do that (cc: @ondrejbudai). See osbuild/osbuild#1992 for that bump.


When this commit is to be depended on by osbuild-composer and image-builder-cli we will likely need to depend on the new API version as well if I understand correctly (cc @thozza).

Since the modularity PR landed in `osbuild` the depsolve result now
contains a `modules` key with data if modules were resolved.

Add the appropriate structures to the depsolve result, without
propagating them into rpmmd for now.

Also adds a quick test for the internal `depsolveResult` type
deserialization to ensure it understands some JSON serialized data that
contains a `modules` key.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
@supakeen supakeen force-pushed the module-field-in-depsolve branch from 9ac21b0 to 48ef775 Compare January 23, 2025 21:55
Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

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

LGTM.

I guess that adding the ability to enable specific module stream will be added in a follow-up? The same for bumping the pinned osbuild ref in Schutzfile?

pkg/dnfjson/dnfjson.go Show resolved Hide resolved
@supakeen
Copy link
Member Author

LGTM.

I guess that adding the ability to enable specific module stream will be added in a follow-up? The same for bumping the pinned osbuild ref in Schutzfile?

Correct; this commit is purely to let images be able to understand the new depsolve responses, the rest will be built on top of it. This is to unblock the integration CI that uses main from both repositories.

Should the pinned osbuild ref be part of this PR?

@thozza
Copy link
Member

thozza commented Jan 24, 2025

Should the pinned osbuild ref be part of this PR?

I don't think it will make any difference, so not a blocker.

@supakeen supakeen added this pull request to the merge queue Jan 24, 2025
func TestDepsolveResultWithModulesKey(t *testing.T) {
// quick test that verifies that `depsolveResult` understands JSON that contains
// a `modules` key
data := []byte(`{"modules": {}}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder how much value this test adds as it is.I personally would either omit it or expand it to cover some real world module example (in the sense of tests as documentation). Fine in a followup of course if we should get this in ASAP

Copy link
Member Author

@supakeen supakeen Jan 24, 2025

Choose a reason for hiding this comment

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

I'm going to prefer to do that as a followup. I mostly used this test case to have a very minor smoke test that the depsolver no longer breaks when a modules key is present. Because testing it otherwise is kind-of-cumbersome (unreleased osbuild depsolver has to be somewhere images likes it).

I'll be updating to an idiom much like what you implemented in osbuild in osbuild/osbuild#1993

Merged via the queue into osbuild:main with commit 58bc61d Jan 24, 2025
20 checks passed
@supakeen supakeen deleted the module-field-in-depsolve branch January 24, 2025 08:48
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.

3 participants