configlet icon indicating copy to clipboard operation
configlet copied to clipboard

Feature request: listing exercises that match a set of statuses

Open kytrinyx opened this issue 3 years ago • 5 comments

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 status wip.
  • Use a generator to generate test suites based on the problem-specifications
  • Open a PR and merge to main without 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?

kytrinyx avatar Oct 26 '22 11:10 kytrinyx

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:

ee7 avatar Oct 26 '22 12:10 ee7

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
[...]

ee7 avatar Oct 26 '22 12:10 ee7

Oh, if we have jq, that solves it for me, I think!

kytrinyx avatar Oct 26 '22 12:10 kytrinyx

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.

ee7 avatar Oct 26 '22 17:10 ee7

Agreed, definitely a nice to have, but having jq unblocks my use case. 👍

kytrinyx avatar Oct 26 '22 18:10 kytrinyx