Fix HTTPS parser to consistently reject URLs with extra path segments#453
Closed
cursor[bot] wants to merge 2 commits intomainfrom
Closed
Fix HTTPS parser to consistently reject URLs with extra path segments#453cursor[bot] wants to merge 2 commits intomainfrom
cursor[bot] wants to merge 2 commits intomainfrom
Conversation
Secrets and variables created during `depot ci migrate` now default to repo-scoped instead of org-scoped. The repo is auto-detected from the git remote origin URL, or can be explicitly set via `--repo owner/name`. Falls back to org scope when the repo cannot be detected. Made-with: Cursor
The HTTPS branch now trims trailing slashes before splitting and uses the strict len(parts) != 2 check, matching the SSH branch behavior. This prevents URLs like https://gitlab.com/group/subgroup/project.git from silently returning incorrect owner/repo values.
5c3eadc to
0552c5d
Compare
Base automatically changed from
watts/dep-3838-depo-ci-migrate-secrets-and-variables-should-default-to-repo
to
main
March 16, 2026 22:23
Author
|
Automatically closed this PR because it was created by Bugbot autofix for #452, and that PR was closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed inconsistent behavior between SSH and HTTPS URL parsing in
parseGitHubRepo. The HTTPS parser now correctly rejects URLs with more than two path segments, matching the SSH parser's behavior.Changes
strings.TrimRight(path, "/")before splitting the path in the HTTPS branchlen(parts) < 2tolen(parts) != 2for consistency with SSH branchBug Details
Previously, the HTTPS parser would accept URLs like
https://gitlab.com/group/subgroup/project.gitand return"group/subgroup"instead of rejecting them. This could cause secrets/variables to be scoped to incorrect repositories.The SSH parser correctly rejected such URLs (e.g.,
git@github.com:a/b/c.git→""), but the HTTPS parser was lenient due to using< 2instead of!= 2.Testing
All existing tests pass, including:
TestParseGitHubRepo/too_many_segments- verifies rejection of URLs with 3+ segmentsTestParseGitHubRepo/https_trailing_slash- verifies trailing slashes still work correctly