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

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

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.
diegomarquezp pushed a commit that referenced this pull request May 31, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.41.0</summary>

##
[2.41.0](v2.40.1...v2.41.0)
(2024-05-31)


### Features

* add a github client
([#2747](#2747))
([f8ea0a0](f8ea0a0))
* generate proto-only repository
([#2720](#2720))
([f7a5161](f7a5161))


### Bug Fixes

* [#2785](#2785).
([599f5da](599f5da))


### Dependencies

* update dependency com.google.api-client:google-api-client-bom to
v2.6.0
([#2782](#2782))
([5bc8928](5bc8928))
* update dependency
com.google.cloud.opentelemetry:detector-resources-support to v0.29.0
([#2831](#2831))
([6c1dbfc](6c1dbfc))
* update dependency com.google.code.gson:gson to v2.11.0
([#2786](#2786))
([91f3254](91f3254))
* update dependency com.google.code.gson:gson to v2.11.0
([#2787](#2787))
([e81893c](e81893c))
* update dependency com.google.errorprone:error_prone_annotations to
v2.28.0
([#2835](#2835))
([b8f11b1](b8f11b1))
* update dependency com.google.errorprone:error_prone_annotations to
v2.28.0
([#2838](#2838))
([5c46f3f](5c46f3f))
* update dependency net.bytebuddy:byte-buddy to v1.14.16
([#2797](#2797))
([dfedafc](dfedafc))
* update dependency net.bytebuddy:byte-buddy to v1.14.17
([#2828](#2828))
([6eb9041](6eb9041))
* update dependency org.checkerframework:checker-qual to v3.43.0
([#2730](#2730))
([b7fa736](b7fa736))
* update dependency requests to v2.32.0 [security]
([#2791](#2791))
([c2ea6cc](c2ea6cc))
* update dependency watchdog to v4.0.1
([#2800](#2800))
([d5771dd](d5771dd))
* update google api dependencies
([#2672](#2672))
([6643536](6643536))
* update google http client dependencies to v1.44.2
([#2783](#2783))
([dee7e00](dee7e00))
* update googleapis/java-cloud-bom digest to 59c776b
([#2827](#2827))
([03b3eb4](03b3eb4))
* update netty dependencies to v4.1.110.final
([#2796](#2796))
([d1aaa68](d1aaa68))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request Jun 10, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.41.0</summary>

##
[2.41.0](v2.40.1...v2.41.0)
(2024-05-31)


### Features

* add a github client
([#2747](#2747))
([f8ea0a0](f8ea0a0))
* generate proto-only repository
([#2720](#2720))
([f7a5161](f7a5161))


### Bug Fixes

* [#2785](#2785).
([599f5da](599f5da))


### Dependencies

* update dependency com.google.api-client:google-api-client-bom to
v2.6.0
([#2782](#2782))
([5bc8928](5bc8928))
* update dependency
com.google.cloud.opentelemetry:detector-resources-support to v0.29.0
([#2831](#2831))
([6c1dbfc](6c1dbfc))
* update dependency com.google.code.gson:gson to v2.11.0
([#2786](#2786))
([91f3254](91f3254))
* update dependency com.google.code.gson:gson to v2.11.0
([#2787](#2787))
([e81893c](e81893c))
* update dependency com.google.errorprone:error_prone_annotations to
v2.28.0
([#2835](#2835))
([b8f11b1](b8f11b1))
* update dependency com.google.errorprone:error_prone_annotations to
v2.28.0
([#2838](#2838))
([5c46f3f](5c46f3f))
* update dependency net.bytebuddy:byte-buddy to v1.14.16
([#2797](#2797))
([dfedafc](dfedafc))
* update dependency net.bytebuddy:byte-buddy to v1.14.17
([#2828](#2828))
([6eb9041](6eb9041))
* update dependency org.checkerframework:checker-qual to v3.43.0
([#2730](#2730))
([b7fa736](b7fa736))
* update dependency requests to v2.32.0 [security]
([#2791](#2791))
([c2ea6cc](c2ea6cc))
* update dependency watchdog to v4.0.1
([#2800](#2800))
([d5771dd](d5771dd))
* update google api dependencies
([#2672](#2672))
([6643536](6643536))
* update google http client dependencies to v1.44.2
([#2783](#2783))
([dee7e00](dee7e00))
* update googleapis/java-cloud-bom digest to 59c776b
([#2827](#2827))
([03b3eb4](03b3eb4))
* update netty dependencies to v4.1.110.final
([#2796](#2796))
([d1aaa68](d1aaa68))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.

2 participants