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

Always upload old style and new style methodologies #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/dradis/plugins/projects/upload/v3/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ def finalize_lists
# Private: Restore Board, List and Card information from the project
# template.
def parse_methodologies(template)
if template_version == 1
# Restore Board from old xml methodology format
process_v1_methodologies(template)
else
process_v2_methodologies(template)
end
# old methodologies format
process_v1_methodologies(template)

# new methodologies format
process_v2_methodologies(template)
Copy link
Contributor

Choose a reason for hiding this comment

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

In the event a methodology is imported by process_v1_methodologies(template) does process_v2_methodologies(template) essentially become a no-op?
Or vice-versa. It'll run but nothing will happen?

Copy link
Contributor Author

@dormi dormi Sep 27, 2019

Choose a reason for hiding this comment

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

Exactly, that is the idea.
The code is already there:
If no old style methodologies are present, we just return: https://github.com/dradis/dradis-projects/blob/master/lib/dradis/plugins/projects/upload/v3/template.rb#L169
If no new methodologies are present, we don't enter the loop:
https://github.com/dradis/dradis-projects/blob/master/lib/dradis/plugins/projects/upload/v3/template.rb#L130
I thought on adding an explicit return in new methodologies too. But I think it works like this.

end

# Private: For each XML card block, we're creating a new Card instance,
Expand Down