Skip to content

Commit f50e51c

Browse files
committed
NV-4418 Make the GitLab pipeline self-contained
Fetch the SARIF-to-GitLab converter from its single canonical location in the convert stage, so a repo that copy-pastes only this YAML (without bundling the Python script) still produces the report on the final stage. Use curl -sSfL so a missing or moved converter fails loudly instead of emitting an empty report. The fetch pins to the mutable 'main' branch (a deliberate POC choice so it picks up converter fixes); a comment flags that it should be pinned to a tag/SHA before promotion. The now-unused in-repo converter is marked superseded; its removal is tracked under NV-4412. Kept minimal on purpose: the reports:sast mislabel, python:3.9 image, dind socket, scan-id parse, and rules/workflow gating are deferred to the Phase 1 CLI export work (NV-4412), which replaces this fetch with "nightvision export gitlab".
1 parent 7c23b85 commit f50e51c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.gitlab-ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,18 @@ dast_scan:
6666

6767
convert_sarif_to_gitlab:
6868
stage: convert_sarif_to_gitlab
69-
image: python:3.9
69+
image: python:3.9
7070
script:
71+
# Fetch the converter from its single canonical location so this pipeline is
72+
# self-contained: a repo that copy-pastes only this YAML (without bundling the
73+
# Python script) still produces the report on this final stage. (NV-4418.)
74+
# -f makes curl fail loudly on an HTTP error so a missing/moved converter does not
75+
# silently produce an empty report.
76+
# POC limitation: this pins to the mutable 'main' branch (no tag/SHA or checksum),
77+
# so a converter change is picked up automatically. Pin to a tag/commit SHA before
78+
# promoting this pattern past the POC.
79+
# Phase 1 (NV-4412) replaces this fetch + script with `nightvision export gitlab`.
80+
- curl -sSfL https://raw.githubusercontent.com/nvsecurity/nv-public-reference/main/sarif/convert_sarif_to_gitlab.py -o convert_sarif_to_gitlab.py
7181
- python3 convert_sarif_to_gitlab.py
7282
artifacts:
7383
reports:

convert_sarif_to_gitlab.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SUPERSEDED: the GitLab pipeline (.gitlab-ci.yml) now fetches the single canonical
2+
# converter from nvsecurity/nv-public-reference at runtime, so this in-repo copy is no
3+
# longer used by CI. Kept only to avoid a noisy delete on this POC branch; removal is
4+
# tracked under NV-4412. Do not edit this copy - change the canonical converter.
15
import json
26
from datetime import datetime
37

0 commit comments

Comments
 (0)