configlet
configlet copied to clipboard
Feature request: listing exercises that match a set of statuses
The TL;DR is that I'd like a standardized way of listing out all exercises that are beta or active so that CI test scripts can ignore exercises that are deprecated or wip.
Right now I don't think CI has a default/standard tool that lets us process JSON, but all tracks have Configlet on CI.
If we had a way of getting just a list of active exercises, then the tracks could use that as input to ignore wip (and deprecated) exercises, even if it's simply using xargs and running the test command for each exercise.
The larger use case that is motivating this request is that I'd like to:
- Use the new
configlet create(or whatever) command to stub in a bunch of new (incomplete) exercises in a track. They would have statuswip. - Use a generator to generate test suites based on the
problem-specifications - Open a PR and merge to
mainwithout breaking CI.
You could still run the tests locally by doing whatever tracks do to run the tests for just one exercise, but CI wouldn’t fail as long as the exercise is wip.
Thoughts?
Could be handled by configlet info.
I'll reply more later, but I'll just quickly point out that for:
Right now I don't think CI has a default/standard tool that lets us process JSON
jq is always installed in the GitHub Actions environment.
Sources of truth:
As a starter, the below gets the practice exercise slugs that lack the status key. Just needs to include status of beta or explicit active too.
$ jq -r '.exercises.practice | .[] | select(.status == null).slug' < config.json
hello-world
two-fer
leap
bob
allergies
sum-of-multiples
grade-school
hamming
pangram
acronym
isogram
[...]
Oh, if we have jq, that solves it for me, I think!
It could still be nice to have a command like:
$ configlet list --help
Usage:
configlet list [--concept-exercises | --practice-exercises | --concepts]
[--status <status>]
<status>: comma-separated list of active,beta,deprecated,wip (default: active,beta)
So instead of using jq we could write something like:
configlet list --practice-exercises
But not a high priority for now, I think.
Agreed, definitely a nice to have, but having jq unblocks my use case. 👍