-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.8.0
-
None
-
False
-
-
False
-
-
Description of problem:
When only the GitLab integration is configured under integrations.gitlab in app-config.yaml (with no GitHub integration), the Bulk Import "Add Repositories" page has two issues:
1. Empty repository list: The page sends approvalTool=GIT in the API request to /api/bulk-import/repositories. This causes the backend to query the GitHub API service (which has no configured integrations) instead of the GitLab API service, resulting in an empty repository list.
2. Incorrect table column headers: The table displays GitHub-specific column names ("Organization", "Selected Repositories") instead of GitLab-specific ones ("Group", "Selected Projects"). This is because the isApprovalToolGitlab flag used by the column headers is derived from the Formik approvalTool value, which is stuck at GIT.
Root cause: The Formik initialValues in both AddRepositoriesForm.tsx and BulkImportPage.tsx unconditionally hardcode approvalTool: ApprovalTool.Git without checking which integrations are actually configured. Additionally, the approval tool radio selector (GitHub/GitLab toggle) in AddRepositoriesTable.tsx is only rendered when both integrations are configured, so the user has no way to manually switch to GitLab.
The issue does not occur when both GitHub and GitLab are configured (the radio toggle appears and the user can select GitLab), or when only GitHub is configured (the default GIT value is correct).
Prerequisites (if any, like setup, operators/versions):
- RHDH 1.8 with the Bulk Import plugin installed (frontend + backend)
- Only GitLab integration configured in app-config.yaml, with GitHub integration commented out or removed:
integrations: gitlab: - host: gitlab.com token: <GITLAB_TOKEN>
Steps to Reproduce
- Configure only a GitLab integration under integrations.gitlab in app-config.yaml. Ensure no GitHub integration is configured under integrations.github.
- Start the application (yarn start).
- Navigate to the Bulk Import page and click "Import" to go to http://localhost:3000/bulk-import/repositories/add.
- Observe the network request made to /api/bulk-import/repositories.
- Observe the table column headers on the "Add Repositories" page.
Actual results:
- The API request is sent with approvalTool=GIT in the query parameters.
- The backend uses the GitHub API service (no GitHub integration exists), returning an empty repository list.
- The "Add Repositories" page shows no repositories.
- The table column headers show GitHub terminology — "Organization" column instead of "Group", and "Selected Repositories" instead of "Selected Projects".
Expected results:
- When only GitLab is configured, the API request should be sent with approvalTool=GITLAB.
- The backend should use the GitLab API service and return the list of GitLab repositories.
- Repositories from the configured GitLab instance should be displayed on the page.
- The table column headers should show GitLab terminology — "Group" instead of "Organization", and "Selected Projects" instead of "Selected Repositories".
Reproducibility (Always/Intermittent/Only Once):
Always
Build Details:
RHDH 1.8