File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,22 @@ export function buildLibmongocryptDownloadUrl(ref, platform) {
35
35
// sort of a hack - if we have an official release version, it'll be in the form `major.minor`. otherwise,
36
36
// we'd expect a commit hash or `master`.
37
37
if ( ref . includes ( '.' ) ) {
38
- const [ major , minor , patch ] = ref . split ( '.' ) ;
39
- if ( patch !== '0' ) {
40
- throw new Error ( 'cannot release from non-zero patch.' ) ;
41
- }
42
-
38
+ const [ major , minor , _patch ] = ref . split ( '.' ) ;
39
+
40
+ // Just a note: it may appear that this logic _doesn't_ support patch releases but it actually does.
41
+ // libmongocrypt's creates release branches for minor releases in the form `r<major>.<minor>`.
42
+ // Any patches made to this branch are committed as tags in the form <major>.<minor>.<patch>.
43
+ // So, the branch that is used for the AWS s3 upload is `r<major>.<minor>` and the commit hash
44
+ // is the commit hash we parse from the `getCommitFromRef()` (which handles switching to git tags and
45
+ // getting the commit hash at that tag just fine).
43
46
const branch = `r${ major } .${ minor } `
47
+
44
48
return `https://mciuploads.s3.amazonaws.com/libmongocrypt-release/${ platform } /${ branch } /${ hash } /libmongocrypt.tar.gz` ;
45
49
}
46
50
51
+ // just a note here - `master` refers to the branch, the hash is the commit on that branch.
52
+ // if we ever need to download binaries from a non-master branch (or non-release branch),
53
+ // this will need to be modified somehow.
47
54
return `https://mciuploads.s3.amazonaws.com/libmongocrypt/${ platform } /master/${ hash } /libmongocrypt.tar.gz` ;
48
55
}
49
56
You can’t perform that action at this time.
0 commit comments