Skip to content

Conversation

@LuisJG8
Copy link
Owner

@LuisJG8 LuisJG8 commented Jan 28, 2026

No description provided.

@LuisJG8 LuisJG8 merged commit 7c2cbe6 into MyProjects Jan 28, 2026
1 check failed
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @LuisJG8, 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 focuses on refining the implementation for testing Celery's chord primitive, particularly in the context of fetching and aggregating GitHub repository data. The changes involve adjusting task parameters for more realistic testing scenarios, importing additional Celery primitives for task orchestration, and cleaning up old, commented-out code to improve clarity.

Highlights

  • Client Cleanup: Removed commented-out, unused code in client.py related to task distribution checks, streamlining the client-side logic.
  • Celery Group Primitive Import: The group primitive was added to the Celery import in worker.py, enabling more flexible task orchestration patterns.
  • GitHub Data Batch Size Adjustment: The batch size limit within the get_github_data function in worker.py was significantly increased from 2 to 500, allowing for larger data fetches per iteration and more efficient API usage.
  • Chord Configuration Update: The build_repo_chord function in worker.py was updated to handle a larger total number of items (5000) and a larger batch size (500) for task distribution, reflecting more realistic use cases.
  • Legacy Task Code Inclusion: A commented-out distribute_tasks function was added to worker.py, serving as a reference to previous attempts at task distribution using group and chord, explicitly marked as 'old code that did not work'.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Contributor

@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 updates the Celery task implementation to use chords for batch processing. The changes are generally good, including cleanup of old code. I have a few suggestions to improve maintainability: one is to remove a newly added but unused experimental function and its related import, and another is to use a function parameter instead of a hardcoded value in a conditional check to make it more robust.

import boto3
import time
from celery import Celery, chord
from celery import Celery, group, chord
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The group import is only used in the distribute_tasks function, which appears to be experimental, unused code. If that function is removed as suggested in another comment, this import will be unused and can also be removed.

Suggested change
from celery import Celery, group, chord
from celery import Celery, chord

remaining = remaining_api_calls[0]

if int(counter) >= int(2):
if int(counter) >= int(500):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The condition for checking the batch size limit uses a hardcoded value 500 and redundant int() casts. It's better to use the batch_size parameter that is passed into the function. This makes the function more robust and easier to maintain. Also, counter is already an integer, so casting it is not necessary.

Suggested change
if int(counter) >= int(500):
if counter >= batch_size:

Comment on lines +188 to +198
# old code that did not work
@app.task
def distribute_tasks():

jobs = group([
get_github_data.s(start, 500)
for start in range(0, 5000, 500)
])

return chord(jobs)()

No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This new task distribute_tasks is commented as "old code that did not work" and doesn't seem to be used anywhere in the project. It's best to remove this dead code to keep the codebase clean and avoid confusion.

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