-
Notifications
You must be signed in to change notification settings - Fork 25
bugfix(git_utils): Use the git_url_map from params #1078
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reviewer's GuideRefactor git_utils to accept index-to-git URL mappings via parameters instead of worker config, propagate this mapping through build tasks, and update tests accordingly. Flow diagram for passing index_repo_map through build to git_utilsflowchart TD
A[handle_add_request / handle_rm_request] --> B[_update_index_image_pull_spec]
B --> C[_overwrite_from_index]
C --> D[push_configs_to_git]
C --> E[revert_last_commit]
D --> F[resolve_git_url]
E --> F
subgraph "Parameter propagation"
A -- index_repo_map --> B
B -- index_repo_map --> C
C -- index_repo_map --> D
C -- index_repo_map --> E
D -- index_repo_map --> F
E -- index_repo_map --> F
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @JAVGan - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `iib/workers/tasks/build.py:258` </location>
<code_context>
resolved_prebuild_from_index: Optional[str] = None,
add_or_rm: bool = False,
is_image_fbc: bool = False,
+ index_repo_map: Dict[str, str] = {},
) -> None:
"""
</code_context>
<issue_to_address>
Avoid using a mutable default argument for index_repo_map.
Use None as the default value and initialize the dict within the function to prevent shared state across calls.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This commit changes the `git_utils.py` to receive the index image to git URL mapping as a parameter, since this value isn't stored on IIB workers config. It also adjusts the methods `handle_[add|rm]_request` from `build.py` to pass the index to git url mappings as parameter for the lower functions. Refers to CLOUDDST-28805 Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
nmars
approved these changes
Jul 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit changes the
git_utils.pyto receive the index image to git URL mapping as a parameter, since this value isn't stored on IIB workers config.It also adjusts the methods
handle_[add|rm]_requestfrombuild.pyto pass the index to git url mappings as parameter for the lower functions.Refers to CLOUDDST-28805
Summary by Sourcery
Fix git_utils to accept the index image-to-Git URL mapping as an explicit parameter and propagate this mapping through the build task functions, updating tests to match the new API.
Bug Fixes:
Enhancements:
Tests: