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

Fix history displays irrelevant changes #922

Closed
wants to merge 5 commits into from
Closed
Changes from 2 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 @@ -177,10 +177,11 @@ public CompletionStage<List<CommitDto>> getHistory(@Param String projectName,
@Param String path,
@Param @Default("-1") String from,
@Param @Default("1") String to) {
final String pathPattern = "/".equals(path) ? "/**" : path + "/**";
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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 🚀

return projectApiManager.getProject(projectName).repos().get(repoName)
.history(new Revision(from),
new Revision(to),
path + "**")
pathPattern)
.thenApply(commits -> commits.stream()
.map(DtoConverter::convert)
.collect(toList()));
Expand Down
Loading