nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: glennjones/hapi-swagger
Pull request #708 (2021-04-15 10:24:46)

Drop override values when present
Joi@17 started adding an override special value on allow/disallow lists (see [here](https://github.com/sideway/joi/blob/83092836583a7f4ce16cbf116b8776737e80d16f/test/base.js#L3490-L3490)), there appears to be no reliable way to detect that value, so I went as far as I could to make sure that's the one and strip it, but there's no guarantee.

Also, the tests don't pass locally based on coverage, but that's not really new.


Patch:
diff --git a/lib/properties.js b/lib/properties.js
index 186bfd0..c5cb12a 100644
--- a/lib/properties.js
+++ b/lib/properties.js
@@ -114,6 +114,15 @@ internals.properties.prototype.parseProperty = function(name, joiObj, parent, pa
   let describe = joiObj.describe();
   const allowDropdown = !property['x-meta'] || !property['x-meta'].disableDropdown;
   if (allowDropdown && Array.isArray(describe.allow) && describe.allow.length) {
+    if (
+      describe.allow[0] &&
+      typeof describe.allow[0] === 'object' &&
+      describe.allow[0].override === true &&
+      Object.keys(describe.allow[0]).length === 1
+    ) {
+      describe.allow.shift();
+    }
+
     // filter out empty values and arrays
     var enums = describe.allow.filter(item => {
       return item !== '' && item !== null;


Test patch:
diff --git a/test/unit/property-test.js b/test/unit/property-test.js
index e5db1c7..35ca598 100644
--- a/test/unit/property-test.js
+++ b/test/unit/property-test.js
@@ -142,6 +142,10 @@ lab.experiment('property - ', () => {
       type: 'string',
       enum: ['a', 'b']
     });
+    expect(propertiesNoAlt.parseProperty('x', Joi.compile(['a', 'b', null]), null, 'body', true, false)).to.equal({
+      type: 'string',
+      enum: ['a', 'b']
+    });
     expect(
       propertiesNoAlt.parseProperty(
         'x',
Repository: netlify/build
Pull request #432 (2019-11-06 10:19:10)

Add `--site-id` CLI flag
This allows using a `--site-id` CLI flag without error messages.

The site ID is not used yet though.


Patch:
diff --git a/packages/build/src/core/bin.js b/packages/build/src/core/bin.js
index bd45d1385..5e4a9f313 100755
--- a/packages/build/src/core/bin.js
+++ b/packages/build/src/core/bin.js
@@ -42,6 +42,10 @@ Default: current directory`,
     describe: `Netlify API token for authentication.
 The NETLIFY_TOKEN environment variable can be used as well.`,
   },
+  siteId: {
+    string: true,
+    describe: `Netlify Site ID.`,
+  },
   context: {
     string: true,
     describe: `Build context.


Test patch:
diff --git a/packages/build/tests/snapshots/cli.js.md b/packages/build/tests/snapshots/cli.js.md
index 47da3c1ab..a867fc84f 100644
--- a/packages/build/tests/snapshots/cli.js.md
+++ b/packages/build/tests/snapshots/cli.js.md
@@ -26,6 +26,7 @@ Generated by [AVA](https://ava.li).
                  Default: current directory                                 [string]␊
       --token    Netlify API token for authentication.␊
                  The NETLIFY_TOKEN environment variable can be used as well.[string]␊
+      --siteId   Netlify Site ID.                                           [string]␊
       --context  Build context.␊
                  Default: 'production'                                      [string]␊
       --dry      Run in dry mode, i.e. printing commands without␊
Repository: netlify/build
Pull request #468 (2019-11-12 12:49:31)

Improve Windows support
Few improvements related to Windows:
  - fix stack traces printing on errors
  - fix some failing tests


Patch:
diff --git a/packages/build/src/log/stack.js b/packages/build/src/log/stack.js
index 02851e788..6fafae259 100644
--- a/packages/build/src/log/stack.js
+++ b/packages/build/src/log/stack.js
@@ -46,15 +46,18 @@ const cleanStackLine = function(lines, line) {
 const STACK_LINE_REGEXP = /^\s+at /
 
 const isUselessStack = function(line) {
+  const lineA = line.replace(BACKLASH_REGEXP, '/')
   return (
     // Anonymous function
-    line.includes('<anonymous>') ||
+    lineA.includes('<anonymous>') ||
     // nyc internal code
-    line.includes('node_modules/append-transform') ||
-    line.includes('node_modules/signal-exit')
+    lineA.includes('node_modules/append-transform') ||
+    lineA.includes('node_modules/signal-exit')
   )
 }
 
+const BACKLASH_REGEXP = /\\/g
+
 const isInternalStack = function(line) {
   // This is only needed for local builds
   return INTERNAL_STACK_REGEXP.test(line)


Test patch:
diff --git a/packages/build/tests/helpers/normalize.js b/packages/build/tests/helpers/normalize.js
index 68c91ee1e..d45993f23 100644
--- a/packages/build/tests/helpers/normalize.js
+++ b/packages/build/tests/helpers/normalize.js
@@ -16,6 +16,7 @@ const NORMALIZE_REGEXPS = [
   [/\r\n/gu, '\n'],
   [/\\/gu, '/'],
   [/[A-Z]:\//g, '/'],
+  [/Program Files/gu, 'ProgramFiles'],
   [new RegExp(tick, 'g'), '√'],
   [new RegExp(pointer, 'g'), '>'],
   [new RegExp(arrowDown, 'g'), '↓'],