-
-
Notifications
You must be signed in to change notification settings - Fork 55
Add ISO-639-1 language code validation to backend #2602
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
Conversation
Should we add a migration to replace with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just need to add migration to validate/fix existing data.
Added a migration, but it still needs some testing. Should also be merged after #2601 due to migration order |
3960e90
to
3b6d013
Compare
@ikreymer Reworked the migration and tested it locally. Now includes crawls as well. Didn't find a library that would give us a good ISO-639-1 list in a convenient format so I hardcoded it - I think should be okay since changes are infrequent and almost never happen for the most commonly used languages. Also includes crawls now :) For testing, I used the API off of main (without the backend validation added in this branch) to create some invalid data, e.g.:
then switched to this branch and ran the migration. I verified in mongo before and after that the invalid language codes were present on the workflow, crawl, and org, and then that they were fixed. |
Fixes #2599
Also adds the new
APIErrorDetail
code to the workflow editor in the frontend.