Skip to main content

Source Connection Testing & Project Discovery

Version: 3.0.0 Date: 2026-05-07

Goal: Allow users to validate credentials and select projects without manual ID entry.

Solution: "Test Connection" workflow backed by a unified POST /discover-projects endpoint that proxies to GitLab, GitHub, Bitbucket, and FTP.

Features:

  • "Test connection" button in Source creation step
  • Auto-discovery of projects/repositories for Git providers
  • Autocomplete dropdown for selecting projects
  • Write permission check for FTP (create + delete temp file)
  • Error display shows the exact failing URL (401/403/404 debugging)
  • "Cancel" button on all workflow steps (source and storage forms)

Implementation Details:

  • DiscoverSourceParams provides a uniform interface across all providers
  • FTP test uses absolute paths to prevent CWD issues
  • Custom error handling in SourceService injects config.url from Axios interceptor
  • ConfiguratorService / StateInterceptor fixed: "Ready" state only when full config is valid

Files Modified:

  • src/app.controller.ts - New discovery endpoint logic
  • src/protocol/source/source.service.ts - Unified dispatch + error URL enrichment
  • src/protocol/capacities/ftp-capacity/ftp-capacity.service.ts - FTP write permission test
  • ui/src/pages/workflows/stepForms/StepInitForm.tsx - Test Connection UI
  • ui/src/pages/workflows/stepForms/StepGitForm.tsx - Cancel button
  • ui/src/pages/workflows/stepForms/StepStorageForm.tsx - Cancel button
  • ui/src/pages/storages/StorageEditor.tsx - Cancel button
  • src/core/configuration/configurator/configurator.service.ts - State transition fix
  • src/core/configuration/status.interceptor.ts - Guard against premature Ready state