Skip to content

Commit 9030505

Browse files
trustinikhoon
andauthored
Update dependencies (#519)
- Armeria 0.99.6 -> 0.99.7 - jGit 5.7.0 -> 5.8.0 - Spring Boot 2.3.0 -> 2.3.1 - Build: - Gradle 6.4.1 -> 6.5 - Shadow 5.2.0 -> 6.0.0 - Checkstyle 8.32 -> 8.33 - json-unit 2.17.0 -> 2.18.1 Co-authored-by: Ikhun Um <ih.pert@gmail.com>
1 parent dd74094 commit 9030505

27 files changed

+275
-220
lines changed

dependencies.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
boms:
66
- com.fasterxml.jackson:jackson-bom:2.11.0
7-
- com.linecorp.armeria:armeria-bom:0.99.6
7+
- com.linecorp.armeria:armeria-bom:0.99.7
88
- io.micrometer:micrometer-bom:1.5.1
99
- org.junit:junit-bom:5.6.2
1010

@@ -53,7 +53,7 @@ com.github.ben-manes.caffeine:
5353
- https://www.javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.8.1/
5454

5555
com.github.jengelman.gradle.plugins:
56-
shadow: { version: '5.2.0' }
56+
shadow: { version: '6.0.0' }
5757

5858
com.github.node-gradle:
5959
gradle-node-plugin: { version: '2.2.4' }
@@ -112,7 +112,7 @@ com.linecorp.armeria:
112112
- https://www.javadoc.io/doc/com.linecorp.armeria/armeria-javadoc/0.99.6/
113113

114114
com.puppycrawl.tools:
115-
checkstyle: { version: '8.32' }
115+
checkstyle: { version: '8.33' }
116116

117117
com.spotify:
118118
completable-futures:
@@ -163,7 +163,7 @@ me.champeau.gradle:
163163
jmh-gradle-plugin: { version: '0.5.0' }
164164

165165
net.javacrumbs.json-unit:
166-
json-unit: { version: &JSON_UNIT_VERSION '2.17.0' }
166+
json-unit: { version: &JSON_UNIT_VERSION '2.18.1' }
167167
json-unit-fluent: { version: *JSON_UNIT_VERSION }
168168

169169
net.sf.proguard:
@@ -213,7 +213,8 @@ org.eclipse.jetty.alpn:
213213
alpn-api: { version: '1.1.3.v20160715' }
214214

215215
org.eclipse.jgit:
216-
org.eclipse.jgit: { version: '5.7.0.202003110725-r' }
216+
org.eclipse.jgit: { version: &JGIT_VERSION '5.8.0.202006091008-r' }
217+
org.eclipse.jgit.ssh.jsch: { version: *JGIT_VERSION }
217218

218219
org.hibernate.validator:
219220
hibernate-validator: { version: '6.1.5.Final' }
@@ -243,7 +244,7 @@ org.slf4j:
243244

244245
org.springframework.boot:
245246
spring-boot-starter:
246-
version: &SPRING_BOOT_VERSION '2.3.0.RELEASE'
247+
version: &SPRING_BOOT_VERSION '2.3.1.RELEASE'
247248
javadocs:
248249
- https://docs.spring.io/spring/docs/current/javadoc-api/
249250
spring-boot-starter-test: { version: *SPRING_BOOT_VERSION }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

server/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies {
3737

3838
// jGit
3939
implementation 'org.eclipse.jgit:org.eclipse.jgit'
40+
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch'
4041

4142
// Micrometer
4243
implementation 'io.micrometer:micrometer-core'

server/src/main/java/com/linecorp/centraldogma/server/internal/admin/service/RepositoryService.java

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.List;
2424
import java.util.Map;
2525
import java.util.Map.Entry;
26-
import java.util.Optional;
2726
import java.util.concurrent.CompletableFuture;
2827
import java.util.concurrent.CompletionStage;
2928

@@ -37,6 +36,7 @@
3736
import com.linecorp.armeria.common.HttpResponse;
3837
import com.linecorp.armeria.common.HttpStatus;
3938
import com.linecorp.armeria.server.ServiceRequestContext;
39+
import com.linecorp.armeria.server.annotation.Default;
4040
import com.linecorp.armeria.server.annotation.ExceptionHandler;
4141
import com.linecorp.armeria.server.annotation.Get;
4242
import com.linecorp.armeria.server.annotation.Param;
@@ -85,9 +85,9 @@ public RepositoryService(ProjectManager projectManager, CommandExecutor executor
8585
* Normalizes the revision into an absolute revision.
8686
*/
8787
@Get("/projects/{projectName}/repositories/{repoName}/revision/{revision}")
88-
public RevisionDto normalizeRevision(@Param("projectName") String projectName,
89-
@Param("repoName") String repoName,
90-
@Param("revision") String revision) {
88+
public RevisionDto normalizeRevision(@Param String projectName,
89+
@Param String repoName,
90+
@Param String revision) {
9191
return DtoConverter.convert(projectManager().get(projectName).repos().get(repoName)
9292
.normalizeNow(new Revision(revision)));
9393
}
@@ -98,15 +98,14 @@ public RevisionDto normalizeRevision(@Param("projectName") String projectName,
9898
*/
9999
@Get("regex:/projects/(?<projectName>[^/]+)/repositories/(?<repoName>[^/]+)" +
100100
"/files/revisions/(?<revision>[^/]+)(?<path>/.*$)")
101-
public CompletionStage<EntryDto> getFile(@Param("projectName") String projectName,
102-
@Param("repoName") String repoName,
103-
@Param("revision") String revision,
104-
@Param("path") String path,
105-
@Param("queryType") Optional<String> queryType,
106-
@Param("expression") Optional<String> expressions) {
101+
public CompletionStage<EntryDto> getFile(@Param String projectName,
102+
@Param String repoName,
103+
@Param String revision,
104+
@Param String path,
105+
@Param @Default("IDENTITY") QueryType queryType,
106+
@Param @Default("") String expression) {
107107

108-
final Query<?> query = Query.of(QueryType.valueOf(queryType.orElse("IDENTITY")),
109-
path, expressions.orElse(""));
108+
final Query<?> query = Query.of(queryType,path, expression);
110109
final Repository repo = projectManager().get(projectName).repos().get(repoName);
111110
return repo.get(repo.normalizeNow(new Revision(revision)), query)
112111
.thenApply(DtoConverter::convert);
@@ -120,9 +119,9 @@ public CompletionStage<EntryDto> getFile(@Param("projectName") String projectNam
120119
@Put
121120
@Path("/projects/{projectName}/repositories/{repoName}/files/revisions/{revision}")
122121
@RequiresWritePermission
123-
public CompletionStage<Object> addOrEditFile(@Param("projectName") String projectName,
124-
@Param("repoName") String repoName,
125-
@Param("revision") String revision,
122+
public CompletionStage<Object> addOrEditFile(@Param String projectName,
123+
@Param String repoName,
124+
@Param String revision,
126125
AggregatedHttpRequest request,
127126
ServiceRequestContext ctx) {
128127
final Entry<CommitMessageDto, Change<?>> p = commitMessageAndChange(request);
@@ -143,10 +142,10 @@ public CompletionStage<Object> addOrEditFile(@Param("projectName") String projec
143142
@Post("regex:/projects/(?<projectName>[^/]+)/repositories/(?<repoName>[^/]+)" +
144143
"/delete/revisions/(?<revision>[^/]+)(?<path>/.*$)")
145144
@RequiresWritePermission
146-
public HttpResponse deleteFile(@Param("projectName") String projectName,
147-
@Param("repoName") String repoName,
148-
@Param("revision") String revision,
149-
@Param("path") String path,
145+
public HttpResponse deleteFile(@Param String projectName,
146+
@Param String repoName,
147+
@Param String revision,
148+
@Param String path,
150149
AggregatedHttpRequest request,
151150
ServiceRequestContext ctx) {
152151
final CommitMessageDto commitMessage;
@@ -171,14 +170,14 @@ public HttpResponse deleteFile(@Param("projectName") String projectName,
171170
*/
172171
@Get("regex:/projects/(?<projectName>[^/]+)/repositories/(?<repoName>[^/]+)" +
173172
"/history(?<path>/.*$)")
174-
public CompletionStage<List<CommitDto>> getHistory(@Param("projectName") String projectName,
175-
@Param("repoName") String repoName,
176-
@Param("path") String path,
177-
@Param("from") Optional<String> from,
178-
@Param("to") Optional<String> to) {
173+
public CompletionStage<List<CommitDto>> getHistory(@Param String projectName,
174+
@Param String repoName,
175+
@Param String path,
176+
@Param @Default("-1") String from,
177+
@Param @Default("1") String to) {
179178
return projectManager().get(projectName).repos().get(repoName)
180-
.history(new Revision(from.orElse("-1")),
181-
new Revision(to.orElse("1")),
179+
.history(new Revision(from),
180+
new Revision(to),
182181
path + "**")
183182
.thenApply(commits -> commits.stream()
184183
.map(DtoConverter::convert)
@@ -190,10 +189,10 @@ public CompletionStage<List<CommitDto>> getHistory(@Param("projectName") String
190189
* Finds the files matched by {@code term}.
191190
*/
192191
@Get("/projects/{projectName}/repositories/{repoName}/search/revisions/{revision}")
193-
public CompletionStage<List<EntryDto>> search(@Param("projectName") String projectName,
194-
@Param("repoName") String repoName,
195-
@Param("revision") String revision,
196-
@Param("term") String term) {
192+
public CompletionStage<List<EntryDto>> search(@Param String projectName,
193+
@Param String repoName,
194+
@Param String revision,
195+
@Param String term) {
197196
return projectManager().get(projectName).repos().get(repoName)
198197
.find(new Revision(revision), normalizeSearchTerm(term), FIND_ALL_WITH_CONTENT)
199198
.thenApply(entries -> entries.values().stream()
@@ -207,11 +206,11 @@ public CompletionStage<List<EntryDto>> search(@Param("projectName") String proje
207206
*/
208207
@Get("regex:/projects/(?<projectName>[^/]+)/repositories/(?<repoName>[^/]+)" +
209208
"/diff(?<path>/.*$)")
210-
public CompletionStage<List<ChangeDto>> getDiff(@Param("projectName") String projectName,
211-
@Param("repoName") String repoName,
212-
@Param("path") String path,
213-
@Param("from") String from,
214-
@Param("to") String to) {
209+
public CompletionStage<List<ChangeDto>> getDiff(@Param String projectName,
210+
@Param String repoName,
211+
@Param String path,
212+
@Param String from,
213+
@Param String to) {
215214
return projectManager().get(projectName).repos().get(repoName)
216215
.diff(new Revision(from), new Revision(to), path)
217216
.thenApply(changeMap -> changeMap.values().stream()

0 commit comments

Comments
 (0)