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

Create exercise versioning policy based on Haskell track #283

Closed
sshine opened this issue Sep 17, 2018 · 5 comments
Closed

Create exercise versioning policy based on Haskell track #283

sshine opened this issue Sep 17, 2018 · 5 comments
Assignees

Comments

@sshine
Copy link
Contributor

sshine commented Sep 17, 2018

The Haskell track uses the version property in stack's package.yaml to contain the version of problem-specifications for the given exercise. See for example exercism/haskell@003f9d9 's 1.3.0.6: 1.3.0 is the version in problem-specifications bumped in exercism/problem-specifications#1293 and 6 is a serially incremented value across any local change to the exercise.

We could go with the same versioning policy as the Haskell track, but since there's less traffic on the Ocaml track's GitHub, we could do with just the problem-specifications version number for each exercise.

Here are three suggestions as to where we can place the version number:

  1. We could place it in a comment at the top of test.ml:

    (* Test version: 1.3.0 *)
    

    Embedding information in comments is less ideal.

  2. We could place it as a top-level definition in test.ml:

    let test_version = "1.3.0"
    

    Since test.ml auto-executes unconditionally, we could change all test.ml files to inspect Sys.interactive (equivalent to Python's if __name__ == "__main__").

  3. We could embed a version number in dune-project:

    (version 1.3.0)
    

    This most closely resembles how the Haskell track does it.

@sshine sshine self-assigned this Sep 17, 2018
@sshine
Copy link
Contributor Author

sshine commented Sep 17, 2018

I'm voting for

  • just the problem-specifications version, and
  • embed a version number in dune-project.

@stevejb71
Copy link
Contributor

See exercism/exercism#4266

I'm not sure this change would be so useful (though I'm willing to listen to justifications for it).

@sshine
Copy link
Contributor Author

sshine commented Sep 17, 2018

I've read that issue, and the obsolete version tracking is not the same as what I'm suggesting that we adopt from the Haskell track.

A hacky workaround that we used in many tracks was to add a version to the exercise tests, and the test suite would include a failing assertion that included that version number.

So some test suites tried to have test versioning as a dynamic part of the tests so when you test their version with a test suite that is ahead, it detects which tests to apply. This is a non-issue now as exercism download uses the test suite that corresponds in time to when they downloaded the exercise.

What I'm proposing is that we keep track of how up to date we are with problem-specifications so new test cases can propagate to the Ocaml track.

@stevejb71
Copy link
Contributor

That may be worth a go... should probably be in the tools folder.

@sshine
Copy link
Contributor Author

sshine commented Oct 5, 2018

By closing this, I've marked the policy as chosen.

I'll create another issue in which we can track progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants