nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: GoogleChrome/lighthouse
Pull request #7189 (2019-02-08 17:22:22)

core(cache-headers): fix typo in must-revalidate
**Summary**
Fixes the typo in our cache audit that was looking for `must-validate` instead of `must-revalidate`



Patch:
diff --git a/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js b/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js
index 2ce5f806e..d866ca6d8 100644
--- a/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js
+++ b/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js
@@ -175,7 +175,7 @@ class CacheHeaders extends Audit {
     // Ignore assets where policy implies they should not be cached long periods
     if (cacheControl &&
       (
-        cacheControl['must-validate'] ||
+        cacheControl['must-revalidate'] ||
         cacheControl['no-cache'] ||
         cacheControl['no-store'] ||
         cacheControl['private'])) {
diff --git a/types/parse-cache-control/index.d.ts b/types/parse-cache-control/index.d.ts
index e78a485b6..5e8059fb5 100644
--- a/types/parse-cache-control/index.d.ts
+++ b/types/parse-cache-control/index.d.ts
@@ -8,7 +8,7 @@ declare module 'parse-cache-control' {
   // Follows the potential settings of cache-control, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
   interface CacheHeaders {
     'max-age'?: number;
-    'must-validate'?: boolean;
+    'must-revalidate'?: boolean;
     'no-cache'?: boolean;
     'no-store'?: boolean;
     'private'?: boolean;


Test patch:
diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js
index a4fa6ac43..aba0f68d0 100644
--- a/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js
+++ b/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js
@@ -190,7 +190,7 @@ describe('Cache headers audit', () => {
 
   it('ignores assets where policy implies they should not be cached long periods', () => {
     const networkRecords = [
-      networkRecord({headers: {'cache-control': 'must-validate'}}),
+      networkRecord({headers: {'cache-control': 'must-revalidate'}}),
       networkRecord({headers: {'cache-control': 'no-cache'}}),
       networkRecord({headers: {'cache-control': 'private'}}),
     ];
Repository: GoogleChrome/lighthouse
Pull request #5943 (2018-08-31 21:41:57)

tests(smokehouse): update expectations for HTML Imports deprecation
appveyor dbw smoke tests are failing because we now have an additional deprecation firing in Canary: HTML Imports :)

~(will switch to `>=3` to account for running Chrome stable on Travis after the Travis tests fail so I can verify that they fail :)~


Patch:
diff --git a/lighthouse-core/config/lr-desktop-config.js b/lighthouse-core/config/lr-desktop-config.js
index 508639ad7..4999685c0 100644
--- a/lighthouse-core/config/lr-desktop-config.js
+++ b/lighthouse-core/config/lr-desktop-config.js
@@ -9,6 +9,7 @@
 const config = {
   extends: 'lighthouse:default',
   settings: {
+    maxWaitForLoad: 35 * 1000,
     disableDeviceEmulation: true,
     throttling: {
       // Using a "broadband" connection type
diff --git a/lighthouse-core/config/lr-mobile-config.js b/lighthouse-core/config/lr-mobile-config.js
index 98a3c83e6..778acb403 100644
--- a/lighthouse-core/config/lr-mobile-config.js
+++ b/lighthouse-core/config/lr-mobile-config.js
@@ -8,7 +8,9 @@
 /** @type {LH.Config.Json} */
 const config = {
   extends: 'lighthouse:default',
-  settings: {},
+  settings: {
+    maxWaitForLoad: 35 * 1000,
+  },
 };
 
 module.exports = config;


Test patch:
diff --git a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js
index 45455d77b..bd51a1c8f 100644
--- a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js
+++ b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js
@@ -101,7 +101,8 @@ module.exports = [
         score: 0,
         details: {
           items: {
-            length: 3,
+            // Note: HTML Imports added to deprecations in m70, so 3 before, 4 after.
+            length: '>=3',
           },
         },
       },
Repository: Azure/ARO-RP
Pull request #1832 (2021-11-08 21:14:04)

Pull Secret Unmarshalling Bugfix
### Which issue this PR addresses:

<!--
Please include a link to the ADO work item as well as any GitHub issues.

Usage: `Fixes #<GitHub issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes
```
Observed a panic: &runtime.TypeAssertionError{_interface:(*runtime._type)(0x3ff8f20), concrete:(*runtime._type)(nil), asserted:(*runtime._type)(0x3dd0f00), missingMethod:""} (interface conversion: interface {} is nil, not string)
goroutine 1292 [running]
```

### What this PR does / why we need it:
There's a bug during unmarshalling process. When there's no auth value, a type assertion error is being thrown that causes ARO operator to fail and constantly crash loop its pod. 

### Test plan for issue:

Unit test updated to include an empty auth value and it reproduced the issue. Once verification for nil was added, the new test passed successfully.

### Is there any documentation that needs to be updated for this PR?
N/A



Patch:
diff --git a/pkg/util/pullsecret/pullsecret.go b/pkg/util/pullsecret/pullsecret.go
index fd0855d7b..6c25a8c59 100644
--- a/pkg/util/pullsecret/pullsecret.go
+++ b/pkg/util/pullsecret/pullsecret.go
@@ -37,7 +37,9 @@ func UnmarshalSecretData(ps *corev1.Secret) (map[string]string, error) {
 
 	secretData := map[string]string{}
 	for k, v := range pullSecretData.Auths {
-		secretData[k] = v["auth"].(string)
+		if v["auth"] != nil {
+			secretData[k] = v["auth"].(string)
+		}
 	}
 
 	return secretData, nil


Test patch:
diff --git a/pkg/util/pullsecret/pullsecret_test.go b/pkg/util/pullsecret/pullsecret_test.go
index ed5815807..4a448b11e 100644
--- a/pkg/util/pullsecret/pullsecret_test.go
+++ b/pkg/util/pullsecret/pullsecret_test.go
@@ -338,6 +338,17 @@ func TestUnmarshalSecretData(t *testing.T) {
 				"registry.redhat.io": "ZnJlZDplbnRlcg==",
 			},
 		},
+		{
+			name: "bad secret",
+			ps: &corev1.Secret{
+				Data: map[string][]byte{
+					corev1.DockerConfigJsonKey: []byte(`{"auths":{"arosvc.azurecr.io":{}, "registry.redhat.io":{"auth":"ZnJlZDplbnRlcg=="}}}`),
+				},
+			},
+			wantAuth: map[string]string{
+				"registry.redhat.io": "ZnJlZDplbnRlcg==",
+			},
+		},
 		{
 			name: "broken secret",
 			ps: &corev1.Secret{
Repository: Azure/ARO-RP
Pull request #1658 (2021-08-06 12:27:04)

fixing NSGreconciler issue with ArchitectureV1
reconcilerNSG used to swap NSGs between master and worker subnets

### Which issue this PR addresses:

Fixes

### What this PR does / why we need it:
In ArchitectureV1 NSG reconciler assigned the node-nsg to the master subnet, controlplane-nsg to the worker subnet. This PR fixes it.

### Test plan for issue:

There are unit tests, there was a bug in the unit tests.
Extension plan:
Add a test for the whole Reconcile function in the controller (separate PR).

### Is there any documentation that needs to be updated for this PR?
n/a


Patch:
diff --git a/pkg/operator/controllers/azurensg/subnetnsg.go b/pkg/operator/controllers/azurensg/subnetnsg.go
index 328e0b71f..10be5a38f 100644
--- a/pkg/operator/controllers/azurensg/subnetnsg.go
+++ b/pkg/operator/controllers/azurensg/subnetnsg.go
@@ -68,7 +68,7 @@ func (r *Reconciler) ensureSubnetNSG(ctx context.Context, subnetsClient network.
 }
 
 func (r *Reconciler) getSubnets(ctx context.Context) (map[subnetDescriptor]bool, string, error) {
-	subnetMap := make(map[subnetDescriptor]bool) // bool is true for master subnets
+	subnetMap := make(map[subnetDescriptor]bool) // bool is true for worker subnets
 	var masterResourceGroup *string
 	// select all workers by the  machine.openshift.io/cluster-api-machine-role: not equal to master Label
 	machines, err := r.maocli.MachineV1beta1().Machines(machineSetsNamespace).List(ctx, metav1.ListOptions{LabelSelector: "machine.openshift.io/cluster-api-machine-role!=master"})
@@ -82,8 +82,10 @@ func (r *Reconciler) getSubnets(ctx context.Context) (map[subnetDescriptor]bool,
 			return nil, "", err
 		}
 
-		subnetMap[*subnetDesc] = false
+		// subnetMap stores boolean isWorker
+		subnetMap[*subnetDesc] = true
 	}
+	// select all masters
 	machines, err = r.maocli.MachineV1beta1().Machines(machineSetsNamespace).List(ctx, metav1.ListOptions{LabelSelector: "machine.openshift.io/cluster-api-machine-role=master"})
 	if err != nil {
 		return nil, "", err
@@ -94,7 +96,9 @@ func (r *Reconciler) getSubnets(ctx context.Context) (map[subnetDescriptor]bool,
 		if err != nil {
 			return nil, "", err
 		}
-		subnetMap[*subnetDesc] = true
+
+		// subnetMap stores boolean isWorker
+		subnetMap[*subnetDesc] = false
 	}
 	if masterResourceGroup == nil {
 		return nil, "", fmt.Errorf("master resource group not found")


Test patch:
diff --git a/pkg/operator/controllers/azurensg/subnetnsg_test.go b/pkg/operator/controllers/azurensg/subnetnsg_test.go
index f4b6231bf..accef2cb4 100644
--- a/pkg/operator/controllers/azurensg/subnetnsg_test.go
+++ b/pkg/operator/controllers/azurensg/subnetnsg_test.go
@@ -127,12 +127,12 @@ func TestGetSubnets(t *testing.T) {
 					resourceGroup: "netRG",
 					vnetName:      "workerVnet",
 					subnetName:    "workerSubnet",
-				}: false,
+				}: true,
 				{
 					resourceGroup: "netRG",
 					vnetName:      "masterVnet",
 					subnetName:    "masterSubnet",
-				}: true,
+				}: false,
 			},
 			expectedMasterRG: "masterRG",
 			modify:           func(worker *machinev1beta1.Machine, master *machinev1beta1.Machine) {},