Repository navigation
Conversation
Signed-off-by: Ben Kapner <benkapner@gmail.com>
PR Summary by QodoFix dotted repository names in GitHub URLs
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Some GitHub links stop resolving
|
| match = re.search(r"github\.com[:/]([^/]+)/([^/]+)", repo_name) | ||
| if match: | ||
| repo_name = f"{match.group(1)}/{match.group(2)}" | ||
| repo_name = f"{match.group(1)}/{match.group(2).removesuffix('.git')}" |
There was a problem hiding this comment.
1. Some github links stop resolving 🐞 Bug ≡ Correctness
validate_target_repo now captures the query or fragment after repo.git, so
removesuffix('.git') leaves it intact and repository-name validation rejects the value. A link
such as https://github.com/example/repo.git?tab=readme previously resolved to example/repo but
now fails when passed through --target-repo.
Agent Prompt
## Issue description
GitHub URLs ending in `.git` followed by a query or fragment were previously accepted but now fail validation because the extra URL components are included in the repository name.
## Fix Focus Areas
- scripts/validate_target_repo.py[58-61]
- tests/unit/test_validate_target_repo.py[59-117]
## Recommended Fix
Extract the repository path component separately from the URL query and fragment, then remove a trailing `.git` from the repository path segment only. Add cases for `.git` URLs followed by a query and a fragment.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
@Benkapner I agree with this review, it is valid
|
🤖 Finished Review · ❌ Failure (fullsend config could not be loaded, agent did not run: loading fullsend config: config.yaml: create_issues is no longer supported: move create_issues.allow_targets to tracker.<provider>.allowed_ta…) · Started 3:38 PM UTC · Completed 3:38 PM UTC Commit: |
|
🤖 Finished Review · ✅ Success · Started 2:21 PM UTC · Completed 2:29 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.35 |
|
Risk Assessment: low (1/5) DetailsSmall 68-line bug fix with high test coverage and zero recent churn across touched files, presenting minimal risk. Previous runRisk Assessment: low (1/5) DetailsSmall bug fix with comprehensive test coverage and zero recent churn in touched files, resulting in minimal risk. |
ReviewFindingsHigh
Low
Next steps:
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W119 --> ReviewFindingsHigh
Labels: PR is a bug fix to repository URL parsing. Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:31 AM UTC · Completed 9:38 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.25 |
| # Accept full GitHub URLs, extract org/repo | ||
| if repo_name.startswith("http://") or repo_name.startswith("https://"): | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/\.]+)", repo_name) | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/]+)", repo_name) |
There was a problem hiding this comment.
[high] protected-path
Modifies a file under protected path scripts/ with no linked issue ("Related Issue: None"), so the change lacks linked authorization for modifying governance/infrastructure files. Human approval is always required for protected-path changes.
Suggested fix: Link an issue that authorizes the change and obtain human approval.
| # Accept full GitHub URLs, extract org/repo | ||
| if repo_name.startswith("http://") or repo_name.startswith("https://"): | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/\.]+)", repo_name) | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/]+)", repo_name) |
There was a problem hiding this comment.
[low] edge-case
The widened capture ([^/]+) includes URL queries and fragments: https://github.com/example/repo.git#readme and ...repo.git?ref=main previously normalized to example/repo but now fail validation (removesuffix no longer matches; _GITHUB_REPO_RE rejects). New tests do not cover queries or fragments.
Suggested fix: Capture ([^/?#]+) and add regression cases for clone URLs with a query and a fragment.
| # Accept full GitHub URLs, extract org/repo | ||
| if repo_name.startswith("http://") or repo_name.startswith("https://"): | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/\.]+)", repo_name) | ||
| match = re.search(r"github\.com[:/]([^/]+)/([^/]+)", repo_name) |
There was a problem hiding this comment.
[low] injection-vuln
https://github.com/example/.. now validates as example/.. since _GITHUB_REPO_RE accepts dot-only names; the shorthand example/.. already passed on base and local paths are accepted by design, so the URL form adds little reach. Advisory input-hygiene gap, out of scope for this fix.
Suggested fix: Optionally reject repository components equal to . or .. after removing the .git suffix, for URL and shorthand input, with tests.
There was a problem hiding this comment.
@Benkapner, I agree here.
Please reject repository names that are exactly . or .. after stripping one trailing .git. This still allows valid dotted names like my.project and .github.
On main, a GitHub URL whose repository segment is .. is rejected; this change accepts it and passes owner/.. to find_target_repo().
Please add CLI regression cases for ., .., and ...git (which becomes .. after suffix removal).
Summary
Repository names containing dots are truncated when passed as GitHub URLs through
--target-repo. For example,https://github.com/example/my.project.gitresolves toexample/myinstead ofexample/my.project.Preserve the full repository name and remove only a trailing
.gitsuffix from URLs. Shorthand values such asexample/my.project.gitremain unchanged.Related Issue
None — opened directly as a bug fix.
Changes
scripts/validate_target_repo.pyto preserve dots.Testing
uv run --extra dev pre-commit run --all-filesmake lintVerified the new regression tests fail before the fix.
Full suite command:
uv run pytest tests/ -q --cov=scripts --cov-report=term-missing --cov-fail-under=70make lintpasses with an existing warning about the removedcontent-critical-positionrule in.skillsaw.yaml.Checklist