Skip to content

Install arsenal and scubaclient from the npm registry instead of git - #6308

Open
francoisferrand wants to merge 11 commits into
improvement/CLDSRV-996-node-24from
improvement/CLDSRV-997
Open

francoisferrand wants to merge 11 commits into
improvement/CLDSRV-996-node-24from
improvement/CLDSRV-997

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

Arsenal and scubaclient were installed from git, so both compiled during yarn install via their prepare/postinstall hooks. That's exactly the kind of install-time build that's fragile on a new runtime, and the Dockerfile carried a global typescript@4.9.5 (older than either package's own TS 5.x requirement) just to make it work "by luck".

Both are now published on the npm registry as precompiled artifacts, so this removes the install-time build, the global typescript/node-gyp, and the frozen git refs.

  • arsenal is aliased (npm:@scality/arsenal@8.6.0-preview.1) rather than renamed, since there are ~285 require('arsenal') call sites — the alias keeps the diff to package.json/yarn.lock only.
  • scubaclient is renamed to @scality/scubaclient (only 3 require sites: lib/utilization/scuba/wrapper.js, tests/unit/quotas/scuba/wrapper.js, tests/unit/api/apiUtils/quotas/quotaUtils.js), API-compatible (getLatestMetrics/healthCheck/constructor unchanged).
  • Dockerfile's global typescript@4.9.5/node-gyp install is dropped since no remaining git dependency needs an install-time TS compile.

Verified with a fresh yarn install --frozen-lockfile on Node 24: require('ioctl') still works (CLDSRV-996's nan/ioctl fix undisturbed), arsenal.requestUrl.parseRequestTarget is present, ScubaClient.getLatestMetrics/healthCheck are present, lint is clean, and quota/scuba/objectCopy unit tests pass (231 passing).

Stacked on #6307 ("Run on Node 24") — targets improvement/CLDSRV-996-node-24, not development/9.5.

Issue: CLDSRV-997

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.41026% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.52%. Comparing base (d454d68) to head (54f72c1).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
bin/search_bucket.js 0.00% 1 Missing ⚠️
lib/api/apiUtils/bucket/checkPreferredLocations.js 0.00% 1 Missing ⚠️
lib/kms/utilities.js 0.00% 1 Missing ⚠️
lib/nfs/utilities.js 0.00% 1 Missing ⚠️
lib/utapi/utapi.js 0.00% 1 Missing ⚠️
lib/utapi/utapiReindex.js 0.00% 1 Missing ⚠️
lib/utapi/utapiReplay.js 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/Config.js 80.44% <100.00%> (ø)
lib/api/api.js 93.10% <100.00%> (ø)
lib/api/apiUtils/authorization/bucketOwner.js 92.30% <100.00%> (ø)
lib/api/apiUtils/authorization/permissionChecks.js 97.26% <100.00%> (ø)
...i/apiUtils/authorization/prepareRequestContexts.js 95.58% <100.00%> (ø)
lib/api/apiUtils/authorization/tagConditionKeys.js 69.23% <100.00%> (ø)
lib/api/apiUtils/bucket/bucketCors.js 92.95% <100.00%> (ø)
lib/api/apiUtils/bucket/bucketCreation.js 96.35% <100.00%> (ø)
lib/api/apiUtils/bucket/bucketDeletion.js 90.00% <100.00%> (ø)
lib/api/apiUtils/bucket/bucketEncryption.js 85.00% <100.00%> (ø)
... and 144 more
@@                       Coverage Diff                       @@
##           improvement/CLDSRV-996-node-24    #6308   +/-   ##
===============================================================
  Coverage                           86.52%   86.52%           
===============================================================
  Files                                 213      213           
  Lines                               14619    14619           
===============================================================
  Hits                                12649    12649           
  Misses                               1970     1970           
Flag Coverage Δ
checksums-disabled-tests 35.37% <96.41%> (ø)
file-ft-tests 70.05% <96.41%> (+0.02%) ⬆️
file-ft-tests-null-compat 70.50% <96.41%> (ø)
kmip-ft-tests 28.14% <96.41%> (ø)
mongo-v0-ft-tests 71.16% <96.41%> (+0.01%) ⬆️
mongo-v1-ft-tests 71.16% <96.41%> (+0.01%) ⬆️
multiple-backend 36.12% <96.41%> (ø)
s3c-ft-tests-v0 65.05% <96.41%> (+0.01%) ⬆️
s3c-ft-tests-v0-null-compat 65.11% <96.41%> (+0.01%) ⬆️
s3c-ft-tests-v1 65.02% <96.41%> (-0.02%) ⬇️
sur-tests 36.63% <96.41%> (-0.03%) ⬇️
sur-tests-inflights 39.48% <96.41%> (ø)
unit 74.32% <96.41%> (ø)
utapi-v2-tests 35.35% <96.41%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@francoisferrand
francoisferrand force-pushed the improvement/CLDSRV-996-node-24 branch 2 times, most recently from e65085d to 4d4bdeb Compare September 25, 2026 09:56
Comment thread package.json
Both were git dependencies that compiled their TypeScript sources
during yarn install via prepare/postinstall hooks. Arsenal is aliased
to the registry package (arsenal -> npm:@scality/arsenal@8.6.0-preview.1)
to avoid touching the ~285 require('arsenal') call sites; scubaclient
is renamed outright to @scality/scubaclient since only 3 files require
it. Both now ship precompiled JS, so no install-time tsc is needed for
either package anymore.

Issue: CLDSRV-997
They were only needed to compile arsenal and scubaclient's TypeScript
sources at install time when both were git dependencies. Now that both
are installed as precompiled registry packages, no git dependency in
package.json still needs an install-time build, so the toolchain is no
longer needed in the image.

Issue: CLDSRV-997
The npm registry alias ("arsenal": "npm:@scality/arsenal@...") let us
install from the registry while keeping the historical bare require,
but it means every dependency (bucketclient, utapi, ...) that itself
declares a peer/dependency on @scality/arsenal ends up with two
separate copies installed side by side instead of sharing one.

Rename the dependency to its real @scality/arsenal name and update all
require('arsenal') call sites accordingly, so the package resolves and
dedupes the same way as any other consumer of it.

Issue: CLDSRV-997
Tag 8.3.0 renames the package from bucketclient to @scality/bucketclient
and moves its arsenal peer/dev dependency to the @scality/arsenal
package name, matching the rename just made here. Update the sole
require site accordingly.

Issue: CLDSRV-997
A plain yarn upgrade floats @aws-sdk/client-s3 and @smithy/core to
their latest mutually-compatible versions (3.1140.0 / 3.35.0). The
newer @smithy/core no longer declares @smithy/util-stream as a
dependency even though its bundled code still requires it at runtime
(upstream packaging gap), so it's added as an explicit direct
dependency to keep arsenal's AWS SDK usage (requestUrl,
network/kmip client) working.

Verified require('ioctl'), require('@scality/arsenal'),
require('@scality/bucketclient'), require('@scality/scubaclient') and
requestUrl.parseRequestTarget all still work after a clean install.

Issue: CLDSRV-997
Same pattern as arsenal and bucketclient: the git tag's own
package.json already declares itself as @scality/utapi, so alias it
under that name instead of the bare utapi key.

Issue: CLDSRV-997
@francoisferrand
francoisferrand force-pushed the improvement/CLDSRV-996-node-24 branch from 4a12afc to d454d68 Compare September 26, 2026 09:35
@francoisferrand
francoisferrand force-pushed the improvement/CLDSRV-997 branch 3 times, most recently from 96e59c2 to 061b781 Compare September 27, 2026 08:28
francoisferrand and others added 5 commits September 27, 2026 13:30
The @aws-sdk/client-s3 bump pulled in by the yarn.lock refresh moved
the CRC64NVME checksum container from
@aws-sdk/middleware-flexible-checksums to @aws-sdk/checksums. Update
the two functional test files that imported it directly so they no
longer fail with "Cannot find module '@aws-sdk/middleware-flexible-checksums'".

Also drop jsonwebtoken and fast-xml-parser from package.json
dependencies. Both are only needed as transitive dependencies of
@azure/storage-blob (via @azure/identity/@azure/msal-node and
@azure/core-xml respectively) and are already version-pinned through
the existing resolutions block; promoting them to direct dependencies
during the yarn.lock refresh was unintentional. Removing them does
not change yarn.lock or the installed versions.

@smithy/util-stream was unintentionally promoted to a direct dependency
during the yarn.lock refresh, same as the jsonwebtoken/fast-xml-parser
case fixed earlier. Unlike those, it is not required transitively by
anything else in the dependency tree either (it was the only consumer
of that package in yarn.lock), so removing it drops the package
entirely instead of just de-duplicating it. It is not require()'d
anywhere in cloudserver source. Flagged by Claude Code Review.

Issue: CLDSRV-997
instrumentation-http ~0.218 -> ~0.222, instrumentation-ioredis
~0.64 -> ~0.70, instrumentation-mongodb ~0.69 -> ~0.75, all sharing
the same @opentelemetry/instrumentation@0.222.0 core. Also refreshed
yarn.lock, bumping other transitive deps within their existing
semver ranges.

Issue: CLDSRV-997
The @aws-sdk/client-s3 bump pulled in by the yarn.lock refresh made
the S3 REST XML serializer reject an empty Bucket path label
client-side, before any request is sent. The test now gets a plain
Error with no $metadata instead of a 405 response from the server,
so assert on the new client-side error message instead.

Issue: CLDSRV-997

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test only checked the ETag of the final GetObject and left the
30000-byte body unread, so the `after` hook's DeleteObject raced the
server still streaming parts: once the data is gone the server destroys
the response mid-stream and the client socket closes with an incomplete
body.

With @aws-sdk/client-s3 3.1141 the response checksum stream
(ChecksumStream, now in @smithy/core) forwards the underlying
IncomingMessage's `aborted` error onto `Body`. Nothing listens to it in
the test, so mocha dies with an uncaught `Error: aborted` in the after
hook. Older SDKs piped the source without forwarding its errors, which
is why this used to pass.

Read the body to completion (and check its content) so the object is
only deleted once the stream is done.

Issue: CLDSRV-997

This branch has not been deployed

No deployments
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.

2 participants