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

Make scan type list rely on Dynamic parser infra. #5084

Merged
merged 19 commits into from Sep 16, 2021

Conversation

damiencarol
Copy link
Contributor

@damiencarol damiencarol commented Sep 12, 2021

Simplify code around scan type lists and parser loading/validating making some serializer/forms don't rely on DB but on code directly.

@damiencarol damiencarol changed the title Make scan type list rely on Dhynamic parser infra. Make scan type list rely on Dynamic parser infra. Sep 13, 2021
@Maffooch
Copy link
Contributor

Why is there such an urgency to remove the test_type table from the DB?

@damiencarol
Copy link
Contributor Author

@Maffooch Sorry the text was confusing. I will change the text of the PR. The goal is to have Test_type less "fixed.
I mean, as Test_type could depends on new parsers loaded dynamically, it doesn't make sense to rely on the data in the DB for the UI.

@damiencarol damiencarol marked this pull request as ready for review September 15, 2021 10:19
Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

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

Okay that sounds better. I was under the impression the goal was to remove the entire table from the database.

dojo/management/commands/initialize_test_types.py Outdated Show resolved Hide resolved
dojo/product/views.py Outdated Show resolved Hide resolved
dojo/tools/factory.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

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

Things look good to me

@StefanFl
Copy link
Member

@damiencarol I will approve this merge request if you do me one favour 😃: The list of parsers at the import page is not sorted. Please use get_choices_sorted() for the scan types in dojo/engagement/views.py/import_scan_results.

@damiencarol
Copy link
Contributor Author

I tried but it's not that simple. To do that we need to modify TestForm to fake the link between scan_type and the test_type attribute of a Test.
I failed to found an elegant way to do it. Will try again today.

@StefanFl
Copy link
Member

Not sure we talk about the same thing. I meant using get_choices_sorted() in line

'scan_types': get_choices(),

That does the trick.

@damiencarol
Copy link
Contributor Author

@StefanFl done.

@StefanFl StefanFl merged commit 1ec168e into DefectDojo:dev Sep 16, 2021
@damiencarol damiencarol deleted the make_scan_type_list_dynamic branch September 16, 2021 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants