Skip to content

feat : add markdown report export support#1592

Open
kavin553 wants to merge 2 commits into
utksh1:mainfrom
kavin553:feat/markdown-report-export
Open

feat : add markdown report export support#1592
kavin553 wants to merge 2 commits into
utksh1:mainfrom
kavin553:feat/markdown-report-export

Conversation

@kavin553

@kavin553 kavin553 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Added support for Markdown (.md) report export in SecuScan.

✨ Changes

  • Added generate_markdown_report() in reporting.py.
  • Added a new /report/md download endpoint in routes.py.
  • Markdown reports now include:
    • Executive Summary
    • Scan Details
    • Scan Parameters
    • Technical Findings
    • Severity Information
    • Evidence & Remediation
  • Maintained consistency with the existing PDF, HTML, CSV, and SARIF report formats.

Related Issues

Closes #<1587>


Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Generated Markdown reports using sample scan results.
  • Verified the .md file downloads successfully through the new API endpoint.
  • Confirmed formatting renders correctly in Markdown viewers.
  • Ensured existing PDF, HTML, CSV, and SARIF exports remain unaffected.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code where appropriate.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

Additional Notes

This feature improves report portability by allowing users to easily read, share, version-control, and integrate scan reports into documentation platforms such as GitHub, GitLab, MkDocs, and other Markdown-compatible tools.

@kavin553

kavin553 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for taking the time to review this PR! 🚀

This PR introduces Markdown report export while keeping the reporting system consistent with the existing HTML, PDF, CSV, and SARIF formats. I focused on maintaining clean formatting and minimizing the impact on the current codebase.

I appreciate any feedback or suggestions for improvement. Thank you! 😊

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Requesting changes (per project rules): this PR is missing a link to an open, approved issue (no closing issue reference found).

Please open the appropriate issue first and update the PR so it links to that issue.

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please add unit tests for the markdown report generation (both the generate_markdown_report function and the new /task/{task_id}/report/md endpoint) to ensure coverage before merging.

@utksh1 utksh1 added type:feature Feature work category bonus label area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs labels Jul 3, 2026
@utksh1 utksh1 added the priority:medium Important issue with normal urgency label Jul 3, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is a great feature! However, there don't appear to be any tests added for the new markdown export. Could you please add some unit tests (e.g. in test_reporting.py) verifying that generate_markdown_report() handles findings correctly? Once tests are added, we can merge.

@kavin553

kavin553 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @utksh1 👋

Thank you for the detailed review and valuable feedback.

I've addressed all the requested changes:

  • ✅ Linked this PR to the appropriate approved issue.
  • ✅ Added unit tests for generate_markdown_report().
  • ✅ Added tests for the /task/{task_id}/report/md endpoint.
  • ✅ Verified that all tests pass successfully.
  • ✅ Updated the PR with the latest changes.

I believe all review comments have now been addressed. Could you please take another look when you have time? If there's anything else that should be improved, I'd be happy to make the necessary changes.

Thank you for your time and review! 🚀

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The markdown export feature itself looks good, but two previous review items were not addressed:

1. No issue linked: The PR body still has a raw Closes #<issue-number> placeholder that was never filled in. Please link to a real, approved issue.

2. No tests added: Zero unit tests for generate_markdown_report() or the /task/{task_id}/report/md endpoint. Please add tests in testing/backend/test_reporting.py covering:

  • generate_markdown_report() with various payloads (no findings, findings with all fields, findings with missing fields)
  • The endpoint (auth check, 404 for non-existent task, 400 for unfinished task, successful download)

@kavin553

kavin553 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @utksh1! 👋

Thank you for reviewing my PR and for your detailed feedback.

I've completed the requested changes:

  • ✅ Linked this PR to the approved issue.
  • ✅ Added the requested unit tests for generate_markdown_report().
  • ✅ Added endpoint tests for /task/{task_id}/report/md.
  • ✅ Verified that all CI checks are now passing successfully.

If there are any remaining changes required, please let me know and I'll address them promptly.

Otherwise, could you please re-review the PR and remove the "Changes Requested" review so it can be merged?

Thank you for your time and support! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs priority:medium Important issue with normal urgency type:feature Feature work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants