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

sync: remove source or source_url if removed in prob-specs #609

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

ee7
Copy link
Member

@ee7 ee7 commented May 21, 2022

If a source or source_url key/value pair was removed from an
exercise's metadata.toml file in exercism/problem-specifications,
configlet sync -u would incorrectly set an existing corresponding
.meta/config.json value to the empty string.

This would cause configlet lint to indicate an error, because
a source value must be a non-blank string, and a source_url value
must be a URL.

Instead, make configlet sync remove any source or source_url
key/value pair that was removed upstream.

Refs: exercism/problem-specifications@05999f34ab02
Fixes: #608


I'll check this PR again later, but I think it's close:

$ cd /tmp
$ git clone https://github.com/exercism/elm
$ cd elm
$ git checkout 8149a96a5c2c
$ configlet sync --metadata -e grade-school -uy
Updating cached 'problem-specifications' data...
Checking exercises...
[warn] metadata: unsynced: grade-school
Updated the metadata for 1 Practice Exercise
The `grade-school` exercise has up-to-date metadata!
$ git diff
--- a/exercises/practice/grade-school/.meta/config.json
+++ b/exercises/practice/grade-school/.meta/config.json
@@ -22,6 +22,5 @@
     ]
   },
   "blurb": "Given students' names along with the grade that they are in, create a roster for the school.",
-  "source": "A pairing session with Phil Battos at gSchool",
-  "source_url": "http://gschool.it"
+  "source": "A pairing session with Phil Battos at gSchool"
 }

@ee7 ee7 requested a review from ErikSchierboom as a code owner May 21, 2022 18:05
Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Nice

@ee7 ee7 mentioned this pull request May 24, 2022
@ee7 ee7 merged commit 62cb57b into exercism:main Jun 1, 2022
@ee7 ee7 deleted the sync-metadata-key-removal branch June 1, 2022 05:06
@ee7 ee7 changed the title sync(metadata): remove key that was removed upstream sync: remove source or source_url if removed in prob-specs Jun 1, 2022
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.

sync: metadata: value of removed key is set to the empty string
2 participants