Skip to content

Commit e3234ab

Browse files
committed
Don't scan go.mod files for SGW < 3.1.0
This was leading to false positives in BD scans Change-Id: I25cff2c6930849be2e5488e8ca6865c5a7220ab0 Reviewed-on: https://review.couchbase.org/c/build-tools/+/193831 Tested-by: Chris Hillery <[email protected]> Reviewed-by: Ming Ho <[email protected]>
1 parent 6c9e21c commit e3234ab

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

blackduck/sync_gateway/prune_source.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
#!/bin/bash -ex
22

3-
#clean up unnecessary source directories
3+
RELEASE=$1
4+
VERSION=$2
5+
BLD_NUM=$3
6+
TOOLS_DIR=$4
47

5-
# Remove un-needed ns_server got pull in for to use <!-- gozip tools --> purpose
8+
# clean up unnecessary source directories
9+
10+
# Remove un-needed ns_server git pull in for to use <!-- gozip tools --> purpose
611
rm -rf godeps/src/github.com/couchbase/ns_server
712
# Remove jQuery from scan CBD-2977
813
rm -rf godeps/src/github.com/couchbase/cbgt/rest/static/lib/jquery
914

10-
#Remove beorn7 and golang_protobuf_extensions from scan CBD-3616
15+
# Remove beorn7 and golang_protobuf_extensions from scan CBD-3616
1116
rm -rf godeps/src/github.com/beorn7
1217
rm -rf godeps/src/github.com/matttproud/golang_protobuf_extensions
1318

1419
# nothing in the build repo should affect third-party reports
1520
rm -rf cbbuild
1621

17-
#MB-43341, remove couchbase CB components from blackduck report
18-
#use *couchbase*/$i to ensure these are from couchbase
22+
# SGW wasn't built with Go modules prior to 3.1, so we shouldn't look at
23+
# any go.mod files
24+
if [ "3.1.0" != $(printf "3.1.0\n${VERSION}" | sort -n | head -1) ]; then
25+
find . -type f -name go.\?\?\? -delete
26+
fi
27+
28+
# MB-43341, remove couchbase CB components from blackduck report
29+
# use *couchbase*/$i to ensure these are from couchbase
1930

2031
for i in cbauth cbgt go-couchbase go-blip gocbconnstr gocb gocbcore gocbconnstr gomemcached goutils
2132
do

0 commit comments

Comments
 (0)