Skip to content

feat(report): add markdown report format for CI/CD - #165

Merged
advaitpatel merged 1 commit into
OWASP:mainfrom
ALDRIN121:feature/add-markdown-report
Sep 7, 2026
Merged

feat(report): add markdown report format for CI/CD#165
advaitpatel merged 1 commit into
OWASP:mainfrom
ALDRIN121:feature/add-markdown-report

Conversation

@ALDRIN121

Copy link
Copy Markdown
Contributor

Description

Adds Markdown as a supported DockSec report format, allowing scan results to be published directly into pull request comments, CI/CD job summaries, and other Markdown-compatible interfaces — no more jq-based conversion pipelines.

docksec path/to/Dockerfile --format markdown

The report reuses the same normalized scan data as the existing HTML/PDF/JSON/CSV exporters:

  • Severity Summary: vulnerability counts grouped by severity (zero-count severities omitted)
  • Vulnerabilities: readable table with ID, Severity, Package, Installed Version, Fixed Version, and Title (pipe characters escaped so rows stay intact)

Markdown is opt-in: the default report bundle stays json, csv, pdf, html so existing workflows are untouched, and it can be combined with other formats (--format json,markdown).

Closes #159

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Code style update
  • Code refactoring
  • Performance improvement
  • Test update
  • Build / CI configuration
  • Security fix

How Has This Been Tested?

  • Unit tests
  • Manual testing

Test Configuration:

  • Python version: 3.12.7
  • Operating System: macOS (Darwin 25.6.0)
  • DockSec version: main @ 77c0cd1

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project (Black line-length 88, conventional commits).
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation (README, CHANGELOG, CLI help, config schema, action.yml).
  • My changes generate no new warnings or errors (ruff check passes).
  • I have added tests that prove my fix is effective or that my feature works (7 new tests).
  • All existing tests pass (256 passed, 2 skipped).
  • Any dependent changes have been merged and published in downstream modules.

Screenshots (if applicable)

N/A

Related Issues / PRs

Relates to #159

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Adds a lightweight .md report that renders natively in pull request
comments and CI job summaries. The report reuses the normalized
vulnerability data: severity counts grouped by severity plus a readable
table of findings with fixed versions.

- New ReportGenerator.generate_markdown_report() with _escape_markdown()
  table-cell escaping; registered in generate_all_reports as opt-in
- --format accepts markdown; default report bundle stays json/csv/pdf/html
- Updated CLI help, config schema, action.yml, README, CHANGELOG
- 7 new tests: generation, escaping, empty/waived case, opt-in default
  behavior, CLI --format threading
@github-actions github-actions Bot added documentation Improvements or additions to documentation cli Changes to the CLI entry point reports Changes to report generation docker Changes to Docker/container assets tests Changes to the test suite labels Aug 28, 2026
@ALDRIN121

Copy link
Copy Markdown
Contributor Author

Hi @advaitpatel — this PR implements #159 (Markdown report format for CI/CD). Would appreciate a review when you get a chance. All checks and the full test suite pass locally (256 passed, 2 skipped).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.37288% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.19%. Comparing base (a2fe184) to head (1f17879).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
docksec/report_generator.py 82.69% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
+ Coverage   78.95%   80.19%   +1.24%     
==========================================
  Files          26       32       +6     
  Lines        4158     5101     +943     
==========================================
+ Hits         3283     4091     +808     
- Misses        875     1010     +135     
Flag Coverage Δ
unittests 80.19% <92.37%> (+1.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@advaitpatel advaitpatel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@advaitpatel
advaitpatel merged commit dc6a143 into OWASP:main Sep 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Changes to the CLI entry point docker Changes to Docker/container assets documentation Improvements or additions to documentation reports Changes to report generation tests Changes to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add markdown report output for CI/CD

3 participants