nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: railwayapp/nixpacks
Pull request #426 (2022-08-19 20:05:47)

Java 8 -> 17
<!-- Thanks for sending a pull request! 
-->
<!-- Please add a useful description explaining what this PR does -->

This PR lets us not use an ancient version 
of Java

<!-- PR Checklist  -->
<!-- - [ ] Tests are added/updated if needed  -->
<!-- - [ ] Docs are updated if needed  -->



Patch:
diff --git a/src/providers/java.rs b/src/providers/java.rs
index 9bbef14..e57a314 100644
--- a/src/providers/java.rs
+++ b/src/providers/java.rs
@@ -28,7 +28,7 @@ impl Provider for JavaProvider {
     }
 
     fn get_build_plan(&self, app: &App, _env: &Environment) -> Result<Option<BuildPlan>> {
-        let setup = Phase::setup(Some(vec![Pkg::new("maven"), Pkg::new("jdk8")]));
+        let setup = Phase::setup(Some(vec![Pkg::new("maven"), Pkg::new("jdk")]));
 
         let mvn_exe = self.get_maven_exe(app);
         let build = Phase::build(Some(format!("{mvn_exe} -DoutputFile=target/mvn-dependency-list.log -B -DskipTests clean dependency:list install", 


Test patch:
diff --git a/tests/snapshots/generate_plan_tests__java_maven.snap b/tests/snapshots/generate_plan_tests__java_maven.snap
index 790133f..c4ec7b5 100644
--- a/tests/snapshots/generate_plan_tests__java_maven.snap
+++ b/tests/snapshots/generate_plan_tests__java_maven.snap
@@ -19,7 +19,7 @@ expression: plan
           "name": "maven"
         },
         {
-          "name": "jdk8"
+          "name": "jdk"
         }
       ]
     },
diff --git a/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap b/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
index 9a3ec4f..4414f35 100644
--- a/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
+++ b/tests/snapshots/generate_plan_tests__java_maven_wrapper.snap
@@ -19,7 +19,7 @@ expression: plan
           "name": "maven"
         },
         {
-          "name": "jdk8"
+          "name": "jdk"
         }
       ]
     },
Repository: railwayapp/nixpacks
Pull request #474 (2022-08-30 20:29:29)

puppeteer example to node 16
Node-canvas doesn't have pre-built binaries for node 18, which is now the default on Railway
https://github.com/Automattic/node-canvas/issues/2025

This PR pins the version of node to 16 for the puppeteer examples




Patch:
diff --git a/examples/node-canvas/package.json b/examples/node-canvas/package.json
index 0953c6f..54e89ea 100644
--- a/examples/node-canvas/package.json
+++ b/examples/node-canvas/package.json
@@ -7,5 +7,8 @@
   },
   "dependencies": {
     "canvas": "^2.9.1"
+  },
+  "engines": {
+    "node": "16.x"
   }
 }
diff --git a/examples/node-puppeteer/package.json b/examples/node-puppeteer/package.json
index a3a5b33..636b11a 100644
--- a/examples/node-puppeteer/package.json
+++ b/examples/node-puppeteer/package.json
@@ -11,5 +11,8 @@
   "license": "ISC",
   "dependencies": {
     "puppeteer": "^16.1.1"
+  },
+  "engines": {
+    "node": "16.x"
   }
 }
diff --git a/src/providers/node/mod.rs b/src/providers/node/mod.rs
index 01446e3..68322e0 100644
--- a/src/providers/node/mod.rs
+++ b/src/providers/node/mod.rs
@@ -290,15 +290,7 @@ impl NodeProvider {
     /// Returns the nodejs nix package and the appropriate package manager nix image.
     pub fn get_nix_packages(app: &App, env: &Environment) -> Result<Vec<Pkg>> {
         let package_json: PackageJson = app.read_json("package.json")?;
-        let mut node_pkg = NodeProvider::get_nix_node_pkg(&package_json, env)?;
-
-        // If node-canvas is used, we want to default to node 16
-        // https://github.com/Automattic/node-canvas/issues/2025
-        if NodeProvider::uses_node_dependency(app, "canvas")
-            && node_pkg.name == DEFAULT_NODE_PKG_NAME
-        {
-            node_pkg = Pkg::new("nodejs-16_x");
-        }
+        let node_pkg = NodeProvider::get_nix_node_pkg(&package_json, env)?;
 
         let pm_pkg: Pkg;
         let mut pkgs = Vec::<Pkg>::new();


Test patch:
diff --git a/tests/snapshots/generate_plan_tests__node_nx.snap b/tests/snapshots/generate_plan_tests__node_nx.snap
index 6101490..4e5d503 100644
--- a/tests/snapshots/generate_plan_tests__node_nx.snap
+++ b/tests/snapshots/generate_plan_tests__node_nx.snap
@@ -31,7 +31,7 @@ expression: plan
       "name": "setup",
       "nixPackages": [
         {
-          "name": "nodejs-16_x"
+          "name": "nodejs"
         },
         {
           "name": "npm-8_x",
diff --git a/tests/snapshots/generate_plan_tests__node_puppeteer.snap b/tests/snapshots/generate_plan_tests__node_puppeteer.snap
index 68ad1df..5b05860 100644
--- a/tests/snapshots/generate_plan_tests__node_puppeteer.snap
+++ b/tests/snapshots/generate_plan_tests__node_puppeteer.snap
@@ -30,7 +30,7 @@ expression: plan
       "name": "setup",
       "nixPackages": [
         {
-          "name": "nodejs"
+          "name": "nodejs-16_x"
         },
         {
           "name": "npm-8_x",