changeset: allow override the revision through ldflags
Changes
The main reason for this is to support cases where the go build happens on a non git folder but we want to pass a revision anyway.
Signed-off-by: Vincent Demeester [email protected]
/kind enhancement /cc @imjasonh @dprotaso
Release Note
NONE
Codecov Report
Base: 81.29% // Head: 81.29% // Increases project coverage by +0.00% :tada:
Coverage data is based on head (
5a282d8) compared to base (6d71868). Patch coverage: 100.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #2601 +/- ##
=======================================
Coverage 81.29% 81.29%
=======================================
Files 162 162
Lines 9820 9821 +1
=======================================
+ Hits 7983 7984 +1
Misses 1597 1597
Partials 240 240
| Impacted Files | Coverage Δ | |
|---|---|---|
| changeset/commit.go | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
/test unit-tests
Do we still need this if we go with https://github.com/tektoncd/pipeline/pull/5573 ?
Do we still need this if we go with tektoncd/pipeline#5573 ?
Yes, this is unrelated with tektoncd/pipeline#5573 👼🏼. Downstream, we are building tekton (and I guess knative as well), through a cachito cache/proxy, which means, when we build the project, we are not in a git repository (we have the information about it but we are not). Hence proposing this to be able to set the correct revision in that case 🙃.
So what's the ld flag to set rev ?
@dprotaso it would be something like
go build -ldflags="-X 'knative.dev/pkg/changeset.rev={the-commit-sha-or-something}'"
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: dprotaso, imjasonh, vdemeester
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [dprotaso]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest