Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a port number of remoteUrl in the mirror UI #1073

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,40 @@ private void createAndReadMirror() {
final MirrorDto savedMirror = response1.content();
assertThat(savedMirror).isEqualTo(newMirror);
}

// Make sure that the mirror with a port number in the remote URL can be created and read.
final MirrorDto mirrorWithPort = new MirrorDto("mirror-with-port-3",
true,
FOO_PROJ,
"5 * * * * ?",
"REMOTE_TO_LOCAL",
BAR_REPO,
"/updated/local-path/",
"git+https",
"git.com:922/line/centraldogma-test.git",
"/updated/remote-path/",
"updated-mirror-branch",
".updated-env",
"public-key-credential",
null);

final ResponseEntity<PushResultDto> response0 =
userClient.prepare()
.post("/api/v1/projects/{proj}/mirrors")
.pathParam("proj", FOO_PROJ)
.contentJson(mirrorWithPort)
.asJson(PushResultDto.class)
.execute();
assertThat(response0.status()).isEqualTo(HttpStatus.CREATED);
final ResponseEntity<MirrorDto> response1 =
userClient.prepare()
.get("/api/v1/projects/{proj}/mirrors/{id}")
.pathParam("proj", FOO_PROJ)
.pathParam("id", mirrorWithPort.id())
.asJson(MirrorDto.class)
.execute();
final MirrorDto savedMirror = response1.content();
assertThat(savedMirror).isEqualTo(mirrorWithPort);
}

private void updateMirror() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static MirrorDto convertToMirrorDto(String projectName, Mirror mirror) {
mirror.localRepo().name(),
mirror.localPath(),
remoteRepoUri.getScheme(),
remoteRepoUri.getHost() + remoteRepoUri.getPath(),
remoteRepoUri.getAuthority() + remoteRepoUri.getPath(),
mirror.remotePath(),
mirror.remoteBranch(),
mirror.gitignore(),
Expand Down
Loading