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

Add configuration defaults for nextercism #576

Merged
merged 2 commits into from
Jul 15, 2017
Merged

Conversation

kytrinyx
Copy link
Member

@kytrinyx kytrinyx commented Jul 14, 2017

We will be moving to a tree-shaped track rather than a linear one, as described in the progression & learning in Exercism design document.

In order to support this, we need to expand the metadata that exercises are configured with.

Note that 'core' exercises are never unlocked by any other exercises. Core exercises appear in the track in the order that they are listed in the array.

Non-core exercises depend on only one exercise (unlocked_by: ). At the moment we are assuming that this is a core exercise, but there is no reason that it needs to be.

active: false is the equivalent of deprecated, which was stored in a separate array. This array is being removed in this change.

With these defaults the track in nextercism will have no core exercises, and all the exercises will be available as 'extras' from the start.

See exercism/meta#16

Copy link
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Planning to squash those commits.

Thinking about whether to move the deprecated into their original position from before they were deprecated, but I think I decided probably not, too hard to tell them apart if they stay in their original position?

@kytrinyx
Copy link
Member Author

I think it probably doesn't matter about where the deprecated ones are in the list. I've been debating with myself which I prefer, and I can make the argument for both:

  • original location: if we deprecate other exercises, they will likely stay in the original location, so putting them at the end now will cause inconsistencies later, unless we move all the deprecated ones to the end.
  • at the end: it seems to keep them out of the way

@petertseng
Copy link
Member

At exercism/discussions#159 (comment) I am discussing whether certain keys (definitely difficulty and topics, and perhaps core and depends_on) can be removed for the inactive exercises.

We will be moving to a tree-shaped track rather than a linear one, as described in the [progression & learning in Exercism](https://github.com/exercism/docs/blob/master/about/conception/progression.md) design document.

In order to support this, we need to expand the metadata that exercises are configured with.

Note that 'core' exercises are never unlocked by any other exercises. Core exercises appear in the track in the order that they are listed in the array.

Non-core exercises depend on only one exercise (unlocked_by: ). At the moment we are assuming that this is a core exercise, but there is no reason that it needs to be.

Until now we have operated with a separate deprecated array. These are now being moved into the exercises array with a deprecated field.

With these defaults the track in nextercism will have no core exercises, and all the exercises will be available as 'extras' from the start.
@kytrinyx kytrinyx force-pushed the nextercism-defaults branch from 228fa4f to 6993de1 Compare July 15, 2017 00:09
Copy link
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ cat cmp.rb

require 'json'

a = JSON.parse(IO.read(ARGV[0]))
b = JSON.parse(IO.read(ARGV[1]))

a['exercises'].zip(b['exercises']) { |ae, be|
  expected_keys = ae.keys
  expected_keys.insert(1, 'unlocked_by')
  expected_keys.insert(1, 'core')
  expected_keys.unshift('uuid')
  raise "No. #{ae['slug']} #{ae.keys} should have become #{expected_keys} but became #{be.keys} instead" if be.keys != expected_keys
}

b['exercises'].drop(a['exercises'].size).zip(a['deprecated']) { |be, deprecated|
  raise "deprecated #{deprecated} != #{be['slug']}" if be['slug'] != deprecated
}
$ ruby cmp.rb <(git show master:config.json) config.json
$

@petertseng petertseng merged commit d6fef67 into master Jul 15, 2017
@petertseng petertseng deleted the nextercism-defaults branch July 15, 2017 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants