-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add exercise's version to package.yaml and remove redundant information #522
Comments
I like it. One question: Why do you want the serial number to increase regardless of the other version numbers and not reset it when the latter change? |
Using a serial we get a It also solves the following question:
Without the serial, it could happen that two distinct versions would share exactly the same number, e.g.: |
I like all the suggestions.
Was confused at this since all current JSON files have a version, but figured out that it means a JSON file from before that time. Understood 👍 .
Sure, though feel free to do that as a separate round of changes, or at least put in separate commit (I think there will be a lot of whitespace change that happens as a result), since the change can be made independently of adding versions. |
I have updated the description a little restricting the scope of this issue, @petertseng. Considering that this work has some economies of scale, I'll assign it to myself and I expect to finish it in a few days. |
As I revealed in #524 , I do have a small script to compare versions, but it's not written in Haskell so I'll defer to the upcoming code that is in Haskell. But until it comes feel free to take a look at https://github.com/petertseng/x-common/blob/up-to-date/up-to-date/haskell.rb |
My Haskell draft is in Feel free to add you ruby script if you want too. 👍 |
My updated version of the program to check for newer exercise data is in https://github.com/rbasso/xhaskell-check-versions. It certainly is not as short, flexible and maintainable as @petertseng's solution, but it is now a working, type-safe, over-engineered laser cannon to shoot a dead fly. 😆 It was fun to write it, but I prefer the ruby script! |
I guess that my original objective with this PR is complete, so I'm closing it. |
Updates to this version policy: The 0.9.0 will no longer be used since all canonical-data.json have a version, and it's enforced in the schema that they all will have versions henceforth. Only remaining 0.9.0 is in deprecated exercise I will finally document this. |
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:canonical-data.json
versions, signaling when there is new test data. Ensuring we are up to date with x-common #416How would it look like?
exercises/leap/package.yaml
Running the tests would give something like this:
Suggested changes
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: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.x-common
.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) 👍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
package.yaml
files and remove them from the test suite.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 #539Remove 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.
The text was updated successfully, but these errors were encountered: