Skip to content

Conversation

dustymabe
Copy link
Member

This used to be done in the cmd-build path and some things depend on it, so let's add it back here. This also prints a diff so we'll see it in the logs in the pipeline, which can be useful.

Requires some changes in #4253

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request re-introduces the functionality to update meta.json with package and advisory diffs into cmd-build-with-buildah. The changes are logical and well-implemented, including refactoring cmd-diff to support JSON output and adding more diffing capabilities. My review includes a suggestion to update outdated help text and a minor code style improvement for better maintainability.

@dustymabe dustymabe force-pushed the dusty-add-pkgdiff branch 2 times, most recently from c440444 to bddff63 Compare September 26, 2025 18:20
@dustymabe
Copy link
Member Author

#4253 has merged now so this one should be unblocked.

@dustymabe dustymabe marked this pull request as ready for review September 26, 2025 22:25
Turns out this behavior wasn't really required and there
was some preference to leave it the other way [1].

This reverts commit 9ffb64f.

[1] coreos#4253 (comment)
This used to be done in the cmd-build path and some things depend
on it, so let's add it back here. This also prints a diff so we'll
see it in the logs in the pipeline, which can be useful.
@dustymabe dustymabe enabled auto-merge (rebase) September 29, 2025 12:41
Copy link
Member

@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

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

LGTM

@dustymabe dustymabe merged commit c31f322 into coreos:main Sep 29, 2025
6 checks passed
@dustymabe dustymabe deleted the dusty-add-pkgdiff branch September 29, 2025 12:41
dustymabe added a commit to dustymabe/fedora-coreos-config that referenced this pull request Sep 29, 2025
Now that we can generate an rpmdiff from commitmeta.json alone [1]
we can stop downloading the ostree ociarchive on every build.

[1] coreos/coreos-assembler#4327
--strict Only allow installing locked packages when using lockfiles.
--parent-build=VERSION This option does nothing and is provided for backwards compatibility.
--parent-build=VERSION The version that represents the parent to this build. Used for RPM diffs
that get added to the meta.json
Copy link
Member

Choose a reason for hiding this comment

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

Cool, and with this, we now no longer have any "no-op compat" switches!

Comment on lines +237 to +249
# For the logs, print the RPM diff
/usr/lib/coreos-assembler/cmd-diff \
--rpms ${PARENT_BUILD:+--from=$PARENT_BUILD}

# For meta.json let's record the RPM diff and advisory diff information
/usr/lib/coreos-assembler/cmd-diff \
--rpms-json ${PARENT_BUILD:+--from=$PARENT_BUILD} |
jq '{"pkgdiff": .pkgdiff, "advisories-diff": .advisories}' > "${tempdir}/diff.json"
/usr/lib/coreos-assembler/cmd-meta --build="${VERSION}" \
--skip-validation --artifact-json "${tempdir}/diff.json"
# Run a 'dump' now to perform schema validation since we skipped it above.
/usr/lib/coreos-assembler/cmd-meta --dump --build="${VERSION}" > /dev/null

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think this probably should instead live in cosa import. That's the command that actually adds a new build. Then cosa build-with-buildah would just proxy the --parent-build switch like it does today for --skip-prune.

And also that way, we can populate meta.json with that info from the very start instead of as a post operation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I initially had started working to do just what you propose and I still wish I had a local stash, but I don't see it.

Let me explain why I backed off of that approach.

  1. I have an effort that will persist container-storage of the supermin VM across runs
  2. At one point I was going to have cosa import run inside the supermin VM too
  3. Prior to 77dbc4e cosa diff was going to be heavyweight (i.e. have to import the ociarchive of the parent in order to generate the diff)
  4. I didn't want to do the heavyweight ociarchive import inside the supermin VM
  5. The only way to have the ociarchive import happen outside the supermin VM (if cosa import was going to happen inside the supermin VM, was to run it in build-with-buildah.

Fast forwarding to today. The diff should be lightweight regardless of where it is run so we should be able to do it in cosa import no problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #4336

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