feat: CI pipeline integration (JUnit/SARIF output, --ci flag, container entrypoint)#520
Open
ian-flores wants to merge 12 commits into
Open
feat: CI pipeline integration (JUnit/SARIF output, --ci flag, container entrypoint)#520ian-flores wants to merge 12 commits into
ian-flores wants to merge 12 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CI/pipeline-focused integration features to VIP so it can emit machine-readable artifacts (JUnit XML + SARIF) and run cleanly in containerized CI workflows via a CLI-based entrypoint.
Changes:
- Implement JUnit XML and SARIF 2.1.0 writers off the existing
ReportDatamodel. - Wire format emission into the pytest plugin via a new
--vip-formatoption, and exposevip verify --format ...plus a--cipreset in the CLI. - Update the container entrypoint to run the
vipCLI (defaulting toverify) and document the workflow in the README.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| thoughts/shared/plans/2026-07-21-issue-149-ci-integration-plan.md | Implementation plan describing writers, plugin/CLI wiring, container changes, and test strategy. |
| thoughts/shared/plans/2026-07-21-issue-149-ci-integration-design.md | Design notes and decisions for CI outputs and container invocation semantics. |
| src/vip/reporting.py | Adds write_junit_xml() and write_sarif() output writers. |
| src/vip/plugin.py | Adds --vip-format and emits JUnit/SARIF siblings at session end. |
| src/vip/cli.py | Adds vip verify --format and --ci, forwarding into pytest as --vip-format. |
| selftests/test_reporting.py | Adds unit tests for JUnit XML and SARIF writers (including XML sanitization). |
| selftests/test_plugin.py | Adds tests for plugin extra-format emission behavior. |
| selftests/test_cli_verify.py | Adds tests for CLI forwarding/validation of --format and --ci. |
| README.md | Documents CI/pipeline integration usage, artifacts, and container invocation. |
| Dockerfile | Switches ENTRYPOINT/CMD to uv run vip / verify for container-friendly CLI usage. |
Comments suppressed due to low confidence (1)
src/vip/cli.py:507
--ciis documented as running “strictly non-interactively”, butrun_verify()will still forward--interactive-auth/--headless-authif the user also passes them, which defeats the guarantee implied by--ci.
If --ci is meant to be a strict preset, consider rejecting those interactive flags when --ci is set (or explicitly overriding them off) so the behavior matches the help text.
_VALID_FORMATS = {"json", "junit", "sarif"}
fmt = "json,junit,sarif" if getattr(args, "ci", False) else getattr(args, "format", "json")
requested = [f.strip().lower() for f in fmt.split(",") if f.strip()]
unknown = [f for f in requested if f not in _VALID_FORMATS]
if unknown:
print(
f"Error: unknown --format value(s): {', '.join(unknown)}. "
f"Valid: {', '.join(sorted(_VALID_FORMATS))}.",
file=sys.stderr,
)
sys.exit(2)
cmd.append(f"--vip-format={','.join(requested)}")
if args.interactive_auth:
cmd.append("--interactive-auth")
if args.headless_auth:
cmd.append("--headless-auth")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1127
to
+1129
| formats = {f.strip().lower() for f in fmt.split(",") if f.strip()} | ||
| if not (formats & {"junit", "sarif"}): | ||
| return |
ian-flores
marked this pull request as ready for review
July 21, 2026 22:57
|
Preview Links
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes VIP consumable by customer security-ops and CI/CD pipelines (issue #149, driven by FSI feedback). Adds machine-readable output formats, a one-flag CI preset, and a CLI-based container entrypoint.
Design + plan:
thoughts/shared/plans/2026-07-21-issue-149-ci-integration-design.md.What's included
write_junit_xml()inreporting.py, standardtestsuites/testsuite/testcaseschema with VIP'sconcise_error+ scenario metadata; consumed by CI test dashboards.write_sarif(), every check emitted as a result (fail=error, pass=none, skip=note) for a full compliance audit trail; ingested by GitHub code scanning / secops tooling.vip verify --format json,junit,sarif— comma-separated, additive.results.json/failures.jsonare always written (the HTML report depends on them); JUnit/SARIF land as siblings in the report dir.vip verify --ci— preset bundling--format json,junit,sarif+--tb=short+ non-interactive.ENTRYPOINT ["uv","run","vip"]/CMD ["verify"]. Note:docker runargs replace CMD, so the CI recipe isdocker run <img> verify --ci.Issue #149 checklist advanced
--ci, exit codes, non-interactive)vipCLI (GHCR build/push already existed viadocker.yml)Testing
test_reporting,test_plugin,test_cli_verify,test_cli_report(TDD throughout).--vip-format=json,junit,sarifemits all sibling files;--format jsonemits no extras.ruff+mypyclean on changed files.Follow-ups (deferred, non-blocking)
--ciregression test pinning non-interactive flags absent.--formatvalue de-duplication (cosmetic; plugin folds to a set anyway).