Skip to content

Conversation

@ktdreyer
Copy link
Contributor

@ktdreyer ktdreyer commented Jun 26, 2025

Rename nopull to pull for improved clarity and readability. This avoids the double-negative, making the logic more straightforward to reason about. pull = True now means "pull the image", and pull = False means "don't pull the image."

Summary by Sourcery

Rename the nopull flag to pull in the accel_image function and update its default and logic checks, along with adjusting the CLI argument to use the new flag name.

Enhancements:

  • Rename nopull parameter to pull in accel_image and invert its default value for clearer semantics
  • Update conditional logic to use pull instead of double-negative nopull checks
  • Adjust CLI argument default to reflect the renamed pull flag and its inverted default

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 26, 2025

Reviewer's Guide

This PR refactors the image-pulling flag from a negative nopull to a positive pull, flips its default and inverts corresponding conditionals, and updates the CLI invocation to preserve existing behavior under the new parameter.

Class diagram for updated accel_image function signature and usage

classDiagram
    class accel_image {
        +str accel_image(config: Config, pull: bool = True)
    }
    class Config
    accel_image --> Config : uses
Loading

Flow diagram for logic inversion in accel_image pull flag

flowchart TD
    A[Start] --> B{pull is True?}
    B -- Yes --> C[attempt_to_use_versioned returns True?]
    C -- Yes --> D[Return image:vers]
    C -- No --> E[Return image:latest]
    B -- No --> D
Loading

File-Level Changes

Change Details Files
Refactor accel_image parameter from negative to positive flag
  • Rename function parameter nopull to pull
  • Change default value from False to True
  • Invert conditional logic (if not pull replaces if nopull)
ramalama/common.py
Adjust CLI default argument to use new pull flag
  • Replace nopull=True with pull=False in parser setup
ramalama/cli.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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 @ktdreyer, 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 implements a refactoring change to enhance code readability and maintainability by renaming a boolean parameter. The core change involves transforming a double-negative parameter into a positive one, making the logic more intuitive and straightforward to comprehend.

Highlights

  • Parameter Renaming: Renamed the nopull boolean parameter to pull in the accel_image function for improved clarity and to eliminate a double-negative. This means pull=True now explicitly indicates an image pull, and pull=False indicates no pull.
  • Logic Inversion and Call Site Updates: Updated all call sites of accel_image (e.g., in ramalama/cli.py) and internal conditional logic within accel_image (in ramalama/common.py) to reflect the new parameter name and its inverted meaning. For instance, nopull=True was changed to pull=False, and if nopull was changed to if not pull.
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 is currently in preview and 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 to provide feedback.

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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ktdreyer - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

The pull request renames the nopull boolean to pull for improved clarity. The changes involve updating the default value and logic checks in the accel_image function, as well as adjusting the CLI argument. The feedback provided aims to improve code readability and maintainability by adding comments and explanations for the changes.

@rhatdan
Copy link
Member

rhatdan commented Jun 26, 2025

Thanks @ktdreyer
LGTM
But you need to sign your commits.

Rename "nopull" to "pull" for improved clarity and readability. This
avoids the double-negative, making the logic more straightforward to
reason about. "pull = True" now means "pull the image", "pull = False"
means "don't pull the image."

Signed-off-by: Ken Dreyer <[email protected]>
@ktdreyer
Copy link
Contributor Author

ktdreyer commented Jun 26, 2025

I've added Signed-off-by.

I hope we can remove the Signed-off-by ceremony and DCO bot requirement soon. We removed it in instructlab/dev-docs#192 recently.

@rhatdan rhatdan merged commit 370f1cc into containers:main Jun 26, 2025
19 of 21 checks passed
@ktdreyer ktdreyer deleted the nopull branch June 26, 2025 20:03
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