-
-
Notifications
You must be signed in to change notification settings - Fork 10
fix(arg-parsing): allow project display names with spaces in org/project argument #1116
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1640,10 +1640,17 @@ export async function resolveOrgProjectTarget( | |
| case "project-search": { | ||
| const displaySlug = parsed.originalSlug ?? parsed.projectSlug; | ||
| const isDisplayName = parsed.originalSlug !== undefined; | ||
| const { projects, orgs } = isDisplayName | ||
| const { projects, orgs: foundOrgs } = isDisplayName | ||
| ? { projects: [], orgs: await listOrganizations() } | ||
| : await findProjectsBySlug(parsed.projectSlug); | ||
|
|
||
| // When the caller provided an org (e.g. "org/My Project"), scope the | ||
| // display-name search to that org instead of all accessible orgs. | ||
| const orgs = | ||
| isDisplayName && parsed.org !== undefined | ||
| ? foundOrgs.filter((o) => o.slug === parsed.org) | ||
| : foundOrgs; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Org scope ignored in fuzzy searchMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit b7d99fb. Configure here. |
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue list ignores display namesHigh Severity Parsing now emits Reviewed by Cursor Bugbot for commit b7d99fb. Configure here. |
||
| if (projects.length === 0) { | ||
| const outcome = await triageProjectNotFound( | ||
| parsed.projectSlug, | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The
resolveTargetsFromParsedArgfunction doesn't handle project display names (e.g., "My Project") when an organization is specified, causing commands likesentry issue listto fail.Severity: MEDIUM
Suggested Fix
The logic for handling display names from
resolveOrgProjectTargetshould be mirrored in theproject-searchcase withinresolveTargetsFromParsedArg. Specifically, it should check if the project identifier is a display name and, if so, skip thefindProjectsBySlugcall and proceed directly to the fuzzy matching logic, ensuring the search is correctly scoped to the provided organization.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.