-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Versioning in tests #239
Comments
For clarification, the PHP format was just a suggestion, no versioning is currently present in the PHP track repo. Some form of annotation could make parsing simpler for languages with reflection libraries (or static analysers) that make accessing comment annotations simple without having to manually parse the file contents. |
I'm pretty easy going.... I declare a constant, that is currently not being used, just a visual reference for me. When I started doing this at the time I figured it might be easier to access an actual constant rather than having to parse source code, but I would still be able to do either pretty easily; just leaving it wide open for whatever direction my future-self decides to go with it. CanonicalVersion = '1.0.0'; is what I do... If I in someway deviate from the test data I will add a fourth element. That seldom happens. |
For tooling, please use |
The Haskell track places a The OCaml track aims to push for something similar, but a @SleeplessByte wrote:
Forgive my laziness for not investigating, but does A critical property of the
Besides @SleeplessByte's comment on There is no one common file in an exercise directory for all tracks, neither among those that are distributed to the students or the ones that are not. So I don't think we can easily settle on a standard place. Some languages have package managers where it is natural to place the version number in the exercise's package configuration, which then gets distributed to the student. So here is a thought:
(There is |
It doesn't. It only defines the first three components.
The SERIAL is considered an extension and perfectly valid. |
Personally I'd like to see versions as I'm used to them from my package manager… They just use upstream versions, and if they have to change the build by aplying patches or because a dependency got updated which requires recompilation, then they increase the release version. Whenever the upstream version gets bumped, the release version gets reset to As an example: Upstream version of Erlang implements it using regular erlang strings and only accepts those as an answer. Its |
It might be wise to bear in mind that versioning may also be used for things other than automated mentoring . For example, automated canonical version change notification. If we do not want to end up with different version values in different places within the same track to accommodate different automation flows, then a common location might be wise - perhaps |
We are not talking about tooling, we are talking about the version of the tests, where we have to deal with the fact, that the canonical data might have a version on which the testsuite of a track is based on, but without the canonical data changes the testsuite might evolve. See my
Yes, I second this, try not to duplicate this version over all over the repository.
Don't, please… There is already too much in the I'd prefer if we had a file in As far as I remember @exercism/haskell already uses that location. Still, I probably had to duplicate the version number sooner or later, as an ultimate goal of mine is, to have the version of the testsuite in the |
In this comment I purely address a previous comment that was made, without adding any additional thoughts of my own.
I have knowledge that the Haskell track does not place such a version file in
Neither of these files contain any version information. |
Looks like the original question was asking only about a string format, and was not really discussing where any such version indicator should exist. So I will save my comments on location for a different day and maybe a different issue. But as a spoiler, I will share now that I do not see any clear benefit in requesting (or forcing) tracks to adhere to a standard location. Regarding the format, I wonder if the most naive solution would work: However, maybe instead we can take this strategy: Look for a line that contains the word Since this strategy (well, okay, it looks for "Problem Specifications Version") works for the entire Go track according to https://github.com/petertseng/exercism-problem-specifications/blob/up-to-date/up-to-date/deprecated-go.rb, I feel no qualms at all for suggesting it. Maybe it's less work than asking individual tracks to conform to a standard that might not even make sense for their track. |
Is this valuable as an analyzer could then use different paths to analyze different versions? Or perhaps skip older versions or something like that? |
Probably… Currently I have a rule in the erlang analyzer that applies to all exercises. If there is a function with the name Well, thats the plan once I go online. If though I knew the exact testversion as I used it internally in the track (given I had used them back in the days). I could warn to update on old versions while making it a hard error on newer versions of the exercise. |
While I can't identify a particular case, my gut feel is that |
If we were to use a simple string identifier, my preference would also be |
As I said earlier, I consider it important to be able to keep track of track local evolutions of the test suite against the same canonical test data. Be it because of language updates, fixing bugs in the testsuite, etc. Therefore, as currently the canocical data has 3 digits, we need at least 4 in the tracks. Where tracks should be able to decide on their own if they monotonically increase this version as haskell does, or if they reset on canonical updates as I did in my example (and will introduce in erlang soonish). I like the |
This is exactly why @sshine has that in the Haskell versioning.
Yes. I can actually then have analyzers that:
|
A reminder that the aim here is that the files that get to the student or get to the analyzer have the version. We couldn't therefore put it in config.json. The options are a new file that has to be in all exercises, in the code (presumably via a stub file) or via the test file. There seem to be a few different things being discussed, so to move this forward and add some clarity:
If you are objecting to (1) or (2) could you please explain why (referencing the number). Thanks :) |
Thats bad… I'd hoped it were somewhere written into the metadata… From all what I have read so far, all I will see in the analyzer, is the submitted files. So the only place I could put a comment were in the stub. But what if the student doesn't understand the value of that comment and deletes it?
I have nothing against semver, as long as we as a track are allowed to add tags to track internal revision. I'm not fixed on the
Totally depends on the where. Stub? Bad idea, look above… Tests? Named differently for each exercise, therefore additional tooling as the already mentioned canonical-data-has-updated-notification-bot had to search for it. Then we can as well write individual parsers for each track… Centralized Meta File per language? Sure, I'm all in! But why a comment then? Just make it a file only containing the version and a newline. But this file won't be available to students or analyzers… |
To reiterate 😄 semver has extensions to encode build numbers, or monotonically increasing numbers, beta version, alpha releases etc. I believe under most extensions:
|
I think I prefer this. Why doesn't the student or analyzer have this? I think there is a discussion to give analyzers the full directory as per the git commit for THAT submission? |
I originally considered declaring this suboptimal but acceptable but after further consideration have decided to withdraw that judgment, replacing it with no objection. Below are:
suboptimal?I considered languages with commonly used tools that can place a version in a location known to the tool. examples:
So what would happen if version goes in a comment in the test file? One of two things.
I considered both possibilities suboptimal. further considerationActually, I thought about it and don't really see a benefit to letting the language tool (Cargo, Stack, etc.) know about the version. Unless someone convinces me there is a reason I withdraw the objection. |
Right. In JS/TS, we wanted to use the package.json version, but for our CI, it actually doesn't matter if it lives in a different file whatsoever. It also doesn't matter in terms of maintaining. |
I've just finished reviewing the conversation above and I am left wondering if the CLI should play a role here. If we are thinking |
The correct
Yep, that's why exercise-downloads are tagged with a sha in the first place in order to be able to show that button. We can re-purpose that to get the correct version file. |
Which in no way can be resolved to the version of the problem spec the exercise is based on. Also for an anylyzer it is very hard to decide whether or not the SHA 1337beaf is newer or older than b347leaf…
Yes, whatever the student does, it should not change the version my analyzer sees. |
Correct. This is why I wanted versions in the first place. The only way to map this is to hold a curated mapping, which is error-prone and honestly not a good solution. |
Two objections:
If we find this version in much the same way as the Would a satisfying compromise to use |
It would. 4 components is fine in semver! It's the "build-extension" IIRC. Other than that, I'd love to have it in the cli tool as well! |
Yep. One can use a dash to mark pre-release versions (e.g. I'm in favor of having the version in |
For the automated mentoring project, it is valuable to know what version of the test data things are being solved against. Tracks are tending to add a comment to the tests file to achieve this, which is a sensible solution in my opinion. However, the formats different signifcantly. For example:
Csharp:
Ruby
PHP
I think it would be nice to standardise on a string format that we use across tracks. Does anyone have any opinions or thoughts on this, or what we should choose?
The text was updated successfully, but these errors were encountered: