nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: endojs/endo
Pull request #2267 (2024-05-06 01:02:23)

refactor(pass-style): better non-remotable function error
closes: #XXXX
refs: https://github.com/Agoric/agoric-sdk/pull/9097

## Description

As the changed test case demonstrates, before this PR, testing the `passStyleOf` a normal unmarked function was correctly rejected, but with a terrible error message, such as: 
- `"[Symbol(passStyle)]" property expected: "[Function ...]"`

This change aligns with the error message already used for an unmarked objects-as-closure object. For an unmarked function, the error would be
- `Remotables must be explicitly declared: "[Function ...]"`

### Security Considerations

none

### Scaling Considerations

none

### Documentation Considerations

none

### Testing & Compatibility Considerations

There might be tests with golden text based on the old error message. These tests would need to be revised to the new text. During the transition, golden text error tests should use a regexp to be compat with both the before and after of this PR, with a link to the PR itself so we know when we can clean it up.

I found three such dependencies. One in endo, which this PR fixes. None in agoric-sdk master. Two in https://github.com/Agoric/agoric-sdk/pull/9097 , both of which have now been revised to be compat before and after.


### Upgrade Considerations

none

- ~[ ] Includes `*BREAKING*:` in the commit message with migration instructions for any breaking change.~
- ~[ ] Updates `NEWS.md` for user-facing changes.~



Patch:
diff --git a/packages/pass-style/src/remotable.js b/packages/pass-style/src/remotable.js
index 788ae19d1..d4c17986f 100644
--- a/packages/pass-style/src/remotable.js
+++ b/packages/pass-style/src/remotable.js
@@ -87,7 +87,11 @@ const checkRemotableProtoOf = (original, check) => {
   //        }}
   //
   const proto = getPrototypeOf(original);
-  if (proto === objectPrototype || proto === null) {
+  if (
+    proto === objectPrototype ||
+    proto === null ||
+    proto === Function.prototype
+  ) {
     return (
       reject && reject`Remotables must be explicitly declared: ${q(original)}`
     );


Test patch:
diff --git a/packages/exo/test/test-heap-classes.js b/packages/exo/test/test-heap-classes.js
index 77b031a27..d41352e98 100644
--- a/packages/exo/test/test-heap-classes.js
+++ b/packages/exo/test/test-heap-classes.js
@@ -180,12 +180,13 @@ test('missing interface', t => {
   );
   const greeterMaker = makeExo('greeterMaker', undefined, {
     makeSayHello() {
-      return () => 'hello';
+      const helloFunc = () => 'hello';
+      return harden(helloFunc);
     },
   });
   t.throws(() => greeterMaker.makeSayHello(), {
     message:
-      'In "makeSayHello" method of (greeterMaker): result: "[Symbol(passStyle)]" property expected: "[Function <anon>]"',
+      'In "makeSayHello" method of (greeterMaker): result: Remotables must be explicitly declared: "[Function helloFunc]"',
   });
   t.is(greeterMaker[GET_INTERFACE_GUARD]?.(), undefined);
 });
Repository: endojs/endo
Pull request #2379 (2024-07-23 23:35:07)

fix(bundle-source): Recognize default metadata
Refs: https://github.com/Agoric/agoric-sdk/pull/9735

## Description

Agoric SDK integration revealed a regression in the `bundle-source/cache.js` implementation, where the validator didn’t recognize default metadata.

### Security Considerations

None.

### Scaling Considerations

None.

### Documentation Considerations

None.

### Testing Considerations

This change includes a regression test.

### Compatibility Considerations

Restores backward compatibility.

### Upgrade Considerations

None.


Patch:
diff --git a/packages/bundle-source/cache.js b/packages/bundle-source/cache.js
index 74220fa76..9c0b612ef 100644
--- a/packages/bundle-source/cache.js
+++ b/packages/bundle-source/cache.js
@@ -2,7 +2,7 @@
 import { makePromiseKit } from '@endo/promise-kit';
 import { makeReadPowers } from '@endo/compartment-mapper/node-powers.js';
 
-import bundleSource from './src/index.js';
+import bundleSource, { DEFAULT_MODULE_FORMAT } from './src/bundle-source.js';
 import { makeFileReader, makeAtomicFileWriter } from './src/fs.js';
 
 const { Fail, quote: q } = assert;
@@ -167,8 +167,8 @@ export const makeBundleCache = (wr, cwd, readPowers, opts) => {
   ) => {
     await null;
     const {
-      noTransforms: expectedNoTransforms,
-      format: expectedFormat,
+      noTransforms: expectedNoTransforms = false,
+      format: expectedFormat = DEFAULT_MODULE_FORMAT,
       conditions: expectedConditions = [],
     } = options;
     expectedConditions.sort();
diff --git a/packages/bundle-source/src/bundle-source.js b/packages/bundle-source/src/bundle-source.js
index 7eb951726..ce184350b 100644
--- a/packages/bundle-source/src/bundle-source.js
+++ b/packages/bundle-source/src/bundle-source.js
@@ -1,5 +1,5 @@
 // @ts-check
-const DEFAULT_MODULE_FORMAT = 'endoZipBase64';
+export const DEFAULT_MODULE_FORMAT = 'endoZipBase64';
 export const SUPPORTED_FORMATS = [
   'getExport',
   'nestedEvaluate',


Test patch:
diff --git a/packages/bundle-source/test/cache.test.js b/packages/bundle-source/test/cache.test.js
new file mode 100644
index 000000000..d2b72873d
--- /dev/null
+++ b/packages/bundle-source/test/cache.test.js
@@ -0,0 +1,18 @@
+import url from 'url';
+import test from '@endo/ses-ava/prepare-endo.js';
+import { makeNodeBundleCache } from '../cache.js';
+
+test('cache can capture and verify metadata', async t => {
+  const dest = url.fileURLToPath(new URL('../bundles/', import.meta.url));
+  const entry = url.fileURLToPath(
+    new URL('../demo/meaning.js', import.meta.url),
+  );
+  const cache = await makeNodeBundleCache(
+    dest,
+    {},
+    specifier => import(specifier),
+  );
+  await cache.validateOrAdd(entry, 'cache-test-meaning', t.log);
+  await cache.validate('cache-test-meaning', undefined, t.log);
+  t.pass();
+});
Repository: kubernetes/cloud-provider-aws
Pull request #211 (2021-05-01 23:35:01)

Cherry-pick: Use GA topoogy labels for EBS (#99130)
Cherry-pick of https://github.com/kubernetes/kubernetes/pull/99130

---
Use GA topoogy labels for EBS

/kind cleanup

```release-note
NONE
```



Patch:
diff --git a/pkg/providers/v1/aws.go b/pkg/providers/v1/aws.go
index c74eef1..7a55668 100644
--- a/pkg/providers/v1/aws.go
+++ b/pkg/providers/v1/aws.go
@@ -2739,12 +2739,12 @@ func (c *Cloud) GetVolumeLabels(volumeName KubernetesVolumeID) (map[string]strin
 		return nil, fmt.Errorf("volume did not have AZ information: %q", aws.StringValue(info.VolumeId))
 	}
 
-	labels[v1.LabelFailureDomainBetaZone] = az
+	labels[v1.LabelTopologyZone] = az
 	region, err := azToRegion(az)
 	if err != nil {
 		return nil, err
 	}
-	labels[v1.LabelFailureDomainBetaRegion] = region
+	labels[v1.LabelTopologyRegion] = region
 
 	return labels, nil
 }


Test patch:
diff --git a/pkg/providers/v1/aws_test.go b/pkg/providers/v1/aws_test.go
index 56fd43d..a45160c 100644
--- a/pkg/providers/v1/aws_test.go
+++ b/pkg/providers/v1/aws_test.go
@@ -1225,8 +1225,8 @@ func TestGetVolumeLabels(t *testing.T) {
 
 	assert.Nil(t, err, "Error creating Volume %v", err)
 	assert.Equal(t, map[string]string{
-		v1.LabelFailureDomainBetaZone:   "us-east-1a",
-		v1.LabelFailureDomainBetaRegion: "us-east-1"}, labels)
+		v1.LabelTopologyZone:   "us-east-1a",
+		v1.LabelTopologyRegion: "us-east-1"}, labels)
 	awsServices.ec2.(*MockedFakeEC2).AssertExpectations(t)
 }
 
@@ -1299,8 +1299,8 @@ func TestGetLabelsForVolume(t *testing.T) {
 				AvailabilityZone: aws.String("us-east-1a"),
 			}},
 			map[string]string{
-				v1.LabelFailureDomainBetaZone:   "us-east-1a",
-				v1.LabelFailureDomainBetaRegion: "us-east-1",
+				v1.LabelTopologyZone:   "us-east-1a",
+				v1.LabelTopologyRegion: "us-east-1",
 			},
 			nil,
 		},