Skip to content

Commit

Permalink
Merge branch 'main' into k8s_service
Browse files Browse the repository at this point in the history
  • Loading branch information
minwoox committed Aug 8, 2024
2 parents 4bd8f71 + d11d34f commit d68fbe6
Show file tree
Hide file tree
Showing 310 changed files with 31,078 additions and 15,766 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- main
- "**"
tags-ignore:
# The release versions will be verified by 'publish-release.yml'
- centraldogma-*
Expand Down
25 changes: 22 additions & 3 deletions .github/workflows/update-armeria-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,38 @@ on:
type: string

jobs:
update-armeria-version:

wait-for-armeria-artifacts:
runs-on: ubuntu-latest
strategy:
matrix:
artifact:
- armeria
- armeria-bom
- armeria-grpc
- armeria-junit5
- armeria-prometheus1
- armeria-saml
- armeria-thrift0.9
- armeria-xds

steps:
- uses: actions/checkout@v3

- name: Wait for Armeria artifacts to be available
uses: nev7n/wait_for_response@v1
with:
url: "https://repo.maven.apache.org/maven2/com/linecorp/armeria/armeria-bom/${{ inputs.armeria_version }}/armeria-bom-${{ inputs.armeria_version }}.pom"
url: "https://repo.maven.apache.org/maven2/com/linecorp/armeria/${{ matrix.artifact }}/${{ github.event.inputs.armeria_version }}/${{ matrix.artifact }}-${{ github.event.inputs.armeria_version }}.${{ matrix.artifact == 'armeria-bom' && 'pom' || 'jar' }}"
responseCode: 200
timeout: 18000000 # Timeout before giving up in milliseconds. 5 hours
interval: 60000 # 1 minute

update-armeria-version:
needs: [ wait-for-armeria-artifacts ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Update Armeria version to ${{ inputs.armeria_version }}
run: |
sed -i "s/armeria = \".*\"/armeria = \"${{ inputs.armeria_version }}\"/" dependencies.toml
Expand All @@ -40,7 +59,7 @@ jobs:
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
title: Update Armeria version to ${{ inputs.armeria_version }}
body : ''
body: ''
commit-message: Update Armeria version to ${{ inputs.armeria_version }}
author: Meri Kim <dl_armeria@linecorp.com>
branch: update-armeria-version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ typings/

# dotenv environment variables file
.env
.env*.local

# next.js build output
.next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public <T> T get(T defaultValue, Class<T> beanType, Consumer<T> changeListener,
throw ex;
}
}
final long elapsedMillis = System.nanoTime() - t0;
final long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t0);
logger.debug("Initial value of {} obtained in {} ms: rev={}",
settings, elapsedMillis, latest.revision());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 LINE Corporation
* Copyright 2024 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
Expand All @@ -14,7 +14,7 @@
* under the License.
*/

package com.linecorp.centraldogma.server.metadata;
package com.linecorp.centraldogma.common;

import static java.util.Objects.requireNonNull;

Expand All @@ -24,7 +24,7 @@
import com.linecorp.centraldogma.internal.Jackson;

/**
* Roles of a {@link User} in a project.
* Roles of a user in a project.
*/
public enum ProjectRole {
OWNER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,58 @@

import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;

import com.linecorp.centraldogma.common.Author;
import com.linecorp.centraldogma.common.ProjectRole;

@JsonInclude(Include.NON_NULL)
public class ProjectDto {

private final String name;

@Nullable
private Author creator;

@Nullable
private String url;

private String reposUrl;
@Nullable
private ProjectRole userRole;

@Nullable
private String createdAt;

public ProjectDto(String name) {
this.name = requireNonNull(name, "name");
}

public ProjectDto(String name, Author creator, long creationTimeMillis) {
@VisibleForTesting
@JsonCreator
public ProjectDto(@JsonProperty("name") String name,
@JsonProperty("creator") @Nullable Author creator,
@JsonProperty("url") @Nullable String url,
@JsonProperty("userRole") @Nullable ProjectRole userRole,
@JsonProperty("createdAt") @Nullable String createdAt) {
this.name = requireNonNull(name, "name");
this.creator = creator;
this.url = url;
this.userRole = userRole;
this.createdAt = createdAt;
}

public ProjectDto(String name, Author creator, ProjectRole userRole, long creationTimeMillis) {
this.name = requireNonNull(name, "name");
this.creator = requireNonNull(creator, "creator");
createdAt = ISO_INSTANT.format(Instant.ofEpochMilli(creationTimeMillis));
url = PROJECTS_PREFIX + '/' + name;
this.userRole = requireNonNull(userRole, "userRole");
}

@JsonProperty("name")
Expand All @@ -74,9 +96,9 @@ public String url() {
}

@Nullable
@JsonProperty("reposUrl")
public String reposUrl() {
return reposUrl;
@JsonProperty("userRole")
public ProjectRole userRole() {
return userRole;
}

@Nullable
Expand Down
2 changes: 1 addition & 1 deletion dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# If its classes are exposed in Javadoc, update offline links as well.
#
[versions]
armeria = "1.29.2"
armeria = "1.29.4"
assertj = "3.26.0"
awaitility = "4.2.1"
bouncycastle = "1.78.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.linecorp.centraldogma
version=0.67.1-SNAPSHOT
version=0.68.1-SNAPSHOT
projectName=Central Dogma
projectUrl=https://line.github.io/centraldogma/
projectDescription=Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.linecorp.centraldogma.server.MirroringService;
import com.linecorp.centraldogma.server.internal.mirror.MirrorState;
import com.linecorp.centraldogma.server.mirror.MirrorDirection;
import com.linecorp.centraldogma.server.mirror.MirroringServicePluginConfig;
import com.linecorp.centraldogma.server.storage.project.Project;
import com.linecorp.centraldogma.testing.internal.TestUtil;
import com.linecorp.centraldogma.testing.junit.CentralDogmaExtension;
Expand All @@ -72,7 +73,7 @@ protected boolean runForEachTest() {
static final CentralDogmaExtension dogma = new CentralDogmaExtension() {
@Override
protected void configure(CentralDogmaBuilder builder) {
builder.mirroringEnabled(true);
builder.pluginConfigs(new MirroringServicePluginConfig(true));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.linecorp.centraldogma.server.CentralDogmaBuilder;
import com.linecorp.centraldogma.server.MirroringService;
import com.linecorp.centraldogma.server.internal.storage.repository.DefaultMetaRepository;
import com.linecorp.centraldogma.server.mirror.MirroringServicePluginConfig;
import com.linecorp.centraldogma.server.storage.project.Project;
import com.linecorp.centraldogma.testing.junit.CentralDogmaExtension;

Expand All @@ -50,7 +51,7 @@ class GitMirrorAuthTest {
static final CentralDogmaExtension dogma = new CentralDogmaExtension() {
@Override
protected void configure(CentralDogmaBuilder builder) {
builder.mirroringEnabled(true);
builder.pluginConfigs(new MirroringServicePluginConfig(true));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import com.linecorp.centraldogma.server.MirrorException;
import com.linecorp.centraldogma.server.MirroringService;
import com.linecorp.centraldogma.server.internal.JGitUtil;
import com.linecorp.centraldogma.server.mirror.MirroringServicePluginConfig;
import com.linecorp.centraldogma.server.storage.project.Project;
import com.linecorp.centraldogma.testing.internal.TemporaryFolderExtension;
import com.linecorp.centraldogma.testing.internal.TestUtil;
Expand All @@ -85,9 +86,7 @@ class GitMirrorIntegrationTest {
static final CentralDogmaExtension dogma = new CentralDogmaExtension() {
@Override
protected void configure(CentralDogmaBuilder builder) {
builder.mirroringEnabled(true);
builder.maxNumFilesPerMirror(MAX_NUM_FILES);
builder.maxNumBytesPerMirror(MAX_NUM_BYTES);
builder.pluginConfigs(new MirroringServicePluginConfig(true, 1, MAX_NUM_FILES, MAX_NUM_BYTES));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import com.linecorp.centraldogma.server.MirroringService;
import com.linecorp.centraldogma.server.internal.mirror.MirrorState;
import com.linecorp.centraldogma.server.mirror.MirrorDirection;
import com.linecorp.centraldogma.server.mirror.MirroringServicePluginConfig;
import com.linecorp.centraldogma.server.storage.project.Project;
import com.linecorp.centraldogma.testing.internal.TestUtil;
import com.linecorp.centraldogma.testing.junit.CentralDogmaExtension;
Expand All @@ -78,9 +79,7 @@ class LocalToRemoteGitMirrorTest {
static final CentralDogmaExtension dogma = new CentralDogmaExtension() {
@Override
protected void configure(CentralDogmaBuilder builder) {
builder.mirroringEnabled(true);
builder.maxNumFilesPerMirror(MAX_NUM_FILES);
builder.maxNumBytesPerMirror(MAX_NUM_BYTES);
builder.pluginConfigs(new MirroringServicePluginConfig(true, 1, MAX_NUM_FILES, MAX_NUM_BYTES));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import com.linecorp.centraldogma.server.ZooKeeperReplicationConfig;
import com.linecorp.centraldogma.server.ZooKeeperServerConfig;
import com.linecorp.centraldogma.server.auth.AuthProviderFactory;
import com.linecorp.centraldogma.server.mirror.MirroringServicePluginConfig;
import com.linecorp.centraldogma.testing.internal.FlakyTest;
import com.linecorp.centraldogma.testing.internal.TemporaryFolderExtension;
import com.linecorp.centraldogma.testing.internal.auth.TestAuthMessageUtil;
Expand Down Expand Up @@ -131,7 +132,7 @@ private static CompletableFuture<Void> startNewReplica(
.port(port, SessionProtocol.HTTP)
.administrators(TestAuthMessageUtil.USERNAME)
.authProviderFactory(factory)
.mirroringEnabled(false)
.pluginConfigs(new MirroringServicePluginConfig(false))
.writeQuotaPerRepository(5, 1)
.gracefulShutdownTimeout(new GracefulShutdownTimeout(0, 0))
.replication(new ZooKeeperReplicationConfig(serverId, servers))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ public CompletionStage<Void> start(PluginContext context) {
public CompletionStage<Void> stop(PluginContext context) {
return UnmodifiableFuture.completedFuture(null);
}

@Override
public Class<?> configType() {
// Return the plugin class itself because it does not have a configuration.
return TestAllReplicasPlugin.class;
}
}
30 changes: 0 additions & 30 deletions server-auth/webapp/build.gradle

This file was deleted.

Loading

0 comments on commit d68fbe6

Please sign in to comment.