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: allow creating of exercise #845

Merged
merged 33 commits into from
Jan 19, 2024
Merged

create: allow creating of exercise #845

merged 33 commits into from
Jan 19, 2024

Conversation

ErikSchierboom
Copy link
Member

@ErikSchierboom ErikSchierboom commented Dec 19, 2023

  • Setup basic structure
  • initial work to update track config
  • Create exercise

Refs: #675

src/create/exercises.nim Outdated Show resolved Hide resolved
src/create/exercises.nim Outdated Show resolved Hide resolved
@ErikSchierboom ErikSchierboom marked this pull request as ready for review January 12, 2024 12:05
@@ -11,7 +11,7 @@ complete -c configlet -n "__fish_use_subcommand" -a lint -d "Check the tra

# subcommands with options
complete -c configlet -n "__fish_use_subcommand" -a completion -d "Output a completion script for a given shell"
complete -c configlet -n "__fish_use_subcommand" -a create -d "Add a new approach or article"
complete -c configlet -n "__fish_use_subcommand" -a create -d "Add a new exercise, approach or article"
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really familiar with how to configure this (the two new create options) for the fish shell. Would you mind taking a look?

@@ -11,7 +11,7 @@ _configlet_commands() {
"lint:Check the track configuration for correctness" \
# subcommands with options
"completion:Output a completion script for a given shell" \
"create:Add a new approach or article" \
"create:Add a new exercise, approach or article" \
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really familiar with how to configure this (the two new create options) for the zsh shell. Would you mind taking a look?

src/exec.nim Outdated Show resolved Hide resolved
src/exec.nim Outdated Show resolved Hide resolved
Copy link
Member

@ee7 ee7 left a comment

Choose a reason for hiding this comment

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

Currently, with no network connectivity, the output is:

$ configlet create --practice-exercise bottle-song
fatal: unable to access 'https://github.com/exercism/problem-specifications/': Failed to connect to github.com port 443 after 1 ms: Couldn't connect to server

failed to fetch 'main' in problem-specifications directory: '/home/foo/.cache/exercism/configlet/problem-specifications'
Error: Unable to update the problem-specifications cache.

You can either:

- ensure that you have network connectivity, and run the same configlet command again
- or add the '--offline' option to skip updating the cache

The most recent commit in the problem-specifications cache is:

    commit b639e933ac8b3db59b8f1f1fcd0da48159920119
    Author:     Jesse Kroon <156132898+jesse-kroon@users.noreply.github.com>
    CommitDate: Mon, 15 Jan 2024 21:06:24 +0000

        Fixing a few spelling and puncuation issues (#2361)

However, if we pass --offline, we get:

Error: invalid option for 'create': '--offline'

Could you make create support --offline? Approval conditional upon that (but feel free to do a follow-up PR if that's easier).

Also, can we make create output a status message when it hits the network? If we configlet sync, we see:

Updating cached 'problem-specifications' data...

so that it doesn't appear to hang when there's network problems. But right now, create can appear to hang, right?

I'm not able to review as thoroughly as I'd like, but I tried creating some practice exercises and it looked good to me :)

Great to finally have this feature.

src/create/exercises.nim Outdated Show resolved Hide resolved
tests/test_binary_create.nim Show resolved Hide resolved
tests/test_binary_create.nim Outdated Show resolved Hide resolved
tests/test_binary_create.nim Outdated Show resolved Hide resolved
@ErikSchierboom
Copy link
Member Author

I've added --offline support, addressed the review comments and un-silenced the prob-specs update message.

@ee7
Copy link
Member

ee7 commented Jan 19, 2024

Great. I think this can close #675, right? Let's create follow-up issues if there's other things to track here.

@ee7 ee7 merged commit 8c3e63e into main Jan 19, 2024
9 checks passed
@ee7 ee7 deleted the create-exercise branch January 19, 2024 08:10
--article <slug> The slug of the article
--practice-exercise <slug> The slug of the concept exercise
--concept-exercise <slug> The slug of the practice exercise
-e, --exercise <slug> Only operate on this exercise
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the option description here. But unfortunately it's common to all of the --exercise descriptions, I think.

@SleeplessByte
Copy link
Member

FYI @ErikSchierboom , this release is missing the windows binary.

@ErikSchierboom
Copy link
Member Author

@SleeplessByte I'm seeing several Windows files here: https://github.com/exercism/configlet/releases/tag/4.0.0-beta.18 And when I download one and extract, there is an executable.

@SleeplessByte
Copy link
Member

Weird! Those really were not showing up when I posted. Ignore then!

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.

3 participants