Skip to content

Commit 0a73879

Browse files
authored
fix: CVEList specify a different output (google#4107)
I think there's a minor bug that it's capturing everything inside the local dir so it's trying to cp everything twice. this should hopefully fix that
1 parent 23434ba commit 0a73879

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

vulnfeeds/cmd/cve-bulk-converter/run-cvelist-converter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ fi
5454
echo "Commence CVEList bulk conversion run"
5555
./cve-bulk-converter \
5656
--years="2022,2023,2024,2025" \
57-
--out_dir="${LOCAL_OUT_DIR}" \
57+
--out_dir="${LOCAL_OUT_DIR}/${OSV_OUTPUT_PATH}" \
5858
--workers="${NUM_WORKERS}"
5959

6060
# Copy results to staging area.
6161
echo "Copying CVEList records successfully converted to OSV to aggregated staging"
62-
find "${LOCAL_OUT_DIR}" -type f -name \*.json \
62+
find "${LOCAL_OUT_DIR}/${OSV_OUTPUT_PATH}" -type f -name \*.json \
6363
-exec cp '{}' "${LOCAL_OUT_DIR}/gcs_stage/" \;
6464

6565
# Copy (and remove any missing) results to GCS bucket, with some sanity

vulnfeeds/cves/versions.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ func ReposFromReferences(cve string, cache VendorProductToRepoMap, vp *VendorPro
10151015
if !RefAcceptable(ref, tagDenyList) {
10161016
// Also remove it if previously added under an acceptable tag.
10171017
MaybeRemoveFromVPRepoCache(cache, vp, ref.URL)
1018-
logger.Info("Disregarding due to a denied tag", slog.String("cve", cve), slog.String("url", ref.URL), slog.Any("product", vp), slog.Any("tags", ref.Tags))
1018+
logger.Info(fmt.Sprintf("[%s] Disregarding due to a denied tag", cve), slog.String("cve", cve), slog.String("url", ref.URL), slog.Any("product", vp), slog.Any("tags", ref.Tags))
10191019

10201020
continue
10211021
}
@@ -1036,10 +1036,10 @@ func ReposFromReferences(cve string, cache VendorProductToRepoMap, vp *VendorPro
10361036
repos = append(repos, repo)
10371037
MaybeUpdateVPRepoCache(cache, vp, repo)
10381038
}
1039-
if vp != nil {
1040-
logger.Info("Derived repos using references", slog.String("cve", cve), slog.Any("repos", repos), slog.String("vendor", vp.Vendor), slog.String("product", vp.Product))
1039+
if vp != nil && repos != nil {
1040+
logger.Info(fmt.Sprintf("[%s] Derived repos using references", cve), slog.String("cve", cve), slog.Any("repos", repos), slog.String("vendor", vp.Vendor), slog.String("product", vp.Product))
10411041
} else {
1042-
logger.Info("Derived repos (no CPEs) using references", slog.String("cve", cve), slog.Any("repos", repos))
1042+
logger.Info(fmt.Sprintf("[%s] Derived repos (no CPEs) using references", cve), slog.String("cve", cve), slog.Any("repos", repos))
10431043
}
10441044

10451045
return repos

0 commit comments

Comments
 (0)