Skip to content

fix: support installs without yarn.lock - #836

Merged
pabloerhard merged 1 commit into
mainfrom
pabloerhard/fix-install-deps-missing-lockfile
Sep 9, 2026
Merged

fix: support installs without yarn.lock#836
pabloerhard merged 1 commit into
mainfrom
pabloerhard/fix-install-deps-missing-lockfile

Conversation

@pabloerhard

@pabloerhard pabloerhard commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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

Authored by: @crysmags

@pabloerhard
pabloerhard requested review from a team as code owners September 9, 2026 20:40
@datadog-datadog-prod-us1

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/datadog-lambda-js | check layer size (node18) — 🔄 Retry may pass, looks flaky

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a89a1cd | Docs | View more details | Give us feedback!

@pabloerhard
pabloerhard merged commit da6cbcf into main Sep 9, 2026
70 of 72 checks passed
@pabloerhard
pabloerhard deleted the pabloerhard/fix-install-deps-missing-lockfile branch September 9, 2026 21:23
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