Skip to content

Commit 7d3c953

Browse files
committed
fix(cyclonedx): depend on public vdb-cyclonedx module so go install works
Consume github.com/Vulnetix/vdb-cyclonedx as a public tagged module (v0.1.0) instead of a third_party/ copy behind a local replace. The replace was ignored by 'go install module@version' (it can only fetch from the module proxy), which broke the documented 'go install github.com/vulnetix/cli/v3@latest' install path. Drop the third_party copy and the replace; restore the Dockerfile dependency-cache layer; replace the sync recipe with 'just update-vdb-cyclonedx <version>'.
1 parent 063d207 commit 7d3c953

27 files changed

Lines changed: 14 additions & 30995 deletions

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ WORKDIR /app
66
# Install git (needed for go mod)
77
RUN apk add --no-cache git
88

9-
# Copy the full source first. The go.mod replace points at the in-repo
10-
# third_party/vdb-cyclonedx copy, which must be present before dependency
11-
# resolution — so it cannot be split into a go.mod-only cache layer.
12-
COPY . .
9+
# Copy go mod files
10+
COPY go.mod go.sum ./
1311

12+
# Download dependencies
1413
RUN go mod download
1514

15+
# Copy source code
16+
COPY . .
17+
1618
# Build the binary
1719
RUN CGO_ENABLED=0 GOOS=linux go build \
1820
-ldflags "-s -w -X github.com/vulnetix/cli/v3/cmd.version=docker" \

go.mod

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.25.0
44

55
require (
66
github.com/Masterminds/semver/v3 v3.5.0
7-
github.com/Vulnetix/vdb-cyclonedx v0.0.0
7+
github.com/Vulnetix/vdb-cyclonedx v0.1.0
88
github.com/alecthomas/chroma/v2 v2.26.1
99
github.com/charmbracelet/bubbles v1.0.0
1010
github.com/charmbracelet/bubbletea v1.3.10
@@ -94,12 +94,3 @@ require (
9494
gopkg.in/warnings.v0 v0.1.2 // indirect
9595
sigs.k8s.io/yaml v1.6.0 // indirect
9696
)
97-
98-
// vdb-cyclonedx is the canonical CycloneDX parser/validator shared across the
99-
// Vulnetix Go services. The CLI is released as a standalone binary built from a
100-
// CLI-only checkout (Dockerfile / GitHub Action / goreleaser), so the sibling
101-
// module is not on disk at build time. We carry a synced copy under
102-
// third_party/ (refresh with: just sync-vdb-cyclonedx) and replace onto it so
103-
// release builds stay hermetic without full vendoring (which prunes the
104-
// go-tree-sitter CGO headers).
105-
replace github.com/Vulnetix/vdb-cyclonedx => ./third_party/vdb-cyclonedx

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
77
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
88
github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM=
99
github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=
10+
github.com/Vulnetix/vdb-cyclonedx v0.1.0 h1:LI/8ypN7MabidtCcjUFCjI5CSG+WS6BfX/FxHGS/1nw=
11+
github.com/Vulnetix/vdb-cyclonedx v0.1.0/go.mod h1:0YeNSe1jhyjAZdAQ8Atkj8wZj2XzLjVXdu3P6qlTBh8=
1012
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
1113
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
1214
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=

justfile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,22 +502,12 @@ deps:
502502
go mod download
503503
go mod tidy
504504

505-
# Refresh the in-repo copy of the canonical vdb-cyclonedx module. The CLI is
506-
# released from a standalone checkout (no sibling on disk), so we carry a synced
507-
# copy under third_party/ and replace onto it. Run this after changing
508-
# ../vdb-cyclonedx so the CLI picks up the new parser/validator + schemas.
509-
sync-vdb-cyclonedx:
510-
#!/usr/bin/env bash
511-
set -euo pipefail
512-
src="../vdb-cyclonedx"
513-
dst="third_party/vdb-cyclonedx"
514-
if [ ! -d "$src" ]; then echo "ERROR: $src not found (clone it alongside the CLI)"; exit 1; fi
515-
rm -rf "$dst"
516-
mkdir -p "$dst"
517-
cp -a "$src"/. "$dst"/
518-
rm -rf "$dst/.git" "$dst/.vulnetix"
505+
# Bump the pinned vdb-cyclonedx version. vdb-cyclonedx is a public tagged Go
506+
# module (github.com/Vulnetix/vdb-cyclonedx); tag a new release there, then run
507+
# this to point the CLI at it.
508+
update-vdb-cyclonedx VERSION:
509+
go get github.com/Vulnetix/vdb-cyclonedx@{{VERSION}}
519510
go mod tidy
520-
echo "synced $dst from $src"
521511

522512
# Build and run with test UUID
523513
run: build

third_party/vdb-cyclonedx/.gitignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

third_party/vdb-cyclonedx/PLAN.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

third_party/vdb-cyclonedx/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)