Draft: Yarn v2 support
What does this MR do?
Support yarn.lock files generated by yarn 2, while keeping backward compatibility with yarn 1.
Lock files created by both yarn 1 and yarn 2 share a similar schema, but yarn 2 lock files are YAML files, whereas yarn 1 lock files are not. The parser is changed to handle YAML files, and it features a preprocessor that converts yarn 1 lock files to YAML, when needed.
yarn 2 currently sets the lock file version to 4
, in the metadata of the lock file. Newer versions might not be compatible, so the parser reports an error if the version is greater than 4. As for the lock files generated by yarn 1, the parser expects one particular generated comment, at the beginning of the file. It assumes this is a YAML file if this v1-specific comment is missing.
What are the relevant issue numbers?
gitlab-org/gitlab#263358 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer