Rename submission branches to {hash}-{listing-slug}#4805
Conversation
Preview deploymentsHost Test Results 1 files 1 suites 2h 3m 35s ⏱️ Results for commit 5991528. Realm Server Test Results 1 files ±0 1 suites ±0 11m 31s ⏱️ -24s Results for commit a389a2a. ± Comparison against earlier commit 5991528. |
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub submission branch naming scheme from the previous room-<base64>/<slug> format to a shorter {6-hex-hash}-{listing-slug} format, relying on persisting branchName on the workflow card to keep retries targeting the same branch.
Changes:
- Reworked
toBranchNameto generate random 6-hex hashes and removed room-id encoding/decoding logic. - Updated host + bot-runner workflow codepaths to use/persist the new
branchNameshape. - Refreshed runtime-common and bot-runner tests to match the new branch convention and folder wrapping behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-common/github-submissions.ts | Implements the new random-hash branch name generator and updated toBranchName API. |
| packages/runtime-common/tests/github-submissions-test.ts | Updates tests for {hash6}-{slug} output and normalization behavior. |
| packages/host/app/commands/create-submission-workflow.ts | Generates branchName once and persists it on the workflow card; sends it in the bot trigger. |
| packages/bot-runner/lib/pr-listing/pr-listing-workflow-handler.ts | Updates branch generation calls to the new toBranchName(listingName) signature. |
| packages/bot-runner/lib/pr-listing/create-listing-pr-handler.ts | Uses the new branch naming and now uses the full branch name as the submission folder prefix. |
| packages/bot-runner/tests/create-listing-pr-handler-test.ts | Adjusts expectations for branch/folder names under the new convention. |
| packages/bot-runner/tests/bot-runner-test.ts | Updates expectations around branchName presence and folder wrapping semantics. |
Comments suppressed due to low confidence (1)
packages/bot-runner/lib/pr-listing/create-listing-pr-handler.ts:260
buildSubmissionFolderName()now returns the full branch name and is used to prefix committed file paths. Becausecontext.headcan come from unvalidatedinput.branchName, this enables slashes /..segments to change where files land in the repo tree. Consider sanitizing/validatingbranchName(e.g., disallow/,.., and other unsafe characters) and/or keep using only the first path segment for the wrapper folder.
function buildSubmissionFolderName(context: CreateListingPRContext): string {
return context.head;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
57a2d57 to
5991528
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 599152810c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace the room-encoded `room-<base64>/<slug>` branch convention with a
short `{6-hex-hash}-{listing-slug}` form. The hash is random per call;
determinism for retries is preserved by the persisted `branchName` on
the workflow card.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5991528 to
a389a2a
Compare
Replace the room-encoded
room-<base64>/<slug>branch convention with a short{6-hex-hash}-{listing-slug}form. The hash is random per call; determinism for retries is preserved by the persistedbranchNameon the workflow card.