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

feat: version checks #1465

Merged
merged 4 commits into from
Jan 26, 2024
Merged

feat: version checks #1465

merged 4 commits into from
Jan 26, 2024

Conversation

pd93
Copy link
Member

@pd93 pd93 commented Jan 11, 2024

  • feat: version checks
  • refactor: consistent naming for errors
  • feat: update schema to accept semver strings

Task's current version checking is a bit out of date and unused. It's a lot of work for us to maintain a list of features and which schema versions they work in, but it's quite trivial to let a user specify a minimum version of task as their schema version and then error if the version of the binary is lower.

This PR extends the existing TaskfileVersionNotDefined error (exit code 107) and renames it to the more generic TaskfileVersionCheckError. This error is then used whenever we come across a problem with schema/binary versions. In this PR, this happens in 3 places:

  1. When reading a Taskfile, if the version key is not provided:
task: Missing schema version in Taskfile "/path/to/Taskfile.yml"
  1. In doVersionChecks, if the version key is less than v3:
task: Invalid schema version in Taskfile "/path/to/Taskfile.yml":
Schema version (2.0.0) no longer supported. Please use v3 or above
  1. In doVersionChecks, if the version key is greater than the installed version of Task
task: Invalid schema version in Taskfile "/path/to/Taskfile.yml":
Schema version (4.0.0) is greater than the current version of Task (3.33.0)

@pd93 pd93 changed the title version checks feat: version checks Jan 11, 2024
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

🎉

@andreynering andreynering merged commit fa82051 into main Jan 26, 2024
11 checks passed
@andreynering andreynering deleted the version-checks branch January 26, 2024 00:05
andreynering added a commit that referenced this pull request Jan 26, 2024
@vmaerten vmaerten mentioned this pull request May 19, 2024
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.

None yet

2 participants