-
Notifications
You must be signed in to change notification settings - Fork 119
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
Fix history displays irrelevant changes #922
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||
package com.linecorp.centraldogma.server.internal.admin.service; | ||||||
|
||||||
import com.fasterxml.jackson.databind.JsonNode; | ||||||
import com.linecorp.armeria.client.WebClient; | ||||||
import com.linecorp.armeria.client.WebClientBuilder; | ||||||
import com.linecorp.armeria.common.AggregatedHttpResponse; | ||||||
import com.linecorp.armeria.common.HttpHeaderNames; | ||||||
import com.linecorp.centraldogma.internal.Jackson; | ||||||
import com.linecorp.centraldogma.testing.junit.CentralDogmaExtension; | ||||||
import com.linecorp.centraldogma.testing.junit4.CentralDogmaRule; | ||||||
import org.junit.ClassRule; | ||||||
import org.junit.jupiter.api.Test; | ||||||
import org.junit.jupiter.api.extension.RegisterExtension; | ||||||
|
||||||
import java.io.IOException; | ||||||
|
||||||
import static org.assertj.core.api.Assertions.*; | ||||||
|
||||||
class RepositoryServiceTest { | ||||||
|
||||||
@RegisterExtension | ||||||
static final CentralDogmaExtension dogma = new CentralDogmaExtension() { | ||||||
@Override | ||||||
protected void configureHttpClient(WebClientBuilder builder) { | ||||||
builder.addHeader(HttpHeaderNames.AUTHORIZATION, "Bearer anonymous"); | ||||||
} | ||||||
}; | ||||||
|
||||||
@Test | ||||||
void getUsersInfo() throws IOException { | ||||||
final WebClient client = dogma.httpClient(); | ||||||
final AggregatedHttpResponse userInfo = client.get("/api/v0/users/me").aggregate().join(); | ||||||
final JsonNode jsonNode = Jackson.readTree(userInfo.contentUtf8()); | ||||||
assertThat(jsonNode.get("login").asText()).isEqualTo("[email protected]"); | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @minwoox here, I try to add tests for the class RepositoryServiceTest, but it always returns 404 for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's activated only when the centraldogma/server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java Line 782 in c7450c5
Line 69 in 7152873
By the way, could you tell me why you need to retrieve the user information? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @minwoox, I can call |
||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other APIs we have (e.g. watch*, diff*) don't add a
slash
at the end.For consistency, I think it would be better that all APIs that accept a
pathPattern
have the same behavior.Also, I think it is perfectly valid to watch
/a**
depending on the use-case.Question) What do you think of fixing this issue from the client side instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jrhee17, about fixing this issue from the client side, do you mean we receive the list result from the client and filter?
From my side, it is not good to do logic on the client side.
@minwoox How do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the late reply. Yeah, I also thought we should fix the UI (which is the client) to call the path correctly when I first created the issue.
We should let users retrieve whatever history they want so I think we should touch it on the server-side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound good @minwoox, could you provide me the screenshot to explain expected from client? I am happy to finish this 🚀