forked from docker/buildx
-
Notifications
You must be signed in to change notification settings - Fork 1
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
[ENGINE-978] Change revision scheme per ENGINE-970 requirements #5
Open
psaintlaurent
wants to merge
2
commits into
Mirantis:master
Choose a base branch
from
psaintlaurent:ENGINE-978
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−2
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,13 +1,13 @@ | ||||||||||
package tests | ||||||||||
|
||||||||||
import ( | ||||||||||
"regexp" | ||||||||||
"strings" | ||||||||||
"testing" | ||||||||||
|
||||||||||
"github.com/moby/buildkit/util/testutil/integration" | ||||||||||
"github.com/stretchr/testify/require" | ||||||||||
"golang.org/x/mod/module" | ||||||||||
"golang.org/x/mod/semver" | ||||||||||
) | ||||||||||
|
||||||||||
var versionTests = []func(t *testing.T, sb integration.Sandbox){ | ||||||||||
|
@@ -45,7 +45,8 @@ func testVersion(t *testing.T, sb integration.Sandbox) { | |||||||||
// This defaults to something that's still compatible | ||||||||||
// with semver. | ||||||||||
version := fields[1] | ||||||||||
require.True(t, semver.IsValid(version), "Second field was not valid semver: %+v", version) | ||||||||||
regex, err := regexp.CompilePOSIX("^v[0-9]+.[0-9]+.[0-9]+(m[0-9]+|m[0-9]+-rc[0-9]+|m[0-9]+-tp[0-9]+)$") | ||||||||||
require.True(t, err == nil && regex.MatchString(version), "Second field was not valid: %+v", version) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
// Revision should be empty or should look like a git hash. | ||||||||||
if len(fields) > 2 && len(fields[2]) > 0 { | ||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you please explain what this is doing and why it is necessary? Why does the m-version need to be sourced from an environment variable? Why can't we just include the m-version part in our git tags?
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.
By m-version, I assume you mean the REVISION_NUMBER. I was under the impression that was going to be included from the pipeline going forward.
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 package revision is going to be provided from the packaging pipeline going forward. I don't think it makes sense for the packaging pipeline to pass the software version into the build script piecemeal. @aepifanov's release process proposal -- which you reviewed with the rest of the team -- is for the packaging pipeline to take a Git tag name as a parameter and use the tag name as the version of the software being built. Since the tag is going to encode the full software version; revision, prerelease and all; there would be little value in passing the version components separately. The pipeline would have to parse the version string, only to have the build script re-concatenate it into an identical string.
Note that we will be creating multiple tags which reference the same commit, e.g. to rebuild an RC as a GA. That means we can't rely on the
hack/git-meta version
command. It looks for which tags reference the commit, but if more than one tag references the commit it might choose the wrong tag. Thishack/build
script already affords overriding the automatically inferred software version by setting theVERSION
environment variable. Why not simply leverage that, and have our packaging script setVERSION
to the git tag name when invoking the build?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 proposal doesn't have much detail regarding buildx.