-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Get the branches from a Tuleap Git repository and get all (#270)
* feat: Get the branches from a Tuleap Git repository and get all repositories from a project Part of [request #22618](https://tuleap.net/plugins/tracker/?aid=22618) Stop using the deprecated client in Jenkins plugin * Make spotbug happy Co-authored-by: Clarck Robinson <clarck.robinson@enalean.com>
- Loading branch information
Showing
12 changed files
with
366 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/io/jenkins/plugins/tuleap_api/client/GitBranch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.jenkins.plugins.tuleap_api.client; | ||
|
||
public interface GitBranch { | ||
String getName(); | ||
|
||
GitCommit getCommit(); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/io/jenkins/plugins/tuleap_api/client/GitRepositories.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.jenkins.plugins.tuleap_api.client; | ||
|
||
import java.util.List; | ||
|
||
public interface GitRepositories { | ||
List<? extends GitRepository> getGitRepositories(); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/io/jenkins/plugins/tuleap_api/client/GitRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.jenkins.plugins.tuleap_api.client; | ||
|
||
public interface GitRepository { | ||
String getName(); | ||
|
||
Integer getId(); | ||
|
||
String getPath(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/io/jenkins/plugins/tuleap_api/client/internals/entities/GitBranchEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.jenkins.plugins.tuleap_api.client.internals.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.jenkins.plugins.tuleap_api.client.GitBranch; | ||
import io.jenkins.plugins.tuleap_api.client.GitCommit; | ||
|
||
final public class GitBranchEntity implements GitBranch { | ||
|
||
private final String name; | ||
private final GitCommitEntity commit; | ||
|
||
public GitBranchEntity(@JsonProperty("name") String name, @JsonProperty("commit") GitCommitEntity commit){ | ||
this.name = name; | ||
this.commit = commit; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public GitCommit getCommit() { | ||
return this.commit; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...n/java/io/jenkins/plugins/tuleap_api/client/internals/entities/GitRepositoriesEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.jenkins.plugins.tuleap_api.client.internals.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.jenkins.plugins.tuleap_api.client.GitRepositories; | ||
import io.jenkins.plugins.tuleap_api.client.GitRepository; | ||
|
||
import java.util.List; | ||
|
||
final public class GitRepositoriesEntity implements GitRepositories { | ||
|
||
private List<GitRepositoryEntity> repositories; | ||
|
||
public GitRepositoriesEntity(@JsonProperty("repositories") List<GitRepositoryEntity> repositories){ | ||
this.repositories = repositories; | ||
} | ||
|
||
@Override | ||
public List<? extends GitRepository> getGitRepositories() { | ||
return this.repositories; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ain/java/io/jenkins/plugins/tuleap_api/client/internals/entities/GitRepositoryEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.jenkins.plugins.tuleap_api.client.internals.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.jenkins.plugins.tuleap_api.client.GitRepository; | ||
|
||
final public class GitRepositoryEntity implements GitRepository { | ||
|
||
private final String name; | ||
private final Integer id; | ||
private final String path; | ||
|
||
public GitRepositoryEntity(@JsonProperty("name") String name, | ||
@JsonProperty("id") Integer id, | ||
@JsonProperty("path") String path) | ||
{ | ||
this.name = name; | ||
this.id = id; | ||
this.path = path; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public Integer getId() { | ||
return this.id; | ||
} | ||
|
||
@Override | ||
public String getPath() { | ||
return this.path; | ||
} | ||
} |
Oops, something went wrong.