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

gen-manifests: create predictable version/release numbers in mockDepsolve #937

Merged

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Sep 16, 2024

The current code will only generate "0" version numbers for packages and releases. This limits the usefulness of this mock in the tests for otk. Instead generate predictable but (mostly) non-zero numbers based on the modulo of the first and second char of the pkgname.

Useful for e.g. osbuild/otk#196 as it will ensure that the fragment/grub2.yaml actually changes depending on the kernel name.

mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 16, 2024
The `grub2` fragment require the release/version/arch of the kernel
package. Add them to the external so that they can be used inside
otk files.

Also tweak the mocks to follow
osbuild/images#937
so that we have predictable but non-empty version/release numbers.
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 16, 2024
This commit updates the `fragment/grub2.yaml` to use the newly
available `packages.os.const.kernel.{release,version,arch}` so
that this works for real data and not just the `0-0.noarch` mocks.

Also update the reference manifests based on
osbuild/images#937
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 16, 2024
The `grub2` fragment require the release/version/arch of the kernel
package. Add them to the external so that they can be used inside
otk files.

Also tweak the mocks to follow
osbuild/images#937
so that we have predictable but non-empty version/release numbers.
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 16, 2024
This commit updates the `fragment/grub2.yaml` to use the newly
available `packages.os.const.kernel.{release,version,arch}` so
that this works for real data and not just the `0-0.noarch` mocks.

Also update the reference manifests based on
osbuild/images#937
achilleas-k
achilleas-k previously approved these changes Sep 16, 2024
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

Not a bad idea.

cmd/gen-manifests/main.go Outdated Show resolved Hide resolved
…olve

The current code will only generate "0" version numbers for packages
and releases. This limits the usefulness of this mock in the tests
for otk. Instead generate predictable but (mostly) non-zero numbers
based on the modulo of the first and second char of the pkgname.
@mvo5 mvo5 force-pushed the create-predictable-version-numbers-in-mock branch from 9a4ac5f to 3b4b3a7 Compare September 19, 2024 07:25
@mvo5 mvo5 marked this pull request as ready for review September 19, 2024 07:25
@mvo5 mvo5 changed the title [RFC] gen-manifests: create predictable version/release numbers in mockDepsolve gen-manifests: create predictable version/release numbers in mockDepsolve Sep 19, 2024
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

LGTM

@supakeen supakeen added this pull request to the merge queue Sep 21, 2024
Merged via the queue into osbuild:main with commit 1767b44 Sep 21, 2024
18 of 19 checks passed
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 24, 2024
This commit fixes the grub2 fragments that require changing
after:
osbuild/images#943
osbuild/images#937

We now create predictable versions/release for fake kernels and
also include the architecture.
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 24, 2024
This commit fixes the grub2 fragments that require changing
after:
osbuild/images#943
osbuild/images#937

We now create predictable versions/release for fake kernels and
also include the architecture.
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 24, 2024
This commit fixes the grub2 fragments that require changing
after:
osbuild/images#943
osbuild/images#937

We now create predictable versions/release for fake kernels and
also include the architecture.
github-merge-queue bot pushed a commit to osbuild/otk that referenced this pull request Sep 24, 2024
This commit fixes the grub2 fragments that require changing
after:
osbuild/images#943
osbuild/images#937

We now create predictable versions/release for fake kernels and
also include the architecture.
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 25, 2024
This commit updates the generated mock meta-data from the
`gen_depsolve_dnf4` to follow the `gen_manifests` updates from the
images library, most notably:
osbuild/images#937
osbuild/images#943
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 25, 2024
This commit updates the generated mock meta-data from the
`gen_depsolve_dnf4` to follow the `gen_manifests` updates from the
images library, most notably:
osbuild/images#937
osbuild/images#943
mvo5 added a commit to mvo5/osbuild-otk that referenced this pull request Sep 26, 2024
This commit updates the generated mock meta-data from the
`gen_depsolve_dnf4` to follow the `gen_manifests` updates from the
images library, most notably:
osbuild/images#937
osbuild/images#943
github-merge-queue bot pushed a commit to osbuild/otk that referenced this pull request Sep 26, 2024
This commit updates the generated mock meta-data from the
`gen_depsolve_dnf4` to follow the `gen_manifests` updates from the
images library, most notably:
osbuild/images#937
osbuild/images#943
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