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

Implement Clock exercise for Crystal #273

Merged
merged 2 commits into from
May 24, 2022

Conversation

marksiemers
Copy link
Contributor

No description provided.

@marksiemers marksiemers force-pushed the add-clock-exercise branch from d70aa63 to f486085 Compare May 7, 2022 16:19
@marksiemers
Copy link
Contributor Author

@ErikSchierboom - I'm trying to use configlet to get things set properly.

I keep getting an error when trying to sync:

bin/configlet sync -e clock
Cloning https://github.com/exercism/problem-specifications/... failure
Cloning into '/Users/mark/Library/Caches/exercism/configlet/problem-specifications'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I am able to clone the problem-specifications repo the old fashioned way:

git clone https://github.com/exercism/problem-specifications.git
Cloning into 'problem-specifications'...
remote: Enumerating objects: 12172, done.
remote: Counting objects: 100% (1227/1227), done.
remote: Compressing objects: 100% (376/376), done.
remote: Total 12172 (delta 989), reused 925 (delta 849), pack-reused 10945
Receiving objects: 100% (12172/12172), 2.68 MiB | 8.90 MiB/s, done.
Resolving deltas: 100% (7367/7367), done.

@marksiemers marksiemers force-pushed the add-clock-exercise branch from f486085 to 6fba4ff Compare May 7, 2022 16:48
@ErikSchierboom
Copy link
Member

Weird. Could you run configlet --version? CC @ee7

@ErikSchierboom
Copy link
Member

The PR looks good. Let's figure out the configlet issue and then we can merge.

@ee7
Copy link
Member

ee7 commented May 10, 2022

Cloning into '/Users/mark/Library/Caches/exercism/configlet/problem-specifications'...

It's definitely configlet 4.0.0-beta.1 or 4.0.0-beta.2, since only the newest versions have the caching behavior.

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This is an error message from git clone itself. Perhaps it was an intermittent network connectivity issue? @marksiemers can you confirm whether the error occurs if you run it again at a moment when you definitely have good network connectivity?

If it still doesn't work, you should be able to copy problem-specifications (obtained from git clone) to

/Users/mark/Library/Caches/exercism/configlet/problem-specifications

and then run an offline sync:

configlet sync -e clock -o

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.

configlet sync -o -e clock --docs --metadata -uy would produce the below changes to this PR.

The instructions.md file and blurb,source,source_url fields of .meta/config.json should be exactly from prob-specs. You don't need to manually edit them - configlet sync can handle it (if you can get it working).

--- a/exercises/practice/clock/.docs/instructions.md
+++ b/exercises/practice/clock/.docs/instructions.md
@@ -1,25 +1,7 @@
-# Clock
-
-Welcome to Clock on Exercism's Crystal Track.
-
-## Instructions
+# Instructions
 
 Implement a clock that handles times without dates.
 
 You should be able to add and subtract minutes to it.
 
 Two clocks that represent the same time should be equal to each other.
-
-## Source
-
-### Ported by
-
-- @marksiemers
-
-### Originally Created for Ruby by
-
-- @kytrinyx
-
-### Based on
-
-Pairing session with Erin Drummond - https://twitter.com/ebdrummond
diff --git a/exercises/practice/clock/.meta/config.json b/exercises/practice/clock/.meta/config.json
index 38cbc9144..2c9f2820a 100644
--- a/exercises/practice/clock/.meta/config.json
+++ b/exercises/practice/clock/.meta/config.json
@@ -15,6 +15,6 @@
       ".meta/src/example.cr"
     ]
   },
-  "source": "Ruby Clock Exercise",
-  "source_url": "https://exercism.org/tracks/ruby/exercises/clock"
+  "source": "Pairing session with Erin Drummond",
+  "source_url": "https://twitter.com/ebdrummond"
 }

We'll also need to add the .meta/tests.toml file.

@booniepepper
Copy link

Approving, although you should incorporate the changes @ee7 is suggesting.

I'm ok if this happens outside this PR, maybe throw it in an issue if you need to troubleshoot configlet sync.

@marksiemers
Copy link
Contributor Author

marksiemers commented May 13, 2022

I think the issue with configlet and cloning is the trailing slash. I tried cloning with and without it, and the trailing slash makes it fail:

➜  git clone https://github.com/exercism/problem-specifications
Cloning into 'problem-specifications'...
remote: Enumerating objects: 12177, done.
remote: Counting objects: 100% (1125/1125), done.
remote: Compressing objects: 100% (354/354), done.
remote: Total 12177 (delta 911), reused 843 (delta 769), pack-reused 11052
Receiving objects: 100% (12177/12177), 2.69 MiB | 3.23 MiB/s, done.
Resolving deltas: 100% (7363/7363), done.
➜  rm -rf problem-specifications
➜  git clone https://github.com/exercism/problem-specifications/
Cloning into 'problem-specifications'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

UPDATE: Sorry code was the working directory and part of the prompt. Removed it to reduce confusion.

Here's my git version:

git version 2.32.0 (Apple Git-132)

@marksiemers marksiemers force-pushed the add-clock-exercise branch from 6fba4ff to ee73017 Compare May 13, 2022 02:40
@marksiemers marksiemers requested a review from ee7 May 13, 2022 02:58
@ee7
Copy link
Member

ee7 commented May 13, 2022

I think the issue with configlet and cloning is the trailing slash. I tried cloning with and without it, and the trailing slash makes it fail:

Great - many thanks for finding the cause. I'll open an issue in configlet, and fix this with the next configlet release.

I can't reproduce the problem, though. That is, this does work for me:

git clone https://github.com/exercism/problem-specifications/ 

at least on Linux, OpenBSD, and during configlet CI using Ubuntu, macOS, and Windows Server.

Maybe this provides a clue? https://stackoverflow.com/questions/56333422/git-clone-trailing-slash

@ee7
Copy link
Member

ee7 commented May 13, 2022

➜  code git clone https://github.com/exercism/problem-specifications

What is code? Is code part of the prompt, or is this e.g. VS Code running git?

And you're seeing this problem on macOS, right? What's the output of git --version?

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.

Approved, but I've only checked that configlet sync says that clock is synced:

$ git rev-parse --short HEAD
613fe7852
$ bin/fetch-configlet
$ bin/configlet sync -e clock
Updating cached 'problem-specifications' data...
Checking exercises...
The `clock` exercise has up-to-date docs, filepaths, metadata, and tests!

@ee7
Copy link
Member

ee7 commented May 20, 2022

UPDATE: Sorry code was the working directory and part of the prompt. Removed it to reduce confusion.

@marksiemers Thanks for the update.

The problem should be fixed in configlet 4.0.0-beta.3. Please let me know if it isn't. You can re-run fetch-configlet to download the new version.

I'm still curious about whether the problem lies in your git configuration. Do you still see a failure with git clone and the trailing slash if you run the below?

HOME=/dev/null git clone https://github.com/exercism/problem-specifications/

The above tries to avoid your user's git configuration. If the above works, then I think the problem should be in the output of

git config --list

as long as the below also produces no output

HOME=/dev/null git config --list

(Don't blindly paste the full output of git config --list here - it may contain sensitive information).

@booniepepper booniepepper merged commit 4e9f85a into exercism:main May 24, 2022
@marksiemers marksiemers deleted the add-clock-exercise branch May 24, 2022 19:02
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.

5 participants