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) {
3535 // sort of a hack - if we have an official release version, it'll be in the form `major.minor`. otherwise,
3636 // we'd expect a commit hash or `master`.
3737 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).
4346 const branch = `r${ major } .${ minor } `
47+
4448 return `https://mciuploads.s3.amazonaws.com/libmongocrypt-release/${ platform } /${ branch } /${ hash } /libmongocrypt.tar.gz` ;
4549 }
4650
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.
4754 return `https://mciuploads.s3.amazonaws.com/libmongocrypt/${ platform } /master/${ hash } /libmongocrypt.tar.gz` ;
4855}
4956
You can’t perform that action at this time.
0 commit comments