Skip to content

fix: support installs without yarn.lock - #833

Closed
crysmags wants to merge 3 commits into
DataDog:mainfrom
crysmags:crysmags/fix-install-deps-missing-lockfile
Closed

fix: support installs without yarn.lock#833
crysmags wants to merge 3 commits into
DataDog:mainfrom
crysmags:crysmags/fix-install-deps-missing-lockfile

Conversation

@crysmags

@crysmags crysmags commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Allow the Node 18/20 dependency installer to run when its input tree does not contain yarn.lock.
  • Preserve and restore an existing lockfile, while removing a lockfile generated during installation when the input did not include one.
  • Add a regression test for the lockfile-free build context and run it in CI.

Failure

After #818 changed the layer Dockerfile to call scripts/install_deps.sh, the DataDog/dd-trace-js default GitLab pipeline began failing while building the Node 20 Lambda layer for dd-trace-js PR #9812:

Node 20 is not supported by dd-trace v6, pinning dd-trace to 5.126.0
cp: cannot stat 'yarn.lock': No such file or directory

The downstream pipeline uses a reduced build context that contains package.json and the installer scripts but not the repository lockfile. Yarn can install and generate a temporary lockfile in that context; only the installer's unconditional backup made the lockfile mandatory.

Testing

  • bash -n scripts/install_deps.sh scripts/test_install_deps.sh
  • ./scripts/test_install_deps.sh

@crysmags
crysmags requested review from a team as code owners September 9, 2026 18:04
@crysmags
crysmags requested a review from lym953 September 9, 2026 18:04

@joeyzhao2018 joeyzhao2018 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.

Sorry and Thank you.
LGTM. :shipit:

@BridgeAR

BridgeAR commented Sep 9, 2026

Copy link
Copy Markdown
Member

Superseded

@BridgeAR BridgeAR closed this Sep 9, 2026
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