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

feat: add a github client #2747

Merged
merged 8 commits into from May 16, 2024
Merged

feat: add a github client #2747

merged 8 commits into from May 16, 2024

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented May 7, 2024

In this PR:

  • Add a github client to retrieve pull request status from a repository.
  • Add unit test.

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label May 7, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review May 15, 2024 00:46
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner May 15, 2024 00:46
@JoeWang1127 JoeWang1127 requested a review from suztomo May 15, 2024 00:46
Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

Would you add brief Javadoc for future maintainers?

<version>3.2.5</version>
<configuration>
<environmentVariables>
<GITHUB_TOKEN>fake_value</GITHUB_TOKEN>
Copy link
Member

Choose a reason for hiding this comment

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

Add source code comment how it helps tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

import java.util.List;
import java.util.Objects;

public class GitHubClient {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add Javadoc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -29,7 +29,7 @@
public class DepsDevClient {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add Javadoc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,5 @@
package com.google.cloud.model;

public record PullRequestStatus(long created, long merged, Interval interval) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add Javadoc, especially which part of the dependency report this helps, with an example value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can change the class name to PullRequestStatistics.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels May 16, 2024
@JoeWang1127 JoeWang1127 requested a review from suztomo May 16, 2024 13:51
Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

Can you run the google-java-format formatter?

git diff -U0 origin/main |google-java-format-diff.py -p1 -i

The formatter does not merge multiple lines. Ensure you read the formatted files.

* GitHubClient is a class that sends HTTP requests to the GitHub RESTful API.
* It provides methods for interacting with various GitHub resources such as repositories,
* issues, users, etc.
* <p>
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I formatted the code using

git diff -U0 origin/main | python google-java-format-diff.py -p1 -i

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JoeWang1127 JoeWang1127 merged commit f8ea0a0 into main May 16, 2024
51 checks passed
@JoeWang1127 JoeWang1127 deleted the feat/add-github-client branch May 16, 2024 15:37
lqiu96 pushed a commit that referenced this pull request May 16, 2024
In this PR:
- Add a github client to retrieve pull request status from a repository.
- Add unit test.
lqiu96 pushed a commit that referenced this pull request May 22, 2024
In this PR:
- Add a github client to retrieve pull request status from a repository.
- Add unit test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants