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

fix: version check #1663

Merged
merged 2 commits into from
May 20, 2024
Merged

fix: version check #1663

merged 2 commits into from
May 20, 2024

Conversation

vmaerten
Copy link
Member

@vmaerten vmaerten commented May 19, 2024

Fixes #872

Following this PR :

task/setup.go

Lines 241 to 253 in a74b0bc

currentVersion, err := semver.NewVersion(version.GetVersion())
if err != nil {
return nil
}
// Error if the Taskfile uses a schema version above the current version of Task
if schemaVersion.GreaterThan(currentVersion) {
return &errors.TaskfileVersionCheckError{
URI: e.Taskfile.Location,
SchemaVersion: schemaVersion,
Message: fmt.Sprintf(`is greater than the current version of Task (%s)`, currentVersion.String()),
}
}

This does not work when the sum is displayed in the version
Cf :
image
And
if info.Main.Sum != "" {
ver += fmt.Sprintf(" (%s)", info.Main.Sum)
}

Copy link
Member

@pd93 pd93 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. Bit of an oversight on my part when doing #1465. A couple of minor suggestions

internal/version/version.go Outdated Show resolved Hide resolved
internal/version/version.go Outdated Show resolved Hide resolved
@vmaerten
Copy link
Member Author

It's done @pd93
Thanks a lot for your review, especially about "Go-like code" Even if we are using Go at work, it's always good to know
good practices

@vmaerten vmaerten requested a review from pd93 May 20, 2024 14:01
Copy link
Member

@pd93 pd93 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@pd93 pd93 merged commit 1e25cea into go-task:main May 20, 2024
13 checks passed
pd93 added a commit that referenced this pull request May 20, 2024
@pd93 pd93 mentioned this pull request May 20, 2024
@vmaerten vmaerten deleted the fix/version-check branch July 7, 2024 11:40
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.

Specify minimum required task verison.
3 participants