-
Worklog
Step Task Est 1 Add repoTypeparam toProjectServiceinterface andProjectServiceImpl30m 2 Replace gitUrl inference with explicit repoTypecheck in service30m 3 Update ProjectControllerto passdto.effectiveRepoType()15m 4 Test: create LOCAL project without gitUrl, create EXTERNAL project with credentials 30m -
Root Cause
ProjectController.createProject()does not passrepoTypeto the service:final Project saved = projectService.createProject( dto.name(), dto.description(), dto.gitUrl(), dto.gitUsername(), dto.gitPassword(), dto.defaultBranchName(), owner, dto.effectiveVisibility() // repoType is missing here );Fix
- Add
repoTypeparameter toProjectService.createProject()signature - In
ProjectServiceImpl, replace gitUrl-based inference with explicit repoType check:
final boolean isExternalRepo = repoType == RepoType.EXTERNAL;- Update
ProjectControllerto passdto.effectiveRepoType()to the service
Notes
ProjectCreateDto.effectiveRepoType()already exists and defaults toEXTERNAL— just not wired through- Workaround for now: omit
gitUrlwhen creating LOCAL projects — service falls into Sztabina path correctly
- Add
-
rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout wolnosc git checkout -b bugfix/SZ-77-repoType-inference Switched to branch 'wolnosc' Your branch is up to date with 'origin/wolnosc'. Switched to a new branch 'bugfix/SZ-77-repoType-inference' rksuma@Ramakrishnans-MacBook-Pro sztab % git pull origin You asked to pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line. rksuma@Ramakrishnans-MacBook-Pro sztab % git pull origin rksuma@Ramakrishnans-MacBook-Pro sztab %
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Version |
1.10.0
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Problem
ProjectServiceImpl.createProject()determines whether a repo is external or Sztabina-hosted by checking ifgitUrlis non-blank:This is a side-effect-based inference that ignores the explicit
repoTypefield onProjectCreateDto. As a result, passingrepoType: LOCALwith agitUrlstill triggers the external repo validation path, throwing:This makes the API contract ambiguous and fragile — callers cannot express intent explicitly.
Expected Behavior
Repo type should be determined by the explicit
repoTypefield:repoType: EXTERNAL+gitUrl+gitUsername+gitPassword→ external repo, validate all threerepoType: LOCAL→ Sztabina-hosted, ignore any providedgitUrl/credentials, create repo internallyCurrent Behavior
Repo type is inferred from
gitUrlpresence alone.repoTypefield is ignored in the service layer entirely (ProjectCreateDto.effectiveRepoType()is never called byProjectController.createProject()).