-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CI:BUILD] Packit: Copr rpm version sha #20091
[CI:BUILD] Packit: Copr rpm version sha #20091
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lsm5 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
.packit.yaml
Outdated
@@ -16,8 +16,10 @@ actions: | |||
jobs: | |||
- job: copr_build | |||
trigger: pull_request | |||
notifications: | |||
failure_comment: | |||
message: "Ephemeral COPR build failed. @lsm5 please check." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine for a draft, but please remove lsm for final.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomSweeneyRedHat that's from #20061 . It's intentional.
Cockpit tests failed for commit 226507c02a66a0ca2a60338963983c729a155d1f. @martinpitt, @jelly, @mvollmer please check. |
The f39/revdeps failure is unrelated, and a rare test-only race condition; I'll put it on my todo list. Feel free to retry or ignore. |
8e3f5d6
to
668d957
Compare
This change will allow `podman --version` from COPR rpm builds to be of the form `X.Y.Z-dev-SHORT_SHA`. Also specify a `copr_build` macro as it feels more intuitive than `copr_username` or `copr_project`. [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar <[email protected]>
668d957
to
e658749
Compare
Cockpit tests failed for commit 8e3f5d6513a5ef69d9edaaaeac4e8c65e2097dec. @martinpitt, @jelly, @mvollmer please check. |
@cevich @benoitf The rpm installed from https://download.copr.fedorainfracloud.org/results/packit/containers-podman-20091/fedora-rawhide-x86_64/06433584-podman/ built in packit tasks shows:
This is only enabled for copr builds in spec and won't affect official Fedora builds. So, this PR is good to go. PTAL |
nice 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@containers/podman-maintainers good to merge. PTAL |
# podman --version should show short sha | ||
sed -i "s/^const RawVersion = .*/const RawVersion = \"##VERSION##-##SHORT_SHA##\"/" version/rawversion/version.go | ||
# use ParseTolerant to allow short sha in version | ||
sed -i "s/^var Version.*/var Version, err = semver.ParseTolerant(rawversion.RawVersion)/" version/version.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: I had one of these "check the go source" version before, and it got annoying to fix every time something in go-land changed. That's why I made the test/version/version
Makefile target. Run that, and your sed-ing can probably be swapped for a printf
or an echo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clarification:
$ make test/version/version
$ test/version/version
4.7.0-dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is semver.MustParse
. 4.8.0-dev-SHORT_SHA
isn't strictly semver compliant. If I change the version in version/rawversion/version.go
to 4.8.0-dev-foobar
, running ./test/version/version
will still give me 4.8.0-dev
and not 4.8.0-dev-foobar
.
Let me know if I misread and you meant something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, no, I read your sed
command wrong. This is changing version.go
which seems wors-er (IMHO). The issue is, sed
will happily do nothing if no match is found. It's also trivial for someone or some tool to modify version.go
and break sed
in a different or more silent way.
Perhaps it would be a slight improvement if you had a kind of "patch-template"? Render that, verify it somehow, then apply it with patch
(or the spec-file magic equivalent). That way it might be more likely to fail-hard on a breaking code change? I dunno, maybe there's a better/more golang or Makefile idiomatic way to override the version value in the code.
I bet @edsantiago or @vrothberg might have some ideas here, they're more inventive and know the toolchain much better than I.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm open to suggestions, but this is copr only, so not a big deal imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true. And the copr package ends up in a lot of places. I don't think I'm smart enough to understand all the potential ramifications here. Let's see what others say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
@lsm5 merge at will
/hold cancel |
Does this PR introduce a user-facing change?