-
Notifications
You must be signed in to change notification settings - Fork 1
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 gh repository #1
Conversation
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.
This commit adds a new dependency, go.uber.org/goleak
, to the project. This dependency is used to detect potential memory leaks in Go code. You can find more information about it here: https://pkg.go.dev/go.uber.org/goleak. It is important to make sure that you are not introducing any new vulnerabilities by adding this dependency. You should review the source code of the dependency, as well as any associated documentation, to make sure that you are comfortable with the security implications of adding it. If you have any concerns, please ask the author of this commit for more information.
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.
This commit adds a new dependency, go.uber.org/goleak
, to the project. This dependency is used to detect potential memory leaks in Go code. You can find more information about it here: https://pkg.go.dev/go.uber.org/goleak. It is important to make sure that you are not introducing any new vulnerabilities by adding this dependency. You should review the source code of the dependency, as well as any associated documentation, to make sure that you are comfortable with the security implications of adding it. If you have any concerns, please ask the author of this commit for more information.
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.
This commit adds a new case to the NewRepository
function. This case allows the function to create a new repository instance for GitHub. The new code is well-formatted and follows the existing style of the codebase. You can find more information about GitHub's API here: https://docs.github.com/en/rest.
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.
This commit changes the type of the httpClient
field from http.Client
to *http.Client
. This change is necessary because the http.Client
type is not a pointer. The &
operator is used to create a pointer to the http.Client
object. This change is made to ensure that the httpClient
field is initialized with a valid pointer to an http.Client
object.
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.
This commit adds a new file, client.go
, to the project. This file contains the implementation of the github
client, which is used to interact with the GitHub API. The code is well-formatted and follows the existing style of the codebase. You can find more information about GitHub's API here: https://docs.github.com/en/rest.
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.
This commit adds a new file, get_pull_request.go
, to the project. This file contains the implementation of the GetPullRequest
function, which is used to retrieve a pull request from GitHub. The code is well-formatted and follows the existing style of the codebase. You can find more information about GitHub's API here: https://docs.github.com/en/rest.
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.
This commit adds a new file, helper.go
, to the project. This file contains helper functions for the github
client. The code is well-formatted and follows the existing style of the codebase. You can find more information about GitHub's API here: https://docs.github.com/en/rest.
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.
This commit adds a new file, payload.go
, to the project. This file contains the data structures for the GitHub API payloads. The code is well-formatted and follows the existing style of the codebase. You can find more information about GitHub's API here: https://docs.github.com/en/rest.
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.
This commit adds new dependencies to the project, which are not needed for this PR, consider removing unused libraries.
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.
This commit adds new dependencies to the project, which are not needed for this PR, consider removing unused libraries.
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.
This commit adds a new github
repository provider, which is great. However, consider moving the implementation details of each provider to a separate file for better organization and maintainability.
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 http.Client
is initialized with its default values, consider setting timeout and other options in the constructor.
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 PostPullRequestComment
function doesn't implement the actual logic of posting a comment. Consider adding the implementation.
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.
This commit adds the logic for fetching the pull request data from GitHub API. Consider adding tests to ensure its functionality and robustness.
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 getBaseUrl
function can be refactored into a constant for better readability and maintainability.
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.
Consider adding documentation to the PullRequestResponse
struct to clarify the purpose of each field.
TEst