Fix missing @smithy/service-error-classification dependency - #2864
Conversation
Backbeat crashes at startup since 9.6.0-preview.2: lib/clients/utils.js deep-imported the error code lists from service-error-classification, which was never declared. It used to come with older @aws-sdk/client-s3, and is no longer installed in production since the lockfile rebuild. Recent versions no longer ship those lists, so rely on the classifiers the package exports instead: this follows the SDK's own retry classification, which also covers a few more network errors (e.g. ENOTFOUND). The lockfile also drops a stale dependency list for the cloudserver dev dependency, which is what kept the old package around in dev installs. Issue: BB-903
ReplicateObject tests use HttpRequest from it, but it was only installed transitively through the AWS SDK. Issue: BB-903
Nothing in backbeat uses them. node-forge and ioctl are still pulled by arsenal (ioctl as an optional dependency, only needed by its file data store), and minimatch only comes with dev tooling. Issue: BB-903
Enable import/no-extraneous-dependencies so that requiring a package which is only installed transitively, or only as a dev dependency, fails lint instead of crashing at runtime. no-unresolved is needed as well, since the former silently ignores modules it cannot resolve. The import plugin was never registered in the flat config, so the existing import/* settings had no effect so far. Issue: BB-903
Issue: BB-903
Hello francoisferrand,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 3 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.6 #2864 +/- ##
===================================================
- Coverage 77.01% 76.76% -0.26%
===================================================
Files 211 211
Lines 14562 14560 -2
===================================================
- Hits 11215 11177 -38
- Misses 3337 3373 +36
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
SylvainSenechal
left a comment
There was a problem hiding this comment.
Btw i've always found this custom retry logic to be a bit hacky, maybe we can make some changes when we start working on replication error productization
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
This pull request did not target the following hotfix branch(es) so they
Please check the status of the associated issue BB-903. Goodbye francoisferrand. The following options are set: approve |
Since 9.6.0-preview.2, backbeat crashes at startup with
Cannot find module '@smithy/service-error-classification/dist-es/constants'.lib/clients/utils.jsimported that package without declaring it. It used to come transitively through@aws-sdk/client-s3. Once the lock was rebuilt, the only copy left came through a dev dependency, so the production image no longer has it. The import also pointed at an internaldist-espath.Changes:
@smithy/service-error-classificationand use its publicisTransientError/isThrottlingErrorinstead of the internal constants. These classifiers are a bit broader than the old lists: they also retry DNS and unreachable-host errors.@smithy/protocol-httpas a dev dependency, since a unit test uses it.ioctl,minimatchandnode-forge, which nothing in backbeat uses (ioctlis only an optional dependency of arsenal, for the file data store).import/no-unresolvedandimport/no-extraneous-dependencies, so lint fails on undeclared or dev-only imports in runtime code. The plugin was already a dev dependency but was never registered in the config.Issue: BB-903