35
35
# test_linux_artifact - Test that the built artifact works where we expect it to.
36
36
# We use this to verify that e.g. the Ubuntu-built release
37
37
# binary also works on RHEL and Debian.
38
+ # generate_license_and_vulnerability_report - Generates a report of vulnerabilities affecting the bundled application.
38
39
# release_publish - Publishes the npm packages and uploads the tarballs.
39
40
functions :
40
41
checkout :
@@ -5813,6 +5814,88 @@ functions:
5813
5814
./usr/bin/mongosh --smokeTests
5814
5815
}
5815
5816
5817
+ generate_license_and_vulnerability_report :
5818
+ - command : expansions.write
5819
+ params :
5820
+ file : tmp/expansions.yaml
5821
+ redacted : true
5822
+ - command : shell.exec
5823
+ params :
5824
+ working_dir : src
5825
+ shell : bash
5826
+ env :
5827
+ NODE_JS_VERSION : ${node_js_version}
5828
+ EVERGREEN_IS_PATCH : ${is_patch}
5829
+ SNYK_TOKEN : ${snyk_token}
5830
+ script : |
5831
+ set -e
5832
+ export NODE_JS_VERSION=${node_js_version}
5833
+ source .evergreen/setup-env.sh
5834
+
5835
+ # validate licenses, we first remove THIRD_PARTY_NOTICES.md, so we are sure
5836
+ # that we would only upload the newly generated file in case of success.
5837
+ rm THIRD_PARTY_NOTICES.md
5838
+ npm run update-third-party-notices
5839
+
5840
+ # generate vulnerability report: can only fail if is not a patch.
5841
+ npm run generate-vulnerability-report || { [ "$EVERGREEN_IS_PATCH" == "true" ] && exit 0; } || exit 1
5842
+
5843
+ - command : s3.put
5844
+ params :
5845
+ aws_key : ${aws_key}
5846
+ aws_secret : ${aws_secret}
5847
+ bucket : mciuploads
5848
+ permissions : private
5849
+ visibility : signed
5850
+ local_file : src/.sbom/dependencies.json
5851
+ remote_file : ${project}/${revision}_${revision_order_id}/dependencies.json
5852
+ content_type : application/json
5853
+ optional : true
5854
+ - command : s3.put
5855
+ params :
5856
+ aws_key : ${aws_key}
5857
+ aws_secret : ${aws_secret}
5858
+ bucket : mciuploads
5859
+ permissions : private
5860
+ visibility : signed
5861
+ local_file : src/.sbom/snyk-test-result.json
5862
+ remote_file : ${project}/${revision}_${revision_order_id}/snyk-test-result.json
5863
+ content_type : application/json
5864
+ optional : true
5865
+ - command : s3.put
5866
+ params :
5867
+ aws_key : ${aws_key}
5868
+ aws_secret : ${aws_secret}
5869
+ bucket : mciuploads
5870
+ permissions : private
5871
+ visibility : signed
5872
+ local_file : src/.sbom/snyk-test-result.html
5873
+ remote_file : ${project}/${revision}_${revision_order_id}/snyk-test-result.html
5874
+ content_type : text/html
5875
+ optional : true
5876
+ - command : s3.put
5877
+ params :
5878
+ aws_key : ${aws_key}
5879
+ aws_secret : ${aws_secret}
5880
+ bucket : mciuploads
5881
+ permissions : private
5882
+ visibility : signed
5883
+ local_file : src/.sbom/vulnerability-report.md
5884
+ remote_file : ${project}/${revision}_${revision_order_id}/vulnerability-report.md
5885
+ content_type : text/markdown
5886
+ optional : true
5887
+ - command : s3.put
5888
+ params :
5889
+ aws_key : ${aws_key}
5890
+ aws_secret : ${aws_secret}
5891
+ bucket : mciuploads
5892
+ permissions : private
5893
+ visibility : signed
5894
+ local_file : src/THIRD_PARTY_NOTICES.md
5895
+ remote_file : ${project}/${revision}_${revision_order_id}/THIRD_PARTY_NOTICES.md
5896
+ content_type : text/markdown
5897
+ optional : true
5898
+
5816
5899
release_draft :
5817
5900
- command : expansions.write
5818
5901
params :
@@ -5884,6 +5967,7 @@ functions:
5884
5967
# package_and_upload_artifact - Upload the release binary to S3.
5885
5968
# test_linux_artifact - Test that the built artifact works where we expect it to.
5886
5969
# release_publish - Publishes the npm packages and uploads the tarballs.
5970
+ # generate_license_and_vulnerability_report - Generates a report of vulnerabilities affecting the bundled application.
5887
5971
# pkg_test_* - Run tests on the release packages
5888
5972
tasks :
5889
5973
- name : compile_ts
@@ -8962,11 +9046,11 @@ tasks:
8962
9046
- func : checkout
8963
9047
- func : install
8964
9048
vars :
8965
- node_js_version : " 14.21.3 "
9049
+ node_js_version : " 16.19.1 "
8966
9050
npm_deps_mode : all
8967
9051
- func : test_vscode
8968
9052
vars :
8969
- node_js_version : " 14.21.3 "
9053
+ node_js_version : " 16.19.1 "
8970
9054
- name : test_connectivity
8971
9055
tags : ["extra-integration-test"]
8972
9056
depends_on :
@@ -9009,6 +9093,20 @@ tasks:
9009
9093
vars :
9010
9094
node_js_version : " 16.19.1"
9011
9095
9096
+ - name : generate_license_and_vulnerability_report
9097
+ depends_on :
9098
+ - name : compile_ts
9099
+ variant : linux_unit
9100
+ commands :
9101
+ - func : checkout
9102
+ - func : install
9103
+ vars :
9104
+ node_js_version : " 16.19.1"
9105
+ npm_deps_mode : cli_build
9106
+ - func : generate_license_and_vulnerability_report
9107
+ vars :
9108
+ node_js_version : " 16.19.1"
9109
+
9012
9110
# ##
9013
9111
# E2E TESTS
9014
9112
# ##
@@ -11939,3 +12037,9 @@ buildvariants:
11939
12037
- name : release_draft
11940
12038
- name : release_publish_dry_run
11941
12039
- name : release_publish
12040
+
12041
+ - name : generate_license_and_vulnerability_report
12042
+ display_name : " License and Vulnerability Report"
12043
+ run_on : ubuntu2004-small
12044
+ tasks :
12045
+ - name : generate_license_and_vulnerability_report
0 commit comments