Skip to content

Conversation

@az-smartling
Copy link
Contributor

@az-smartling az-smartling commented Dec 3, 2025

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • New Job Entity and Progress Definitions: Introduced new files api/job/ent_job.go and api/job/ent_job_progress.go to define job entity structures, job progress structures, and associated helper functions for converting raw API responses into these structured types.
  • Job API Interface and Implementation Updates: The Job interface in api/job/job.go has been updated to include new methods: GetAllByName for retrieving jobs by name and Progress for fetching job progress. The existing GetJob method was renamed to Get. The underlying httpJob implementation was also updated to support these new functionalities and reflect the API version change from v2 to v3.
  • Refactoring of Job Entity Code: The content of the api/job/job_ent.go file has been moved and integrated into the newly created api/job/ent_job.go file, leading to the removal of the former.
  • Minor Code Formatting: Minor formatting adjustments were made in helpers/sm_file/file_last_modified_request.go and helpers/sm_file/get_file_type_by_extension.go by removing unnecessary blank lines.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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"
Copy link
Contributor

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) {
Copy link
Contributor

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).

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.

3 participants