Skip to content

Conversation

mingness
Copy link
Collaborator

@mingness mingness commented Sep 4, 2025

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.

Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for processing-contributions ready!

Name Link
🔨 Latest commit cd9665b
🔍 Latest deploy log https://app.netlify.com/projects/processing-contributions/deploys/68c0223b08e71e0008d0ff10
😎 Deploy Preview https://deploy-preview-101--processing-contributions.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Stefterv
Copy link
Collaborator

Stefterv commented Sep 9, 2025

fyi, you need to checkout the repo before you can use a custom action, I made the same error a bunch of times

@mingness
Copy link
Collaborator Author

mingness commented Sep 9, 2025

fyi, you need to checkout the repo before you can use a custom action, I made the same error a bunch of times

thanks, I feel a bit better

@mingness mingness requested a review from Stefterv September 9, 2025 18:18
Copy link

@catilac catilac left a comment

Choose a reason for hiding this comment

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

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')
Copy link

Choose a reason for hiding this comment

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

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!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I'll put this comment into an issue, as a possible future improvement to the code.

@mingness mingness merged commit 288986c into main Sep 9, 2025
5 checks passed
@mingness mingness deleted the fix-model-dump-tests branch September 9, 2025 21:55
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