Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(agoric-sdk): Include version twins in valid bundle compartment names #9667

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

kriskowal
Copy link
Member

Description

The Agoric CLI now does some validation of bundles. This includes a regular expression for valid compartment names, but doesn’t account for duplicate compartments from the same alleged version of a package.

Security Considerations

None.

Scaling Considerations

As written, we replace a cryptic failure mode (valid bundle) with a different cryptic failure mode (bundle is oversized due to duplicates of the same package).

Documentation Considerations

None.

Testing Considerations

To test would require an overconstrained scenario that would fail in the face of valid changes. It might be better to further relax these constraints to warnings.

Upgrade Considerations

None.

@kriskowal kriskowal requested a review from turadg July 8, 2024 19:49
@@ -11,7 +11,7 @@ import { ZipReader } from '@endo/zip';
/** @import {Bundle} from '@agoric/swingset-vat'; */
/** @import {CoreEvalPlan} from '@agoric/deploy-script-support/src/writeCoreEvalParts.js' */

const PACKAGE_NAME_RE = /(?<packageName>.*-v[\d.]+)\//;
const PACKAGE_NAME_RE = /(?<packageName>.*-v[\d.]+(?:-n\d+)?)\//;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems pretty low level to JS ecosystem. is there someplace from which we could import it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names are generated by the compartment mapper and can technically be anything. I’m going to land this since it’s the smallest expedient, but it might be better to just remove the check so we don’t accidentally break if we need to change the scheme.

@kriskowal kriskowal added the automerge:rebase Automatically rebase updates, then merge label Jul 8, 2024
@kriskowal kriskowal force-pushed the kriskowal-allow-bundle-dups branch from 1278710 to 861ecaf Compare July 8, 2024 21:30
Copy link

cloudflare-workers-and-pages bot commented Jul 8, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 861ecaf
Status: ✅  Deploy successful!
Preview URL: https://d1ab46cf.agoric-sdk.pages.dev
Branch Preview URL: https://kriskowal-allow-bundle-dups.agoric-sdk.pages.dev

View logs

@mergify mergify bot merged commit 859d8c0 into master Jul 8, 2024
78 checks passed
@mergify mergify bot deleted the kriskowal-allow-bundle-dups branch July 8, 2024 22:03
mergify bot added a commit that referenced this pull request Jul 12, 2024
…es (#9669)

## Description

Following #9667 we learn that the bundle analyzer needs to understand exotic package names that include `-dev$hash` and such. To that end, this change fully generalizes the package name detector based on the `@` prefix distinguishing a package name with two path components.

### Security Considerations

None.

### Scaling Considerations

None.

### Documentation Considerations

None.

### Testing Considerations

None.

### Upgrade Considerations

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants