Skip to content

feat(dl-center): upgrade to aws sdk v3 - #845

Open
nbbeeken wants to merge 8 commits into
mainfrom
aws-3
Open

feat(dl-center): upgrade to aws sdk v3#845
nbbeeken wants to merge 8 commits into
mainfrom
aws-3

Conversation

@nbbeeken

@nbbeeken nbbeeken commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Upgrades dl-center to AWS v3 SDK

The consumer of this is hadron-build.

There are breaking changes here:

  • The result of a download now is streamable and needs to be consumed
  • The options have changed, mainly the key/secret are nested inside a "credentials" property

Open Questions

Checklist

Copilot AI review requested due to automatic review settings July 30, 2026 19:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the @mongodb-js/dl-center package from AWS SDK v2 to AWS SDK v3 for S3 operations, updating the DownloadCenter client implementation and adjusting dependencies accordingly.

Changes:

  • Replaced aws-sdk v2 S3 usage with @aws-sdk/client-s3 (v3) commands/client.
  • Updated types around S3 uploads/downloads and made config uploads use an explicit UTF-8 Buffer.
  • Skipped S3rver-backed integration tests due to incompatibilities introduced by the SDK switch.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/dl-center/src/download-center.ts Migrates S3 implementation to AWS SDK v3 and updates related types/behavior.
packages/dl-center/src/download-center.spec.ts Skips S3 integration tests impacted by the SDK migration.
packages/dl-center/package.json Swaps dependency from aws-sdk v2 to @aws-sdk/client-s3 v3.
package-lock.json Updates lockfile for AWS SDK v3 dependency tree and removes AWS SDK v2 packages.
Comments suppressed due to low confidence (1)

packages/dl-center/src/download-center.spec.ts:100

  • This integration test is skipped, leaving uploadConfig/downloadConfig behavior untested. After fixing the AWS SDK v3 S3 client setup for S3rver, this should be re-enabled (or replaced with a working equivalent).
    it.skip('can upload and download a valid config file', async function () {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/dl-center/src/download-center.ts
Comment thread packages/dl-center/src/download-center.ts Outdated
Comment thread packages/dl-center/src/download-center.ts Outdated
Comment thread packages/dl-center/src/download-center.spec.ts Outdated
Comment thread packages/dl-center/src/download-center.ts Outdated
@nbbeeken nbbeeken changed the title chore(dl-center): upgrade to aws sdk v3 feat(dl-center): upgrade to aws sdk v3 Jul 31, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 80.074% (+5.2%) from 74.852% — aws-3 into main

Comment thread package-lock.json
Comment on lines -27442 to -27449
"node_modules/url": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
"integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==",
"dependencies": {
"punycode": "1.3.2",
"querystring": "0.2.0"
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"url" and "querystring" being removed here must relate to the extract-types change but not sure exactly how

@nbbeeken
nbbeeken requested review from Copilot and lerouxb July 31, 2026 23:46
@nbbeeken
nbbeeken marked this pull request as ready for review July 31, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/dl-center/src/download-center.ts:191

  • uploadAsset() switched to PutObjectCommandInput['Body'], but the JSDoc above still documents the parameter type as Content (from the removed v2 AWS SDK types). Updating the JSDoc keeps the public API documentation consistent with the new signature.
  async uploadAsset(
    s3ObjectKey: string,
    content: PutObjectCommandInput['Body'],
    options: UploadAssetOptions = {},

packages/dl-center/src/download-center.ts:151

  • The JSDoc still references the removed Content type in the return annotation, which no longer matches the method signature after the AWS SDK v3 migration. Updating it will keep generated docs/type hints accurate for consumers.
   * @param {string} s3ObjectKey -
   *  the s3 object key of the asset that has to be downloaded,
   *  ie. `my-project/asset.zip`.
   * @return {(Promise<Content | undefined>)}
   * @memberof DownloadCenter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants