Skip to content

Conversation

@jlebon
Copy link
Member

@jlebon jlebon commented Aug 25, 2025

See individual commit messages.

jlebon added 3 commits August 24, 2025 20:08
…} labels

These labels contain information about the git repo that was built.
That key traditionally represented git information about the source
config repo that was built. But now in the buidah path, the source of
truth for this information has moved to the standard OCI labels. But
for convenience and because a bunch of things check for this in the old
place (notably the build browser and the release job), just proxy that
info under the same key into `meta.json` as before.

This should make the "FCOS commit" key show up in the build browser.
That key contains information about the cosa container image itself
being used. There's some value in capturing this even just for knowing
what `cosa import` code was executed, but it's also much more important
when we talk about the disk images, which still heavily rely on cosa
code.

This should make the "COSA commit" key show up in the build browser.
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 adds git source and revision information as OCI labels during the buildah build process and then reads these labels during import to populate meta.json for backward compatibility. The changes are logical and well-implemented. I have a couple of suggestions to improve code clarity and maintainability.

Comment on lines +141 to +142
# For the source: check if there's only one remote, if so use it with get-url
# For revision: rev-parse
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

These comments are a bit confusing as they describe the logic within prepare_git_artifacts, which has already been executed. They don't seem to apply to the buildah build command that follows. Removing them would improve the script's clarity.

Comment on lines +149 to +150
source = metadata.get('Labels', {}).get('org.opencontainers.image.source')
commit = metadata.get('Labels', {}).get('org.opencontainers.image.revision')
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To avoid calling metadata.get('Labels', {}) twice and to improve readability, you can store the Labels dictionary in a variable first.

Suggested change
source = metadata.get('Labels', {}).get('org.opencontainers.image.source')
commit = metadata.get('Labels', {}).get('org.opencontainers.image.revision')
labels = metadata.get('Labels', {})
source, commit = labels.get('org.opencontainers.image.source'), labels.get('org.opencontainers.image.revision')

We need the stream name there. It was previously getting that from the
git branch name, but we don't populate that anymore in the buildah path,
only the git URL and commit. But we do have the more explicit stream
name as a label anyway, so let's use that.
Copy link
Member

@dustymabe dustymabe 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'd like to also restore being able to see diffs and package list s in the release browser..

Also, just saw this today: coreos/fedora-coreos-tracker#2014

'commit': commit,
}

# add a reference to ourselves as well
Copy link
Member

Choose a reason for hiding this comment

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

I like the comment about this from cmd-build. For some reason it makes it a little more clear to me where the information is being sourced from:

# And the build information about our container, if we are executing
# from a container.                                                 

Copy link
Member Author

Choose a reason for hiding this comment

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

Will tweak in the next patch set.

@jlebon
Copy link
Member Author

jlebon commented Aug 25, 2025

I'd like to also restore being able to see diffs and package list s in the release browser..

Yeah agree.

I guess that's https://gitlab.com/fedora/bootc/tracker/-/issues/65 for the more generalized issue. But we could carry the CoreOS-specific implementation of this for now.

@dustymabe dustymabe merged commit 0d49e67 into coreos:main Aug 25, 2025
5 of 6 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.

2 participants