Skip to content

Only include published evidence when export scope is published - #57

Open
caitmich wants to merge 2 commits into
mainfrom
qa/evidence-content-service-scope
Open

Only include published evidence when export scope is published#57
caitmich wants to merge 2 commits into
mainfrom
qa/evidence-content-service-scope

Conversation

@caitmich

@caitmich caitmich commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Exporter#export called issue.evidence directly to build the Evidence rows, bypassing the Published/All export scope that content_service.all_issues already respects.
We don't want a published-scope export to include Draft/Ready-for-review Evidence in the exported CSV.

  • Both call sites now use a content_service.all_evidence lookup, fetched once and grouped by issue_id, instead of issue.evidence. This avoids re-querying evidence per issue (an N+1) while still only ever surfacing evidence for issues in the exported (already scope-filtered) set.
  • Depends on dradis-plugins gem changes (branch feature/evidence-content-service-scope) for all_evidence — needs a real dradis-plugins release + Gemfile bump before this merges. See dradis-plugins PR #127.
  • Added spec/lib/dradis/plugins/csv_export/exporter_spec.rb — no exporter spec previously existed for this gem.

Part of the same review-comment follow-up as qa/add-evidence-review-state (Evidence now has an independent Draft/Ready for review/Published state).

Testing Steps

From the Dradis Pro app directory, with this gem checked out at a sibling path, temporarily point the Gemfile at this branch/path and run:

bin/rspec [dradis-csv_export path]/spec/lib/dradis/plugins/csv_export/exporter_spec.rb

Assert all examples pass, confirming a Published-scope export includes only Published evidence content, and an All-scope export includes both Published and Draft evidence content.

Check List

  • Added a CHANGELOG entry
  • Added specs

Comment thread lib/dradis/plugins/csv_export/exporter.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants