Skip to content

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
@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

2 participants