fix: make remote repository entry reliable#1936
Conversation
📝 WalkthroughWalkthroughThe change adds credential-free public GitHub and GitLab resolution, makes remote URL submission Enter-driven, preserves per-URL failures with retry support, and expands backend, frontend, mobile, and documentation coverage. ChangesRemote repository resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant RemoteRepoChip
participant ResolutionHooks
participant ProviderAPI
User->>RemoteRepoChip: enter remote URL
RemoteRepoChip->>ResolutionHooks: submit trimmed URL on Enter
ResolutionHooks->>ProviderAPI: resolve branches and metadata
ProviderAPI-->>ResolutionHooks: success or error
ResolutionHooks-->>RemoteRepoChip: row data and per-URL error
User->>RemoteRepoChip: click Retry
RemoteRepoChip->>ResolutionHooks: clear and re-ensure URL
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @carlosflorencio's task in 0s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b50f2c903
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/backend/internal/github/service_test.go (1)
136-148: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRegister test-server cleanup with
t.Cleanup.
apps/backend/internal/github/service_test.go#L136-L148: replacedefer srv.Close()witht.Cleanup(srv.Close)immediately after server creation.apps/backend/internal/github/service_test.go#L196-L204: replacedefer srv.Close()witht.Cleanup(srv.Close)immediately after server creation.As per coding guidelines, register
t.Cleanupimmediately after creating resources requiring teardown, before any fatal assertion can exit the test.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/backend/internal/github/service_test.go` around lines 136 - 148, Replace the deferred server teardown in TestGetPRAndIssue_FallBackWithoutClient at apps/backend/internal/github/service_test.go:136-148 with immediate t.Cleanup registration after creating the test server. Apply the same change to the server setup at apps/backend/internal/github/service_test.go:196-204, ensuring cleanup is registered before any assertions or fatal exits.Source: Coding guidelines
docs/specs/gitlab-integration/spec.md (1)
172-175: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winDocument the
expected_hostparameter for anonymous branch fallback.
GET /projects/branchesaccepts?workspace_id=...&project=...&expected_host=...; when the workspace is unconfigured, the server only falls back tohttps://gitlab.comafter normalizing and checkingexpected_host, so the spec should document the required host-bearing parameter instead of leaving it as a bare project path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/specs/gitlab-integration/spec.md` around lines 172 - 175, Update the GET /projects/branches specification to document the expected_host query parameter and its required GitLab host value for anonymous fallback. Describe that the server normalizes and validates expected_host before allowing the explicitly named public project path when the workspace is unconfigured.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@docs/plans/remote-repository-entry-reliability/task-01-public-provider-resolution.md`:
- Around line 4-8: Keep the done status and completion evidence consistent by
updating
docs/plans/remote-repository-entry-reliability/task-01-public-provider-resolution.md
lines 4-8 with exact backend test results, changed entry points, risks, and
uncertainties; update
docs/plans/remote-repository-entry-reliability/task-03-resolution-errors-and-retry.md
lines 4-8 with the changed state contract and exact frontend test results; and
update docs/plans/remote-repository-entry-reliability/task-04-mobile-e2e.md
lines 4-8 with the exact E2E result plus any screenshots or failure artifacts.
In `@docs/public/tasks-and-workflows.md`:
- Line 58: Update the “Remote” entry in the tasks-and-workflows documentation to
explicitly identify anonymous public GitHub pull request/issue reads and GitLab
branch reads as credential-free. Clarify that credentials remain required for
private resources and authenticated browsing or write operations, while
preserving the existing URL and branch-selection details.
---
Nitpick comments:
In `@apps/backend/internal/github/service_test.go`:
- Around line 136-148: Replace the deferred server teardown in
TestGetPRAndIssue_FallBackWithoutClient at
apps/backend/internal/github/service_test.go:136-148 with immediate t.Cleanup
registration after creating the test server. Apply the same change to the server
setup at apps/backend/internal/github/service_test.go:196-204, ensuring cleanup
is registered before any assertions or fatal exits.
In `@docs/specs/gitlab-integration/spec.md`:
- Around line 172-175: Update the GET /projects/branches specification to
document the expected_host query parameter and its required GitLab host value
for anonymous fallback. Describe that the server normalizes and validates
expected_host before allowing the explicitly named public project path when the
workspace is unconfigured.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 83eeccd0-ae5b-4a6c-8693-eccffecf7e99
📒 Files selected for processing (30)
apps/backend/internal/github/controller_test.goapps/backend/internal/github/service_pr.goapps/backend/internal/github/service_reviews.goapps/backend/internal/github/service_test.goapps/backend/internal/gitlab/controller_test.goapps/backend/internal/gitlab/controller_watches.goapps/backend/internal/gitlab/pat_client.goapps/backend/internal/gitlab/pat_client_test.goapps/web/components/task-create-dialog-form-body.test.tsxapps/web/components/task-create-dialog-remote-repo-chip-url.test.tsxapps/web/components/task-create-dialog-remote-repo-chip.test.tsxapps/web/components/task-create-dialog-remote-repo-chip.tsxapps/web/components/task-create-dialog-remote-repo-chips.test.tsxapps/web/components/task-create-dialog-remote-repo-chips.tsxapps/web/components/task-create-dialog-repo-chips.test.tsxapps/web/components/task-create-dialog-submit.test.tsxapps/web/components/task-create-dialog.test.tsxapps/web/e2e/tests/task/mobile-create-task-remote-repo.spec.tsapps/web/hooks/domains/github/use-branches-by-url.test.tsapps/web/hooks/domains/github/use-branches-by-url.tsapps/web/hooks/domains/github/use-pr-info-by-url.test.tsapps/web/hooks/domains/github/use-pr-info-by-url.tsdocs/plans/remote-repository-entry-reliability/plan.mddocs/plans/remote-repository-entry-reliability/task-01-public-provider-resolution.mddocs/plans/remote-repository-entry-reliability/task-02-explicit-url-entry.mddocs/plans/remote-repository-entry-reliability/task-03-resolution-errors-and-retry.mddocs/plans/remote-repository-entry-reliability/task-04-mobile-e2e.mddocs/public/tasks-and-workflows.mddocs/specs/gitlab-integration/spec.mddocs/specs/tasks/multi-branch/spec.md
Cloudflare Pages docs previewBuilt from docs commit Stable PR alias: https://docs-pr-1936.landing-87j.pages.dev/docs |
|
Addressed all four inline findings in
The docstring-coverage warning is non-blocking and does not match this repository's enforced |
|
Claude finished @carlosflorencio's task in 0s —— View job I'll analyze this and get back to you. |
|
Claude finished @carlosflorencio's task in 0s —— View job I'll analyze this and get back to you. |
Remote repository URLs resolved while users were still editing them and hid provider failures, making task creation unreliable in credential-free preview environments. Require explicit submission, expose retryable errors, and preserve anonymous access to public GitHub and GitLab resources.
Important Changes
Validation
make fmtmake typecheckmake testmake lintcd apps/web && pnpm e2e --project=mobile-chrome e2e/tests/task/mobile-create-task-remote-repo.spec.tsPossible Improvements
Low risk: anonymous provider APIs remain rate-limited, so transient upstream failures still depend on the new Retry flow.
Checklist
apps/web/), I have added or updated Playwright e2e tests inapps/web/e2e/and verified them withmake test-e2e.docs/public/**and updated them or noted why no docs change is needed.Screenshots
Desktop — URL staged until Enter
Mobile — retryable resolution error