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

[#2196] Use git blame line info for aggregate blame author modified and date info #2232

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

logical-1985516
Copy link
Contributor

@logical-1985516 logical-1985516 commented Jul 3, 2024

Fixes #2196

Proposed commit message

Uses blameLine to abstract away the string wrangling and improve
understandability. Magic numbers are also replaced to improve code
quality.

In order to use blameLine however, it is also changed to use 
author-time instead of commit-time, as there is a discrepancy
between the two, causing some test cases to fail.

The naming of the timestamp field in GitBlameLineInfo is changed
to reflect that it is in seconds, as author-time is in seconds.

Other information

Surrounding code which states milliseconds is also changed to state seconds correctly, as this PR is meant to resolve a code quality issue anyways. If this is not ok, I can revert the last commit.

@github-actions github-actions bot requested a deployment to dashboard-2232 July 3, 2024 16:29 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 3, 2024 16:29 Abandoned
@ckcherry23 ckcherry23 requested a review from a team July 3, 2024 16:54
@logical-1985516 logical-1985516 changed the title 2196 use git blame line info for aggregate blame author modified and date info [#2196] Use git blame line info for aggregate blame author modified and date info Jul 4, 2024
@github-actions github-actions bot requested a deployment to dashboard-2232 July 6, 2024 08:05 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 6, 2024 08:05 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2232 July 6, 2024 15:34 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 6, 2024 15:34 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2232 July 6, 2024 15:40 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 6, 2024 15:40 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2232 July 6, 2024 15:54 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 6, 2024 15:54 Abandoned
@logical-1985516
Copy link
Contributor Author

logical-1985516 commented Jul 7, 2024

Hi, I have noticed that some test cases take a very long time to finish. Could this be due to the additional overhead incurred from running git blame command in blameLine?

@github-actions github-actions bot requested a deployment to dashboard-2232 July 14, 2024 15:56 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 July 14, 2024 15:56 Abandoned
@logical-1985516
Copy link
Contributor Author

Hi, would anyone like to approve the workflow? I am not sure why the local test cases run indefinitely, so I am unable to verify that it passes all test cases. Thank you!

@damithc
Copy link
Collaborator

damithc commented Jul 15, 2024

Hi, would anyone like to approve the workflow? I am not sure why the local test cases run indefinitely, so I am unable to verify that it passes all test cases. Thank you!

done

@logical-1985516
Copy link
Contributor Author

Hi, would anyone like to help me for this issue? I could not seem to figure why the test cases are failing. More information at this discussion.

src/main/java/reposense/git/GitBlame.java Outdated Show resolved Hide resolved
src/main/java/reposense/git/GitBlame.java Outdated Show resolved Hide resolved
This is because blameFile already uses split to return String[]. This
change allows the removal of the awkward String wrangling in blameFile.

The split function in processGitBlameResultLine has been moved to
blameLine as a result.
…iedAndDateInfo' of https://github.com/logical-1985516/RepoSense into 2196-use-GitBlameLineInfo-for-aggregateBlameAuthorModifiedAndDateInfo
@github-actions github-actions bot requested a deployment to dashboard-2232 August 10, 2024 04:53 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 August 10, 2024 04:53 Abandoned
@github-actions github-actions bot requested a deployment to dashboard-2232 August 10, 2024 04:53 Abandoned
@github-actions github-actions bot requested a deployment to docs-2232 August 10, 2024 04:53 Abandoned
Copy link
Contributor

@gok99 gok99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! Should be good to go after the final few comments are addressed.

*/
private static GitBlameLineInfo processGitBlameResultLine(String blameResult) {
String[] blameResultLines = StringsUtil.NEWLINE.split(blameResult);
private static GitBlameLineInfo processGitBlameResultLine(String[] blameResultLines, String timeOption) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to use a boolean for timeOption since it doesn't seem like there are likely to be new options in git in the future.

@@ -5,6 +5,9 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add / update tests for functions / flags you've added here?

Copy link
Contributor

Hi,
We are going to mark this PR as stale because it has been inactive for the past 30 days.
If no further activity occurs within the following 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 7 days and leave a comment to remove the stale label.
Do let us know if you are stuck so that we can help you!'

@github-actions github-actions bot added the Stale label Sep 14, 2024
Copy link
Contributor

This PR was closed because it has been marked as stale for 7 days with no activity.
Feel free to reopen this PR if you would like to continue working on it.

@gok99
Copy link
Contributor

gok99 commented Sep 21, 2024

@logical-1985516 Are you planning to wrap up this PR and #2238? I think this PR is mostly good to merge and is just pending some updates to tests.

@logical-1985516
Copy link
Contributor Author

Hi @gok99, for this PR, I may be able to wrap up this PR within next week, if I have the time.
However, I probably would not wrap up PR #2238. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use GitBlameLineInfo for processing git blame output in aggregateBlameAuthorModifiedAndDateInfo
4 participants