test model dump and fix, add tests to pr workflow#101
Merged
Conversation
✅ Deploy Preview for processing-contributions ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Stefterv
reviewed
Sep 9, 2025
Collaborator
|
fyi, you need to checkout the repo before you can use a custom action, I made the same error a bunch of times |
Collaborator
Author
thanks, I feel a bit better |
catilac
approved these changes
Sep 9, 2025
Contributor
catilac
left a comment
There was a problem hiding this comment.
Approved. Left a suggestion
Comment on lines
+64
to
+79
| if field in contribution: | ||
| if field == 'id': | ||
| fh.write(f'{field}={contribution[field]:03}\n') | ||
| elif field == 'categories': | ||
| if contribution['type'] == 'library': | ||
| fh.write(f'{field}={",".join(contribution[field]) if contribution[field] else ""}\n') | ||
| else: | ||
| # categories are only relevant for libraries, except for examples with "Books" as category | ||
| if contribution[field] and 'Books' in contribution[field]: | ||
| fh.write(f'{field}={",".join(contribution[field]) if contribution[field] else ""}\n') | ||
| else: | ||
| fh.write(f'{field}=\n') | ||
| elif field == 'compatibleModesList': | ||
| fh.write(f'modes={contribution[field]}\n') | ||
| else: | ||
| fh.write(f'{field}={"" if contribution[field] is None else contribution[field]}\n') |
Contributor
There was a problem hiding this comment.
I think using a match statement on field could potentially improve readability. It could also help to put that logic into a write_field() helper. Just a non-blocking suggestion!
Collaborator
Author
There was a problem hiding this comment.
Thanks, I'll put this comment into an issue, as a possible future improvement to the code.
Stefterv
approved these changes
Sep 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In recent failed run of contributions update after the additions of latest two contributions, saw that the validation of the properties dictionary and the output of the validation step had some bugs - default values were not exported. Here, have created tests of what we expect, and fixed the data dump. Also moved some parts of script into functions, in anticipation of adding testing.
created pr workflow that runs the tests, and the steps of the update flow.