Skip to content

Commit 741a38b

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 29f4d2d + d4a1dec commit 741a38b

File tree

126 files changed

+2716
-2508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+2716
-2508
lines changed

.evergreen/functions.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,29 @@ functions:
566566
tar -xvz)
567567
export COMPASS_CRYPT_LIBRARY_PATH=$(echo $PWD/mongodb-crypt/lib/mongo_*_v1.*)
568568
npm run test-csfle --workspace mongodb-data-service
569+
570+
verify-artifacts:
571+
- command: shell.exec
572+
params:
573+
working_dir: src
574+
shell: bash
575+
env:
576+
# These are set in the apply-compass-target-expansion func
577+
WINDOWS_EXE_NAME: ${windows_setup_filename}
578+
WINDOWS_MSI_NAME: ${windows_msi_filename}
579+
WINDOWS_ZIP_NAME: ${windows_zip_filename}
580+
WINDOWS_NUPKG_NAME: ${windows_nupkg_full_filename}
581+
OSX_DMG_NAME: ${osx_dmg_filename}
582+
OSX_ZIP_NAME: ${osx_zip_filename}
583+
RHEL_RPM_NAME: ${linux_rpm_filename}
584+
RHEL_TAR_NAME: ${rhel_tar_filename}
585+
LINUX_DEB_NAME: ${linux_deb_filename}
586+
LINUX_TAR_NAME: ${linux_tar_filename}
587+
script: |
588+
set -e
589+
# Load environment variables
590+
eval $(.evergreen/print-compass-env.sh)
591+
.evergreen/verify-artifacts.sh
569592
570593
save-all-artifacts:
571594
- command: s3.put
@@ -641,13 +664,6 @@ functions:
641664
remote_file: ${project}/${revision}_${revision_order_id}/${linux_rpm_filename}
642665
content_type: application/x-redhat-package-manager
643666
optional: true
644-
- command: s3.put
645-
params:
646-
<<: *save-artifact-params-public
647-
local_file: src/packages/compass/dist/${linux_rpm_sign_filename}
648-
remote_file: ${project}/${revision}_${revision_order_id}/${linux_rpm_sign_filename}
649-
content_type: application/pgp-signature
650-
optional: true
651667
- command: s3.put
652668
params:
653669
<<: *save-artifact-params-public

.evergreen/tasks.in.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ tasks:
105105
- func: apply-compass-target-expansion
106106
vars:
107107
compass_distribution: <% out(packageTask.vars.compass_distribution) %>
108+
- func: spawn-signing-server
108109
- func: package
109110
vars:
110111
debug: 'hadron*,mongo*,compass*,electron*'
111112
compass_distribution: <% out(packageTask.vars.compass_distribution) %>
113+
- func: verify-artifacts
112114
- func: save-all-artifacts
113115
vars:
114116
compass_distribution: <% out(packageTask.vars.compass_distribution) %>

.evergreen/tasks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ tasks:
110110
vars:
111111
debug: 'hadron*,mongo*,compass*,electron*'
112112
compass_distribution: compass
113+
- func: verify-artifacts
113114
- func: save-all-artifacts
114115
vars:
115116
compass_distribution: compass
@@ -130,6 +131,7 @@ tasks:
130131
vars:
131132
debug: 'hadron*,mongo*,compass*,electron*'
132133
compass_distribution: compass-readonly
134+
- func: verify-artifacts
133135
- func: save-all-artifacts
134136
vars:
135137
compass_distribution: compass-readonly
@@ -150,6 +152,7 @@ tasks:
150152
vars:
151153
debug: 'hadron*,mongo*,compass*,electron*'
152154
compass_distribution: compass-isolated
155+
- func: verify-artifacts
153156
- func: save-all-artifacts
154157
vars:
155158
compass_distribution: compass-isolated

.evergreen/verify-artifacts.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#! /usr/bin/env bash
2+
3+
set -e
4+
5+
ARTIFACTS_DIR="packages/compass/dist"
6+
echo "Verifying artifacts at $ARTIFACTS_DIR"
7+
ls -l $ARTIFACTS_DIR
8+
9+
# Use tmp directory for all gpg operations
10+
GPG_HOME=$(mktemp -d)
11+
TMP_FILE=$(mktemp)
12+
COMPASS_KEY="https://pgp.mongodb.com/compass.asc"
13+
14+
trap_handler() {
15+
local code=$?
16+
if [ $code -eq 0 ]; then
17+
echo "Verification successful"
18+
else
19+
echo "Verification failed with exit code $code"
20+
cat "$TMP_FILE"
21+
fi
22+
rm -f "$TMP_FILE"
23+
rm -rf "$GPG_HOME"
24+
exit $code
25+
}
26+
27+
trap trap_handler ERR EXIT
28+
29+
verify_using_gpg() {
30+
echo "Verifying $1 using gpg"
31+
gpg --homedir $GPG_HOME --verify $ARTIFACTS_DIR/$1.sig $ARTIFACTS_DIR/$1 > "$TMP_FILE" 2>&1
32+
}
33+
34+
verify_using_powershell() {
35+
echo "Verifying $1 using powershell"
36+
powershell Get-AuthenticodeSignature -FilePath $ARTIFACTS_DIR/$1 > "$TMP_FILE" 2>&1
37+
}
38+
39+
verify_using_codesign() {
40+
echo "Verifying $1 using codesign"
41+
codesign -dv --verbose=4 $ARTIFACTS_DIR/$1 > "$TMP_FILE" 2>&1
42+
}
43+
44+
verify_using_rpm() {
45+
# RPM packages are signed using gpg and the signature is embedded in the package.
46+
# Here, we need to import the key in `rpm` and then verify the signature.
47+
echo "Importing key into rpm"
48+
rpm --import $COMPASS_KEY > "$TMP_FILE" 2>&1
49+
# Even if the file is not signed, the command below will exit with 0 and output something like: sha1 md5 OK
50+
# So we need to check the output of the command to see if the file is signed successfully.
51+
echo "Verifying $1 using rpm"
52+
output=$(rpm -K $ARTIFACTS_DIR/$1)
53+
# Remove the imported key from rpm
54+
rpm -e $(rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release}:%{summary}\n' | grep compass | awk -F: '{print $1}')
55+
56+
# Check if the output contains the string "pgp md5 OK"
57+
if [[ $output != *"pgp md5 OK"* ]]; then
58+
echo "File $1 is not signed"
59+
exit 1
60+
fi
61+
}
62+
63+
setup_gpg() {
64+
echo "Importing Compass public key"
65+
curl $COMPASS_KEY | gpg --homedir $GPG_HOME --import > "$TMP_FILE" 2>&1
66+
}
67+
68+
if [ "$IS_WINDOWS" = true ]; then
69+
verify_using_powershell $WINDOWS_EXE_NAME
70+
verify_using_powershell $WINDOWS_MSI_NAME
71+
echo "Skipping verification for Windows artifacts using gpg: $WINDOWS_ZIP_NAME, $WINDOWS_NUPKG_NAME"
72+
elif [ "$IS_UBUNTU" = true ]; then
73+
setup_gpg
74+
verify_using_gpg $LINUX_DEB_NAME
75+
verify_using_gpg $LINUX_TAR_NAME
76+
elif [ "$IS_RHEL" = true ]; then
77+
setup_gpg
78+
verify_using_rpm $RHEL_RPM_NAME
79+
verify_using_gpg $RHEL_TAR_NAME
80+
elif [ "$IS_OSX" = true ]; then
81+
setup_gpg
82+
verify_using_gpg $OSX_ZIP_NAME
83+
verify_using_codesign $OSX_DMG_NAME
84+
else
85+
echo "Unknown OS, failed to verify file signing"
86+
exit 1
87+
fi

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Sun Jan 21 2024.
2+
This document was automatically generated on Sun Jan 28 2024.
33

44
## List of dependencies
55

configs/eslint-config-compass/plugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ module.exports = {
2424
// restrictedProviderImport('@mongodb-js/my-queries-storage'),
2525
// TODO(COMPASS-7412): enable when possible
2626
// restrictedProviderImport('@mongodb-js/atlas-service'),
27-
// TODO(COMPASS-7559): enable when possible
28-
// restrictedProviderImport('compass-preferences-model'),
27+
restrictedProviderImport('compass-preferences-model'),
2928
{
3029
paths: require('module').builtinModules,
3130
message: 'Using Node.js built-in modules in plugins is not allowed.',

configs/webpack-config-compass/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"email": "[email protected]"
1414
},
1515
"homepage": "https://github.com/mongodb-js/compass",
16-
"version": "1.3.2",
16+
"version": "1.3.3",
1717
"repository": {
1818
"type": "git",
1919
"url": "https://github.com/mongodb-js/compass.git"
@@ -69,7 +69,7 @@
6969
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
7070
"babel-loader": "^8.2.5",
7171
"babel-plugin-istanbul": "^5.2.0",
72-
"browserslist": "^4.22.2",
72+
"browserslist": "^4.22.3",
7373
"chalk": "^4.1.2",
7474
"cli-progress": "^3.9.1",
7575
"core-js": "^3.17.3",

0 commit comments

Comments
 (0)