Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] GitHub workflow uses the range of engines.node and engines.yarn from OSD wrongly #290

Closed
AMoo-Miki opened this issue Feb 21, 2023 · 1 comment
Labels
bug Something isn't working untriaged

Comments

@AMoo-Miki
Copy link
Contributor

What is the bug?

echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"

OSD provides a range in engines that works for OSD without considering deps or plugins. Sometimes, dependencies require higher versions of Yarn or Node.js and that is NOT reason enough for OSD to bump their engines. hence, the CI needs to use a version that works and will need to make adjustments deps evolve.

There is a counter argument that could be made that the lockfile dictates what OSD uses so it should make the best effort to satisfy those deps. I would argue against it that OSD plugins have deps that might not be common with OSD and those deps could impose their own engines; OSD cannot be expected to kep up with those.

Solution
Just like OSD does it, hardcode the version of Yarn. OSD uses nvm and .nvmrc; you could do the same, read the version from .nvmrc, or hardcode your own version of Node.js in the CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

2 participants