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

11617 validate csv column headers #12013

Closed
wants to merge 18 commits into from
Closed

Conversation

arthanson
Copy link
Collaborator

@arthanson arthanson commented Mar 20, 2023

Fixes: #11617

Refactors the bulk import code to use common validation of headers for csv, yaml and json - this is done on each line item as yaml and json have separate headers on each item. The validation for fields that aren't in the form is skipped for (DeviceTypeImportForm, ModuleTypeImportForm) as these allow importing of related objects.

Extra tests were added to test yaml and json bulk import along with the existing csv bulk import tests, as well as test for invalid field in the import.

Note: #13500 will need to be merged before this to fix the failing test.

@arthanson arthanson changed the title DRAFT: 11617 validate csv column headers 11617 validate csv column headers Mar 20, 2023
@arthanson arthanson marked this pull request as ready for review March 20, 2023 20:35
@arthanson arthanson requested a review from jeremystretch March 20, 2023 20:35
@arthanson arthanson marked this pull request as draft April 21, 2023 16:27
@arthanson arthanson changed the title 11617 validate csv column headers DRAFT: 11617 validate csv column headers Apr 21, 2023
@arthanson arthanson changed the title DRAFT: 11617 validate csv column headers 11617 validate csv column headers Apr 25, 2023
@arthanson arthanson marked this pull request as ready for review April 25, 2023 20:55
@arthanson arthanson requested a review from jeremystretch April 25, 2023 20:55
@jeremystretch jeremystretch force-pushed the 11617-csv-bulk-validation branch from 2815b93 to 1f410cf Compare August 11, 2023 16:59
@jeremystretch
Copy link
Member

I've rebased this against the current develop branch to bring it current, which unsurprisingly has broken the tests. Further review is still needed.

@jeremystretch
Copy link
Member

I'm going to close this now that #13826 has addressed #11617 specifically, however I'll keep the branch intact as it will serve as a reference when/if we extend the header validation logic to JSON & YAML imports as well.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2023
@jeremystretch jeremystretch deleted the 11617-csv-bulk-validation branch January 4, 2024 15:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate all headers/fields when bulk import objects
3 participants