Skip to content

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Sep 7, 2025

This PR migrates some of the tests that we had testing the full
extension parsing to just test the hub builder.

I ran out of time to migrate everything and there is a little bit of
copy pasted code. The goal is to make the assertions easier to
understand because the nesting of the dictionaries will be not as large.

Later we can add tests that are testing individual hub_builder
methods, which will be needed when we start implementing the
pip.configure tag class or we implement a py.lock parsing.

Work towards #2747

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.

Summary of Changes

Hello @aignas, 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 significantly refactors the testing infrastructure by migrating existing integration tests to specifically target the hub_builder component. The primary goal is to enhance the clarity and maintainability of the test suite by simplifying assertions and creating a more focused testing environment for the hub_builder. This change lays the groundwork for more granular testing of specific hub_builder methods in the future, addressing part of the work towards issue #2747.

Highlights

  • Test Refactoring: Migrated several existing integration tests from extension_tests.bzl to a new dedicated hub_builder_tests.bzl file. This shifts the testing focus from full extension parsing to the hub_builder component.
  • Improved Test Clarity: The refactoring aims to simplify test assertions by reducing the nesting of dictionaries, making the tests easier to understand and maintain.
  • New Test Suite for Hub Builder: Introduced a new BUILD.bazel file and hub_builder_tests.bzl to house tests specifically for the hub_builder functionality, providing a more modular testing structure.
  • Partial Migration: Note that not all relevant tests have been migrated in this pull request, and some copy-pasted code exists, with further migration planned for future work.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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

@aignas aignas force-pushed the aignas.feat.builder-api-pip-configure branch from d40dbef to ea0cc1f Compare September 7, 2025 04:17
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 PR is a great step towards simplifying the tests by migrating them to use hub_builder directly. The new tests in hub_builder_tests.bzl are much clearer and easier to follow. I've left a few suggestions to further improve the new test helpers and reduce code duplication. Overall, this is a solid refactoring.

@aignas
Copy link
Collaborator Author

aignas commented Sep 8, 2025

/gemini review

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 is a solid refactoring that migrates tests from using the full pypi.extension to the more focused hub_builder. This simplifies the test setup and improves maintainability, as intended. The extraction of the platform function and the pip_parse test helper into separate files is a great cleanup. My review includes a few suggestions to further improve the new test suite's structure and points out a potential bug captured by one of the new tests.

aignas and others added 2 commits September 8, 2025 17:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@aignas aignas enabled auto-merge September 8, 2025 08:18
@aignas aignas added this pull request to the merge queue Sep 8, 2025
Merged via the queue into bazel-contrib:main with commit 9ba8c12 Sep 8, 2025
4 checks passed
@aignas aignas deleted the aignas.feat.builder-api-pip-configure branch September 8, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants