fix(bitbucket): bind cursors and task locations case-insensitively - #6883
fix(bitbucket): bind cursors and task locations case-insensitively#6883waleedlatif1 wants to merge 2 commits into
Conversation
Bitbucket resolves workspace and repository slugs case-insensitively but echoes the canonical lowercase form in `next` links, diff/diffstat redirect targets, and async merge task Locations. Binding those back with exact string equality meant a mixed-case slug succeeded on the first request and then failed on every follow-up — worst on a 202 merge, where the merge has already started when polling breaks. Repository file paths keep verbatim comparison; git treats those as case-sensitive.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Tests cover mixed-case slugs with canonical URLs and confirm re-cased directory paths are still rejected. Reviewed by Cursor Bugbot for commit 13f260d. Configure here. |
|
@cursor review |
Greptile SummaryThis follow-up narrows Bitbucket path comparison so only workspace and repository slug segments are case-insensitive while fixed endpoint and repository-path segments remain exact.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/tools/bitbucket/utils.ts | Introduces segment-aware path comparison that folds only workspace and repository slugs while preserving exact matching for fixed endpoints and file paths. |
| apps/sim/tools/bitbucket/merge_pull_request.ts | Uses the shared repository-prefix matcher to accept Bitbucket-canonicalized slug casing in merge task locations. |
| apps/sim/tools/bitbucket/utils.test.ts | Covers mixed-case slug acceptance and exact-case enforcement for fixed endpoint and repository file-path segments. |
| apps/sim/tools/bitbucket/pull-requests.test.ts | Verifies canonicalized merge task locations remain bound to mixed-case caller slugs. |
Reviews (2): Last reviewed commit: "fix(bitbucket): fold only the slug segme..." | Re-trigger Greptile
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 13f260d. Configure here.
Segment-wise comparison replaces whole-path case folding, so a cursor that recases a fixed endpoint literal (repositories, commits, pullrequests) fails locally again instead of being deferred to Bitbucket. Only the workspace and repository segments of a /2.0/repositories path fold; file paths and literals stay verbatim.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ecb5ba8. Configure here.
Follow-up to #6860, which merged before this round of review feedback landed.
Cursor Bugbot flagged this on #6860 (thread r3818428661) after the squash merge, so the fix goes up separately.
Problem
Bitbucket resolves workspace and repository slugs case-insensitively but echoes the canonical lowercase form back in
nextlinks, diff/diffstat redirect targets, and async merge taskLocationheaders. Three call sites bound those responses back to the caller's slug with exact string equality, so a mixed-caseworkspaceSlugorrepoSlugsucceeded on the first request and then threw on every follow-up:Fix
All three now compare through a shared
equalsIgnoreCase:bitbucketApiUrlnextPathPrefixsegment match, andnextRevision(hex SHAs are case-insensitive, andrequireBitbucketSha1already accepts uppercase)validateBitbucketPullRequestRedirectmergeTaskLocationRepository file paths keep verbatim comparison — git treats those as case-sensitive, so
src/Dirmust not matchsrc/dir.Tests
Three cases added, each verified to fail without the fix:
utils.test.ts)utils.test.ts)Locationaccepted for a mixed-case slug (pull-requests.test.ts)The same bug class was fixed in the repository selector route in #6860; this closes it in the tool layer.