PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: GoogleChrome/lighthouse (js)
Issue: DevTools Error: INVALID_URL when trying to audit extension
**Initial URL**: chrome-extension://laookkfknpbbblfpciffpaejjkokdgca/dashboard.html
**Chrome Version**: 72.0.3590.0
**Error Message**: INVALID_URL
**Stack Trace**:
```
LHError: INVALID_URL
    at lighthouse (chrome-devtools://devtools/remote/serve_file/@ec242826af28a2b3c3b47390ab6141cfe26fe9e7/audits2_worker/audits2_worker_module.js:1130:461)
    at runLighthouseInWorker (chrome-devtools://devtools/remote/serve_file/@ec242826af28a2b3c3b47390ab6141cfe26fe9e7/audits2_worker/audits2_worker_module.js:1570:200)
    at Promise.resolve.then._ (chrome-devtools://devtools/remote/serve_file/@ec242826af28a2b3c3b47390ab6141cfe26fe9e7/audits2_worker/audits2_worker_module.js:4593:133)
```
Pull request description: core(lib): add chrome-extension to URL allowedProtocols and add test
Resolves #6421.

Patch:
diff --git a/lighthouse-core/config/config.js b/lighthouse-core/config/config.js
index 3d3e40676..b7e4b4a41 100644
--- a/lighthouse-core/config/config.js
+++ b/lighthouse-core/config/config.js
@@ -64,13 +64,18 @@ function validateCategories(categories, audits, groups) {
     return;
   }
 
+  const auditsKeyedById = new Map((audits || []).map(audit =>
+    /** @type {[string, LH.Config.AuditDefn]} */
+    ([audit.implementation.meta.id, audit])
+  ));
+
   Object.keys(categories).forEach(categoryId => {
     categories[categoryId].auditRefs.forEach((auditRef, index) => {
       if (!auditRef.id) {
         throw new Error(`missing an audit id at ${categoryId}[${index}]`);
       }
 
-      const audit = audits && audits.find(a => a.implementation.meta.id === auditRef.id);
+      const audit = auditsKeyedById.get(auditRef.id);
       if (!audit) {
         throw new Error(`could not find ${auditRef.id} audit for category ${categoryId}`);
       }
diff --git a/lighthouse-core/lib/url-shim.js b/lighthouse-core/lib/url-shim.js
index 8327efff3..260136058 100644
--- a/lighthouse-core/lib/url-shim.js
+++ b/lighthouse-core/lib/url-shim.js
@@ -25,7 +25,7 @@ const listOfTlds = [
 ];
 
 const allowedProtocols = [
-  'https:', 'http:', 'chrome:',
+  'https:', 'http:', 'chrome:', 'chrome-extension:',
 ];
 
 /**


Test patch:
diff --git a/lighthouse-core/test/lib/url-shim-test.js b/lighthouse-core/test/lib/url-shim-test.js
index 236127de7..2247011ea 100644
--- a/lighthouse-core/test/lib/url-shim-test.js
+++ b/lighthouse-core/test/lib/url-shim-test.js
@@ -40,6 +40,7 @@ describe('URL Shim', () => {
     assert.ok(URL.isProtocolAllowed('http://google.com/'));
     assert.ok(URL.isProtocolAllowed('https://google.com/'));
     assert.ok(URL.isProtocolAllowed('chrome://version'));
+    assert.ok(URL.isProtocolAllowed('chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/popup.html'));
   });
 
   it('safely identifies disallowed URL protocols', () => {
Repository: googleapis/api-linter (go)
Issue: API Lint rule 126, Should not check for alias enum type
 if the first enum type is also an alias, then an API lint error will occur. Say enum Type { option allow_alias = true; TYPE_UNSPECIFIED = 0; DEFAULT_TYPE = 0; TYPE_ONE = 1; } This type enum alias, in my understanding should be allowed.
Pull request description: [AIP-216] support alias
Resolve #466
- check if at least one enum with <name>_UNSPECIFIED
- check if <name>_UNSPECIFIED = 0
- added alias test case.

Patch:
diff --git a/rules/aip0126/unspecified.go b/rules/aip0126/unspecified.go
index 4aae186..f34f30b 100644
--- a/rules/aip0126/unspecified.go
+++ b/rules/aip0126/unspecified.go
@@ -24,25 +24,21 @@ import (
 	"github.com/stoewer/go-strcase"
 )
 
-var unspecified = &lint.EnumValueRule{
-	Name:   lint.NewRuleName(126, "unspecified"),
-	OnlyIf: isFirstEnumValue,
-	LintEnumValue: func(v *desc.EnumValueDescriptor) []lint.Problem {
-		want := strings.ToUpper(strcase.SnakeCase(v.GetEnum().GetName()) + "_UNSPECIFIED")
-		if v.GetName() != want {
-			return []lint.Problem{{
-				Message:    fmt.Sprintf("The first enum value should be %q", want),
-				Suggestion: want,
-				Descriptor: v,
-				Location:   locations.DescriptorName(v),
-			}}
+var unspecified = &lint.EnumRule{
+	Name: lint.NewRuleName(126, "unspecified"),
+	LintEnum: func(e *desc.EnumDescriptor) []lint.Problem {
+		firstValue := e.GetValues()[0]
+		want := strings.ToUpper(strcase.SnakeCase(e.GetName()) + "_UNSPECIFIED")
+		for _, element := range e.GetValues() {
+			if element.GetName() == want && element.GetNumber() == 0 {
+				return nil
+			}
 		}
-
-		return nil
+		return []lint.Problem{{
+			Message:    fmt.Sprintf("The first enum value should be %q", want),
+			Suggestion: want,
+			Descriptor: firstValue,
+			Location:   locations.DescriptorName(firstValue),
+		}}
 	},
 }
-
-// Note: proto3 requires that first value in enum have numeric value of 0.
-func isFirstEnumValue(v *desc.EnumValueDescriptor) bool {
-	return v.GetNumber() == 0
-}


Test patch:
diff --git a/rules/aip0126/unspecified_test.go b/rules/aip0126/unspecified_test.go
index b974125..e49befc 100644
--- a/rules/aip0126/unspecified_test.go
+++ b/rules/aip0126/unspecified_test.go
@@ -42,6 +42,25 @@ func TestUnspecified(t *testing.T) {
 				}
 			`, test)
 
+			// Run the lint rule and establish we get the correct problems.
+			problems := unspecified.Lint(f)
+			if diff := test.problems.SetDescriptor(f.GetEnumTypes()[0].GetValues()[0]).Diff(problems); diff != "" {
+				t.Errorf(diff)
+			}
+		})
+	}
+	for _, test := range tests {
+		t.Run(test.testName, func(t *testing.T) {
+			// Create the proto with the enum.
+			f := testutils.ParseProto3Tmpl(t, `
+				enum BookFormat {
+					option allow_alias = true; 
+					HARDBACK = 0;
+					{{.ValueName}} = 0;
+					PAPERBACK = 1;
+				}
+			`, test)
+
 			// Run the lint rule and establish we get the correct problems.
 			problems := unspecified.Lint(f)
 			if diff := test.problems.SetDescriptor(f.GetEnumTypes()[0].GetValues()[0]).Diff(problems); diff != "" {