[Devant Migration] Implement Link a repository, Add orgs and repos in import flow features#754
[Devant Migration] Implement Link a repository, Add orgs and repos in import flow features#754SandaminiM wants to merge 5 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds credential-based Git provider support to project creation, import, and repository-linking flows. It propagates Sequence Diagram(s)sequenceDiagram
participant CreateOrImportPage
participant useGitRepoSource
participant CredentialSelectCard
participant RepositoryAPI
participant ProjectOrComponentAPI
CreateOrImportPage->>CredentialSelectCard: select or add provider credential
CredentialSelectCard->>useGitRepoSource: set selected credential
useGitRepoSource->>RepositoryAPI: fetch repositories with secretRef
RepositoryAPI-->>useGitRepoSource: return repositories and branches
CreateOrImportPage->>ProjectOrComponentAPI: submit provider, URL, and secretRef
ProjectOrComponentAPI-->>CreateOrImportPage: return created project or component
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ipaas/src/pages/ImportProject.tsx (1)
122-140: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDo not block importing when the availability check fails.
When this request errors,
availabilityremains undefined andcanSubmitstays false. DestructureavailabilityErrorand treat it as ready, matchingCreateProject.Proposed fix
- const { handler: effectiveHandler, handlerEdited, isCheckingAvailability, availability, startEditing, stopEditing, onHandlerChange } = useProjectHandler(displayName); + const { handler: effectiveHandler, handlerEdited, isCheckingAvailability, availability, availabilityError, startEditing, stopEditing, onHandlerChange } = useProjectHandler(displayName); - const availabilityReady = !effectiveHandler || effectiveHandler.length < 2 || availability !== undefined; + const availabilityReady = !effectiveHandler || effectiveHandler.length < 2 || availability !== undefined || availabilityError;🤖 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 `@ipaas/src/pages/ImportProject.tsx` around lines 122 - 140, Update ImportProject’s useProjectHandler destructuring to include availabilityError, then adjust availabilityReady so an availability request error is treated as ready alongside a completed availability result. Keep the existing validation and submission checks unchanged, matching the readiness behavior in CreateProject.
🤖 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 `@ipaas/src/api/cloud/projects.ts`:
- Around line 97-99: Update linkProjectRepository to use the mandated ni() stub
helper instead of directly throwing an Error, matching the existing pattern used
by the ICP stub and preserving the unsupported-operation behavior.
In `@ipaas/src/components/ProjectCreate/GitProviderCards.tsx`:
- Around line 74-79: Update the onSelect handler in credentialCard so it passes
the selected credential’s actual provider type derived from c.type, rather than
always using the card’s provider value. Preserve the existing credential
selection flow while ensuring Bitbucket Server credentials retain their server
provider and repository URL behavior.
In `@ipaas/src/components/ProjectCreate/LinkRepositoryDialog.tsx`:
- Line 198: Update the repository URL, organization, and repository change
handlers in LinkRepositoryDialog to clear both the selected branch and directory
whenever the repository source changes. Preserve the new source value while
resetting these dependent selections so stale values cannot be submitted.
- Around line 178-184: Update the GitHub authorization UI around isGitHub and
authStatus so only an actively authorizing state shows the indefinite
CircularProgress; render the appropriate retry or installation actions for idle,
failed, and needs-install states, preferably by reusing GitHubAuthArea. Preserve
the completed state behavior.
- Around line 125-131: Normalize directoryPath in the link-repository mutation
payload to match the creation flows: represent the root directory as an empty
string and remove any leading slash from non-root paths. Update the
directoryPath field in the payload while leaving the surrounding repository and
provider fields unchanged.
In `@ipaas/src/pages/ImportIntegration.tsx`:
- Around line 124-132: Update the isAuthenticated calculation in
ImportIntegration to derive authentication from a successful repository query
rather than requiring userRepos.length > 0, so authorized accounts with empty
repository lists remain authenticated. Preserve the existing public-repository
behavior and use the query’s success state alongside the existing loading/error
state as appropriate.
- Around line 314-319: Update the source URL construction in the integration
payload to use selectedCredential.type when isCredentialMode is enabled, while
retaining credProvider for other modes. Ensure buildRepoUrl recognizes
BITBUCKET_SERVER and uses the selected credential’s serverUrl when constructing
that provider’s URL; preserve existing GitHub and Bitbucket Cloud behavior.
In `@ipaas/src/utils/gitProviderUrl.test.ts`:
- Around line 23-38: Add a regression test in the buildRepoUrl suite for
GitProvider.BITBUCKET_SERVER using a self-managed server URL, and assert it
produces the expected Bitbucket Server repository URL rather than the GitHub
default. Follow the existing GitLab self-managed test pattern and preserve the
current coverage for other providers.
In `@ipaas/src/utils/gitProviderUrl.ts`:
- Around line 27-36: Update buildRepoUrl to add a dedicated
GitProvider.BITBUCKET_SERVER case that constructs the correct Bitbucket Server
repository URL instead of using the GitHub fallback. Add a regression test in
ipaas/src/utils/gitProviderUrl.test.ts covering this provider and expected URL;
no direct change is required in ipaas/src/pages/Project.tsx because it is only
an affected caller.
---
Outside diff comments:
In `@ipaas/src/pages/ImportProject.tsx`:
- Around line 122-140: Update ImportProject’s useProjectHandler destructuring to
include availabilityError, then adjust availabilityReady so an availability
request error is treated as ready alongside a completed availability result.
Keep the existing validation and submission checks unchanged, matching the
readiness behavior in CreateProject.
🪄 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
Run ID: 1c364004-4d39-44a4-b4d9-72533a4a6ae0
📒 Files selected for processing (38)
ipaas/public/config.jsonipaas/src/api/cloud/projects.tsipaas/src/api/contracts.tsipaas/src/api/icp/projects.tsipaas/src/api/wip/components.tsipaas/src/api/wip/credentials.tsipaas/src/api/wip/projects.tsipaas/src/api/wip/repository.tsipaas/src/components/Import/CredentialSelectCard.tsxipaas/src/components/Import/GitHubAuthArea.tsxipaas/src/components/Import/gitHubSelectActions.tsxipaas/src/components/IntegrationCreate/TechDetectionIcon.tsxipaas/src/components/ProjectCreate/GitProviderCards.tsxipaas/src/components/ProjectCreate/LinkRepositoryDialog.tsxipaas/src/components/Settings/Credentials/AddCredentialDialog.tsxipaas/src/constants/gitProviders.tsxipaas/src/constants/import.tsxipaas/src/constants/project.tsipaas/src/hooks/useCredentials.tsipaas/src/hooks/useGitHubAuth.tsipaas/src/hooks/useGitRepoSource.tsipaas/src/hooks/useProjectHandler.tsipaas/src/hooks/useProjects.tsipaas/src/hooks/useRepository.tsipaas/src/pages/CreateIntegrationOptions.tsxipaas/src/pages/CreateProject.tsxipaas/src/pages/ImportIntegration.tsxipaas/src/pages/ImportProject.tsxipaas/src/pages/Project.tsxipaas/src/paths.tsipaas/src/types/component.tsipaas/src/types/credentials.tsipaas/src/types/import.tsipaas/src/types/project.tsipaas/src/utils/gitCredentials.test.tsipaas/src/utils/gitCredentials.tsipaas/src/utils/gitProviderUrl.test.tsipaas/src/utils/gitProviderUrl.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@ipaas/src/components/ProjectCreate/LinkRepositoryDialog.tsx`:
- Around line 179-180: Update the conditional rendering around GitHubAuthArea so
it also renders when authorization is complete but repository loading returns no
usable repositories or an error. Preserve the existing auth-status behavior and
pass the completed-state data needed for GitHubAuthArea to show its warning and
reconnect action.
🪄 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
Run ID: ae74203e-3aee-402d-9d53-3d01a6eb2518
📒 Files selected for processing (13)
ipaas/src/api/cloud/projects.tsipaas/src/api/wip/repository.tsipaas/src/components/Import/CredentialSelectCard.tsxipaas/src/components/ProjectCreate/GitProviderCards.tsxipaas/src/components/ProjectCreate/LinkRepositoryDialog.tsxipaas/src/components/Settings/Credentials/AddCredentialDialog.tsxipaas/src/constants/gitProviders.tsxipaas/src/pages/CreateProject.tsxipaas/src/pages/ImportIntegration.tsxipaas/src/pages/ImportProject.tsxipaas/src/utils/gitCredentials.test.tsipaas/src/utils/gitProviderUrl.test.tsipaas/src/utils/gitProviderUrl.ts
💤 Files with no reviewable changes (1)
- ipaas/src/constants/gitProviders.tsx
🚧 Files skipped from review as they are similar to previous changes (11)
- ipaas/src/utils/gitProviderUrl.ts
- ipaas/src/api/cloud/projects.ts
- ipaas/src/utils/gitCredentials.test.ts
- ipaas/src/utils/gitProviderUrl.test.ts
- ipaas/src/components/Import/CredentialSelectCard.tsx
- ipaas/src/components/ProjectCreate/GitProviderCards.tsx
- ipaas/src/api/wip/repository.ts
- ipaas/src/components/Settings/Credentials/AddCredentialDialog.tsx
- ipaas/src/pages/ImportProject.tsx
- ipaas/src/pages/CreateProject.tsx
- ipaas/src/pages/ImportIntegration.tsx
Purpose
resolves:
Refer to the followings:
2026-07-17.13-26-27.mp4
2026-07-17.13-27-28.mp4
Goals
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning