-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add all existing finding notes to the JIRA when created #6449
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
bb3827c
to
9bcd30d
Compare
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.
Great change! We need some unit tests here though.
This would be a good place to add them. Be sure to read the block comment up top for use of the VCR recording (mimics the response from the jira server)
django-DefectDojo/unittests/test_jira_import_and_pushing_api.py
Lines 14 to 32 in c101e47
# these tests are using vcrpy to record traffic to and from JIRA: https://vcrpy.readthedocs.io/en/latest/usage.html | |
# after being recorded, the traffic is used for future runs of the tests | |
# this allows us to locally develop tests, run them, make them work against a real JIRA instance. | |
# after that we can commit the tests AND the recordings (cassettes). | |
# the record_mode is set to 'once' by default. this means it will replay responses from the cassette, if there is a cassette. | |
# otherwise it will create a new cassette and record responses. on the next run the cassette wil be used. | |
# if changing tests, you can best remove all cassettes before running the tests. | |
# or you can temporarily set the record_mode to all the make it always go to the real JIRA and record all the traffic. | |
# when the tests are finished, you'll have to set the assertCassettePlayed method to make it assert | |
# that all entries in the cassette have been used by the test. | |
# if you need some credentials for the Defect Dojo JIRA Cloud instance, contact one of the moderators | |
# some senstive data is filtered out by the filter_headers config option below | |
# as well as some custom callback functions to filter out cookies. | |
# please check the recorded files on sensitive data before committing to git |
@Maffooch It looks like modifying test_import_with_push_to_jira_add_comment in that file to set push_to_jira=false on the initial import, then add the comment and push to JIRA, should work. However, I don't think I can add a test without: "# if you need some credentials for the Defect Dojo JIRA Cloud instance, contact one of the moderators" |
9bcd30d
to
e2fe8af
Compare
@Maffooch @damiencarol How can we move forward with getting this merged? |
@coheigea This totally slipped through the cracks. Sorry about that! I will add a test for this today. |
Tested locally correctly.
Fixes: #6434