-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
sync throws error when config.json has "contributors": null
#500
Comments
@verdammelt -- I think there was a change in the |
If by 'enforced' you mean: "sync will throw an error" then yep - seeing that behavior. If you mean "lint will signal a problem" then nope... Quoting configlet lint output:
|
oof! Yep, that looks like a problem... |
@BethanyG thanks for the info. Sounds like this might actually be a lint issue... I'm going to push a commit that fixes all my configs... I'll leave this issue so correct fix can be discussed |
@verdammelt Please run I can confirm that the common-lisp track is the only track right now with this problem with $ rg --sort path --files-with-matches -uu '"contributors": null'
common-lisp/exercises/practice/all-your-base/.meta/config.json
common-lisp/exercises/practice/atbash-cipher/.meta/config.json
common-lisp/exercises/practice/binary/.meta/config.json
common-lisp/exercises/practice/binary-search/.meta/config.json
common-lisp/exercises/practice/collatz-conjecture/.meta/config.json
common-lisp/exercises/practice/crypto-square/.meta/config.json
common-lisp/exercises/practice/grains/.meta/config.json
common-lisp/exercises/practice/hamming/.meta/config.json
common-lisp/exercises/practice/isogram/.meta/config.json
common-lisp/exercises/practice/leap/.meta/config.json
common-lisp/exercises/practice/pascals-triangle/.meta/config.json
common-lisp/exercises/practice/perfect-numbers/.meta/config.json
common-lisp/exercises/practice/prime-factors/.meta/config.json
common-lisp/exercises/practice/rna-transcription/.meta/config.json
common-lisp/exercises/practice/trinary/.meta/config.json |
@ee7 will do.
Common Lisp - always at the front, leading the way! :/ |
I should say: I think the problem is in
(I'll eventually create issues for the other items). I think the intention was to PR to every track with both:
which would avoid the issue by forcing tracks to have formatted config files... but we didn't get around to that yet. But regardless, I agree that So I think the options are:
If there aren't objections, I suggest we do option 2 because:
Agreed, @ErikSchierboom? |
Agreed. Option 2 is the best option I feel. edit: p.s. the website will gracefully handle > nil.to_a
=> [] |
I wrote:
But it turns out that I misremembered. I'd already tried to do option 2, which is why the problem occurs only when updating (not when just syncing). Fix in #501. |
Before this commit, when updating a `.meta/config.json` file that contained an optional key with the value of `null`, configlet would produce an `UnpackDefect`. For example, the below tries to update a file that contains `"contributors": null`: $ git clone https://github.com/exercism/common-lisp $ cd common-lisp $ git checkout 4fc524e24a69 $ configlet sync --metadata -e binary -u Checking exercises... Cloning https://github.com/exercism/problem-specifications/... success [warn] metadata: unsynced: binary sync the above metadata ([y]es/[n]o)? y options.nim(194) get Error: unhandled exception: Can't obtain a value from a `none` [UnpackDefect] `configlet fmt` removes optional key/value pairs when the value is `null`, and only the Common Lisp and Julia tracks had such a value, but `configlet sync -u` should still handle this situation properly. The bug: our `pretty` proc serializes from a list of keys, and relied on optional values being non-null. `configlet fmt` added only keys with non-null values to that list, but `configlet sync` tried to preserve null values to reduce noise in diffs. Fix by ensuring that `pretty` in sync mode can no longer sometimes use `get` with a `none`. Fixes: #500
Not sure if this is an issue with
configlet
per se or a general problem of my track's practice execise config.json files.(UPDATE: this might be a
lint
bug since lint is reporting no problems and my config may in fact be invalid.)Out of 43 exercises my track has 15 which has
"contributors": null
in their config.json files. (I don't think I did that myself so perhaps it is a left-over of some earlier tooling?)At least one of these needs their metadata updated (for example 'binary') and I get the following when i try to update it:
Replacing the contributors value with
[]
or removing it altogether corrects the issue.The text was updated successfully, but these errors were encountered: