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 gh repository #1

Merged
merged 6 commits into from
Jul 6, 2024
Merged

feat: add gh repository #1

merged 6 commits into from
Jul 6, 2024

Conversation

amalhanaja
Copy link
Owner

@amalhanaja amalhanaja commented Jun 29, 2024

TEst

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

Copy link
Owner Author

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.

@amalhanaja amalhanaja merged commit 4c313d0 into main Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant