-
Notifications
You must be signed in to change notification settings - Fork 3
CON-1896 jobs progress #24
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @az-smartling, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the job management capabilities of the API client by introducing new endpoints and data structures for retrieving job progress and filtering jobs by name. It involves a refactoring of existing job entity definitions into a dedicated file and an upgrade of the API version used for job-related operations, providing more comprehensive and organized access to job information. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces new functionality for retrieving job progress and listing jobs by name, along with some code reorganization. The changes look good overall, but I've identified a few critical issues that should be addressed. These include a potential panic due to an index-out-of-range error, and resource leaks combined with incorrect response body handling in new HTTP client methods. I've also provided a suggestion to improve the signature of a new helper function for better idiomatic Go code. Please see the detailed comments for suggestions on how to resolve these issues.
|
|
||
| // GetAllByName gets all jobs of a project by name | ||
| func (h httpJob) GetAllByName(projectID, name string) ([]GetJobResponse, error) { | ||
| reqURL := jobBasePath + projectID + "/jobs" |
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.
Security training reminded me of our bad habits. It would be ideal if you could find a special library that can generate a valid URL path rather than concatenating strings. Let's do it once, and it will make future development easier because we can easily copy and paste best practices.
| } | ||
|
|
||
| // GetAllByName gets all jobs of a project by name | ||
| func (h httpJob) GetAllByName(projectID, name string) ([]GetJobResponse, error) { |
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.
Could you please research how to add validation for input parameters? An example for this specific case: we must check that parameters are not empty and projectID follows specific patterns.
P.S. Well, I do not want to broaden the scope of this ticket/PR. Let's make a Jira ticket for research on how to use a declarative approach for validation (rather than imerative).
Smartling/smartling-cli#95