Skip to content

Make release manifest shortNames legal install slugs - #397

Open
Maximo-Guk wants to merge 1 commit into
mainfrom
maximo/release-slug-safe-shortname
Open

Make release manifest shortNames legal install slugs#397
Maximo-Guk wants to merge 1 commit into
mainfrom
maximo/release-slug-safe-shortname

Conversation

@Maximo-Guk

@Maximo-Guk Maximo-Guk commented Aug 31, 2026

Copy link
Copy Markdown
Member

The deploy wizard sends a gatekeeper's manifest shortName to the deploy service as the install slug verbatim, and the service turns that slug into a GATEKEEPER_ binding name - so it validates against /^[a-z][a-z0-9]*$/. gatekeeper-mcp-portal was the only installable gatekeeper whose derived shortName carried a hyphen, so mcp-portal failed zod validation on the first line of install(), before the workflow was ever created. Users saw a redacted "Something unexpected went wrong on our side." with no workflow logs to debug from.

  • Adds releaseShortName() (manifest-lib.ts:338), which folds the package name into the slug charset by stripping everything outside [a-z0-9]. ( illegal characters as they're not supported in binding name for router worker )
  • Adds collision guard in generateManifest() throwing if two gatekeepers fold to the same slug.

Also added tests for shortName is a legal slug and matches its BASE_URL path, releaseShortName() folds correctly and no-ops on conforming names, shortNames are unique across the real manifest

@github-actions github-actions Bot added the delivery Changes to CI or release delivery label Aug 31, 2026
ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Aug 31, 2026

Copy link
Copy Markdown

Posted 1 actionable inline finding.

github run

@github-actions

Copy link
Copy Markdown

Preview: pr397-maximo-releas-d3f8b0f9

https://pr397-maximo-releas-d3f8b0f9-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

The deploy wizard sends a gatekeeper's manifest shortName as the install slug
verbatim, and the deploy service turns that slug into a GATEKEEPER_<SLUG>
binding name, so it rejects anything outside /^[a-z][a-z0-9]*$/.
gatekeeper-mcp-portal was the only installable gatekeeper whose shortName
carried a hyphen, so installing Mcp-Portal failed zod validation on the first
line of install() — before the workflow was ever created, surfacing to users as
a redacted "Something unexpected went wrong on our side." with no workflow logs.

Fold the release manifest's shortName into the slug charset via a new
releaseShortName(), leaving gatekeeperShortName() alone: staging and preview
bind gatekeepers as GATEKEEPER_<PKG_NAME> and the router maps _ back to -, so a
hyphen does round-trip there and folding globally would point their BASE_URL at
a 404.

Assert in the generator test that every emitted shortName is a legal slug. The
client passes shortName through unfolded, so this is what turns the next
hyphenated gatekeeper into a release-build failure instead of a runtime 500.

mcp-portal's deployed path becomes /gatekeeper/mcpportal, which stays
self-consistent end to end; it registers no external redirect URI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Maximo-Guk
Maximo-Guk force-pushed the maximo/release-slug-safe-shortname branch from 6a0a701 to 205cd03 Compare September 2, 2026 02:04
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Maximo-Guk Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

1 similar comment
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Maximo-Guk Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown

LGTM!

github run

@Maximo-Guk
Maximo-Guk marked this pull request as ready for review September 2, 2026 15:24

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

* bindings (underscores, router maps _ -> -) where a hyphen does round-trip.
*/
export function releaseShortName(pkgName: string): string {
return gatekeeperShortName(pkgName).replace(/[^a-z0-9]/g, "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Invalid slugs survive manifest generation

A suffix that folds empty, starts with a digit, or exceeds 20 characters makes releaseShortName return an invalid install slug. generateManifest can publish a connector that every installation rejects.

Suggested change
return gatekeeperShortName(pkgName).replace(/[^a-z0-9]/g, "");
const shortName = gatekeeperShortName(pkgName).replace(/[^a-z0-9]/g, "");
if (!/^[a-z][a-z0-9]{0,19}$/.test(shortName)) {
throw new Error(`${pkgName} does not fold to a legal install slug`);
}
return shortName;
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delivery Changes to CI or release delivery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant