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

Restrict metrics layer installation to Node >=14.10 #768

Conversation

colincasey
Copy link
Contributor

@colincasey colincasey commented Jan 23, 2024

Stacked with PR - #767

The main functionality of this PR is to modify nodejs-engine so that the metrics script is only include when the Node.js version is 14.10 or higher + integration tests to verify that behavior.

This PR also includes some refactoring around code related to obtaining the current Node.js version which is used by both nodejs-engine and nodejs-npm-engine. This is now available in nodejs-utils as node::get_node_version.

Some common error handling output was also moved into nodejs-utils.

W-14838686

The main functionality of this PR is to modify `nodejs-engine` so that the metrics script is only include when the Node.js version is 14.10 or higher + integration tests to verify that behavior.

This PR also includes some refactoring around code related to obtaining the current Node.js version which is used by both `nodejs-engine` and `nodejs-npm-engine`. This is now available in `nodejs-utils` as `node::get_node_version`.

Some common error handling output was also moved into `nodejs-utils`.

[W-14838686](https://gus.lightning.force.com/lightning/r/a07EE00001iPnjsYAC/view)
@colincasey colincasey requested a review from joshwlewis January 23, 2024 15:53
@colincasey colincasey self-assigned this Jan 23, 2024
@colincasey colincasey requested a review from a team as a code owner January 23, 2024 15:54
…lity_cnb_changes

* node_v14.10_compatiblility:
  Update CHANGELOG.md
layer_name!("dist"),
DistLayer {
release: target_release.clone(),
},
)?;

let env = dist_layer.env.apply(Scope::Build, &Env::from_current());
let node_version = node::get_node_version(&env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already know the Node.js version we installed (I think it's in the target_release object)? It seems like this might be an extra command we don't need.

@colincasey
Copy link
Contributor Author

Closing this PR. The suggestion you noted @joshwlewis is a better fit. The code to restrict the layer installation + the unit tests have been moved into #767.

@colincasey colincasey closed this Jan 23, 2024
@colincasey colincasey deleted the node_v14.10_compatiblility_cnb_changes branch January 23, 2024 20:45
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.

2 participants