Skip to content

chore: loosen base package dependency version constraints#2305

Merged
ava-silver merged 8 commits into
masterfrom
ava.silver/chore/loosen-base-package-version-constraints
May 5, 2026
Merged

chore: loosen base package dependency version constraints#2305
ava-silver merged 8 commits into
masterfrom
ava.silver/chore/loosen-base-package-version-constraints

Conversation

@ava-silver

@ava-silver ava-silver commented May 4, 2026

Copy link
Copy Markdown
Contributor

What and why?

Loosens version constraints in @datadog/datadog-ci-base from exact pinned versions to ^ (semver-compatible) ranges. This comes up in context of #2302 -- when users depend on the base package as a library, exact pins mean they get stuck on vulnerable patch versions until we release an update. With ^ ranges, their lockfiles can resolve newer compatible versions independently.

The @datadog/datadog-ci main package and plugin packages continue to use exact pinning (they're vendored), so this only affects library consumers of the base package.

How?

Core change:

  • Added a syncpack semver group for @datadog/datadog-ci-base that uses ^ ranges, placed before the catch-all exact-pin rule in .syncpackrc.json
  • Changed all dependencies and devDependencies in packages/base/package.json from x.y.z to ^x.y.z

TypeScript fixes (required by the ^ ranges):

The loosened ranges caused yarn to resolve newer minor versions of @types/async-retry (1.4.8 → 1.4.9) and @types/deep-extend (0.4.31 → 0.4.32), which ship stricter type signatures:

  • @types/[email protected]: onRetry callback parameter changed from (error: Error) to (e: unknown). In upload.ts, the public UploadOptions.onRetry type is kept as Error (no API break) and an internal cast handles the mismatch. In the 9 command/plugin files that call retryRequest directly with inline onRetry callbacks, e.message accesses are updated to use instanceof Error guards.
  • @types/[email protected]: generics now require extends object. Added the constraint to resolveConfigFromFile<T> and handled the undefined case from getConfig.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

ava-silver commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@ava-silver ava-silver added the chores Related to the CI or developer experience label May 4, 2026
@ava-silver
ava-silver changed the base branch from master to graphite-base/2305 May 4, 2026 19:52
@ava-silver
ava-silver force-pushed the ava.silver/chore/loosen-base-package-version-constraints branch from b6c416a to c3bd7f5 Compare May 4, 2026 19:52
@ava-silver
ava-silver changed the base branch from graphite-base/2305 to ava.silver/chore/fix-windows-e2e-node24-ebadf May 4, 2026 19:52
@ava-silver
ava-silver force-pushed the ava.silver/chore/loosen-base-package-version-constraints branch 2 times, most recently from 89705a9 to e694a3e Compare May 4, 2026 20:18
@ava-silver
ava-silver marked this pull request as ready for review May 4, 2026 20:46
@ava-silver
ava-silver requested review from a team as code owners May 4, 2026 20:46
Comment thread packages/base/src/helpers/upload.ts Outdated
try {
await retryRequest(() => uploadMultipart(requestBuilder, payload, opts.useGzip ?? false), {
onRetry: opts.onRetry,
onRetry: opts.onRetry as ((e: unknown, attempt: number) => any) | undefined,

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.

nit Can we change the definition of UploadOptions.onRetry instead?

ava-silver added 6 commits May 5, 2026 10:56
Switches @datadog/datadog-ci-base dependencies from exact pinned versions
to ^ ranges so that users consuming it as a library can rely on their own
lockfiles for version management, rather than being stuck on specific
patch versions when vulnerabilities are reported.
Newer minor versions resolved by ^ ranges in the base package have stricter
type signatures: async-retry's onRetry now uses unknown instead of Error,
and deep-extend requires T extends object constraints.

- Cast opts.onRetry in upload helper to satisfy the new async-retry types
  while keeping the public UploadOptions API unchanged
- Use instanceof Error guards in direct retryRequest callers (tag, trace,
  measure, dora) that access e.message in onRetry callbacks
- Add extends object constraint to resolveConfigFromFile generic
- Handle undefined parsedConfig in resolveConfigFromFile
plugin-coverage, plugin-deployment, plugin-gate, plugin-junit,
plugin-sarif, and plugin-terraform all had the same issue — onRetry
callbacks accessing e.message when e is now typed as unknown by the
updated @types/async-retry. Use instanceof Error guards consistently.
simple-git 3.34.0+ introduced @simple-git/argv-parser and
@simple-git/args-pathspec for argument handling, which causes the
Windows e2e tests to hang/be killed mid-run. Pin to ~3.33.0 (patch-only)
to avoid this until a fixed minor version is available.

All other deps keep ^ ranges as intended.
jest-diff 30.3.0 causes an EBADF: bad file descriptor error in Node 24
on Windows during ESM/CJS module loading. Pin to ~30.2.0 (patch-only)
alongside the existing simple-git ~3.33.0 constraint.
The Windows e2e EBADF failure is caused by a GitHub Actions runner
image update (git 2.54.0 → 2.53.0), not by these package versions.
Corentin's unrelated PR shows the same failure on the same runner image.
@ava-silver
ava-silver force-pushed the ava.silver/chore/loosen-base-package-version-constraints branch from e694a3e to cc2032b Compare May 5, 2026 14:56
@ava-silver
ava-silver requested review from a team as code owners May 5, 2026 15:01
Base automatically changed from ava.silver/chore/fix-windows-e2e-node24-ebadf to master May 5, 2026 15:59
@ava-silver
ava-silver merged commit af91f71 into master May 5, 2026
52 of 55 checks passed
@ava-silver
ava-silver deleted the ava.silver/chore/loosen-base-package-version-constraints branch May 5, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chores Related to the CI or developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants