Description
Rationale
As discussed earlier, it may be a good idea to have the exercise's implementation version in the package.yaml
files. There are a few reasons to do that:
- It will allow us to version the exercises.
- It will be displayed to the users when running the tests.
- It will allow us to check it against the
canonical-data.json
versions, signaling when there is new test data. Ensuring we are up to date with x-common #416
How would it look like?
exercises/leap/package.yaml
name: leap
version: 1.0.0.1
...
Running the tests would give something like this:
leap-1.0.0.1: test (suite: test)
year not divisible by 4: common year
year divisible by 4, not divisible by 100: leap year
year divisible by 100, not divisible by 400: common year
year divisible by 400: leap year
Finished in 0.0001 seconds
4 examples, 0 failures
Suggested changes
- Add the version to the main
package.yaml
of each exercise:-
All exercises must have a four-digits version: MAJOR.MINOR.PATCH.SERIAL
-
Exercises based on a non-versioned
canonical-data.json
should use version 0.9.0.1. If there is a comment containing the date from the data file used as a reference, it should be added to the YAML file, to ease transition, like this:name: all-your-base version: 0.9.0.1 # 2016-06-29
-
Exercises based on a versioned
canonical-data.json
should use its version plus a serial number, without any comment. -
Exercises not following a
canonical-data.json
should use 0.1.0 plus a serial number, without any comment. -
The serial number must start at 1 and always increase a unit when changed, regardless of the changes in the other version numbers.
-
The
package.yaml
files in the example solutions should not be versioned, because it would be too hard to keep them synchronized.
-
- Remove redundant data from the test suites:
- Keep comments describing the divergences from
x-common
. - Remove references to the
canonical-data.json
files and version. Remove the test group containing the name of the exercise, if existent, because this information is already displayed with the version when running the test suite.(edit: as pointed out by @petertseng, this change doesn't belong here) 👍
- Keep comments describing the divergences from
- Update the documentation to include the new versioning system.
Should we do it?
This will take time and demand some work, so we shouldn't start unless the @exercism/haskell maintainers agree with it.
So... Objections? Comments?
Edit: Approved!
Progress
- Check if we have a consensus about it.
- Add the versions to the
package.yaml
files and remove them from the test suite. - Open an issue to update the documentation
- Open issues for the unsolved items in the Future work section
Future work
Other ideas and problems with the exercises discovered in the process.
-
Fix/remove
change
group name. change: Remove test groups not matching x-common #539 -
Remove the test group containing the name of the exercise, if existent, because this information is already displayed with the version when running the test suite. all: Remove test group with the exercise's name #540
-
Write a app/script to check for newer test data versions.
I have a proof-of-concept in Haskell mostly ready, but I think we should wait until we finish this issue.Update: We already have two programs to solve that.