Repository navigation
Import changes from master to main - #1383
yashvardhannanavati wants to merge 115 commits into
Conversation
Adds allowed_remote_resources with both fullsend-ai/fullsend and fullsend-ai/agents URLs. This is required for the agent extraction migration: agent harnesses are now resolved from fullsend-ai/agents at runtime and the URL must be in the allowlist.
When rm_operators is set, also copy operator packages from the built image into Git. Previously the if/elif/else logic performed only one operation, leaving stale deprecated operator dirs in Git during add requests with deprecations. Signed-off-by: Jan Lipovský <jlipovsk@redhat.com> Assisted-by: Cursor <cursoragent@cursor.com>
Extract operator package names from deprecation_list (user input) and pass them to _update_index_image_pull_spec so Git cleanup runs during overwrite. Uses get_operator_packages_from_deprecation_list instead of deprecation_bundles to avoid manifest-list digest mismatches. Signed-off-by: Jan Lipovský <jlipovsk@redhat.com> Assisted-by: Cursor
Removed the duplicate py12 entry in tox envlist Corrected the gh-actions 3.13 mapping to run on 3.13 Assisted-by: Cursor
Co-authored-by: Yashvardhan Nanavati <yashn@bu.edu> Assisted-by: Gemini, Claude, Cursor [CLOUDDST-28644] [CLOUDDST-28865]
Co-authored-by: Jan Lipovský <jlipovsk@redhat.com> Assisted-by: Claude Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Co-authored-by: Yashvardhan Nanavati <yashn@bu.edu> [CLOUDDST-28644] [CLOUDDST-28865]
Co-authored-by: Yashvardhan Nanavati <yashn@bu.edu> [CLOUDDST-28644] [CLOUDDST-28865]
Co-authored-by: Jan Lipovský <jlipovsk@redhat.com> Assisted-by: Cursor Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Refers to CLOUDDST-28865 Assisted-by: Claude Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Assisted by: Gemini, Claude [CLOUDDST-28644]
Assisted by: Gemini [CLOUDDST-28644]
This will be done in iib-playbooks. [CLOUDDST-28644]
Refers to CLOUDDST-28865 Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu> Assisted-by: Cursor Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
This commit introduces a new function named `validate_bundes_in_parallel` on `containerized_utils` which performs a parallel validation of whether the bundles in a given list are present in the registry. THe function will wait for all the threads to complete by default, but it can return the list of threads for external waiting. Signed-off-by: Jonathan Gangi <jgangi@redhat.com> Assisted-by: Cursor/Gemini
All handler functions perform some common operations like cloning the git repo, fetching index.db, pushing it and creating mrs. This commit extracts those into helper functions to avoid duplication of code. Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu> Assisted-by: Claude Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Refers to CLOUDDST-28866 Assisted-by: Claude Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Refers to CLOUDDST-28866 Assisted-by: Cursor Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
For some older versions like v4.12, OCP has stopped building the binary image for a couple of arches. Index image should follow suite. Include arches in the build metadata so the builder task can build the index image accordingly. Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu> Assisted-by: Cursor
Refers to CLOUDDST-29408 Signed-off-by: Jonathan Gangi <jgangi@redhat.com> Assisted-by: Cursor/Gemini # Conflicts: # iib/workers/tasks/build_merge_index_image.py # and fixing unit tests [jlipovsk]
Update `api_v2` to use the `handle_containerized_merge_request` Refers to CLOUDDST-29408 Signed-off-by: Jonathan Gangi <jgangi@redhat.com> Assisted-by: Cursor/Gemini
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve three correctness issues raised by automated reviewers on the index.db naming / divergent-tag work: 1. remote_branch_exists no longer runs git ls-remote with strict=False, which swallowed network/auth failures as "branch absent" and could misroute a request onto the divergent build path. It now raises on command failure and accepts optional token args so the check works against private repos (auth injected into the URL, kept out of errors). 2. Divergent extraction now sources index.db/configs from the digest-resolved pullspec (from_index_resolved) instead of the mutable tag, so the extracted content matches the image the request already inspected during prebuild and cannot drift if the tag moves. 3. extract_catalog_and_db_from_image only falls back to the labeled db / empty db when the hidden-db path is genuinely absent. A new FileNotFoundInImageError (subclass of IIBError) distinguishes an absent path from a real registry/OCI/layer/tar failure, which now propagates instead of silently degrading to a wrong index.db. Also add clarifying comments: the empty index.db artifact tag is intentionally namespace-agnostic, test_get_artifact_combined_tag intentionally omits the pullspec hash, and drop a misleading :raises IIBError: from get_index_tag's docstring. Additionally, update stale test expectations uncovered by rebasing this work onto the digest-identity base (a4ed53b): test_utils.py carried duplicate copies of the oras_utils pullspec tests still asserting the old {image_name}-{tag} naming without mocking get_image_digest, and test_build_containerized_rm.py mocked containerized_utils._get_name_and_tag_from_pullspec, a symbol the digest-identity refactor removed from that module. Both are test-expectation fixes only; no production code changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Also updates build_containerized_merge.py and build_containerized_regenerate_bundle.py, which call the same push_index_db_artifact/cleanup_on_failure interfaces changed in Task 5/6 but were not enumerated in the task-7 brief; mypy caught the now-invalid call signatures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update the containerized README's cache-naming section and an inline comment to reflect the content-digest identity scheme (replacing the earlier pullspec-hash description). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
extract_catalog_and_db_from_image now extracts only the FBC configs and the
hidden index.db. Drop the labeled-db and synthesised empty-db fallbacks: an
image with no hidden index.db has not been onboarded to the containerized
flow, so the request fails ("no index.db found, onboard the image to build").
pull_index_db_artifact no longer bootstraps index.db from the image on an ORAS
miss. On the normal path a missing digest-keyed artifact fails the request
("no index.db found for the image, onboard the image to build") rather than
silently sourcing content from the image.
Remove the now-dead bootstrap_index_db_from_image helper and unused imports,
add source/destination path logging to aid debugging, and update tests and
the containerized README to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
extract_files_from_image_non_privileged reconstructed the entire root
filesystem with tarfile.extractall to copy out one subpath. That fails on
real UBI/RHEL images: the 'data' filter rejects absolute symlinks
(/etc/alternatives, AbsoluteLinkError), 'tar' rejects escaping symlink
targets (/etc/crypto-policies, OutsideDestinationError), and
'fully_trusted' trips on read-only files overwritten across layers
(/etc/machine-id) -- plus tarfile ignores OCI whiteouts and hardlinks.
Delegate to 'oc image extract' instead, which applies OCI layer/whiteout
semantics correctly, runs unprivileged, and is already installed in the
worker base image and used elsewhere in the repo. The function signature
is unchanged, so callers are unaffected.
'oc' distinguishes files from directories by argument shape and exits 0
extracting nothing when a path is absent, so probe the directory form
('<dir>/*:<dst>') first, then the file form ('<file>:<dst>'), and treat
"nothing extracted" as FileNotFoundInImageError.
Tests rewritten to mock 'oc'/run_cmd instead of tarfile/skopeo internals.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
'oc image extract' unpacks only file entries, so an empty index's /configs (no files) is indistinguishable from an absent path — both raise FileNotFoundInImageError. Rather than guess in the low-level extractor (the reverted dotfile approach), let extract_catalog_and_db_from_image decide: it holds the configs label as the signal that the image declares an FBC root, so it catches FileNotFoundInImageError and uses an empty catalog directory. The hidden index.db remains required and still fails with an onboarding error when absent, regardless of whether /configs is empty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Correctness:
- push_index_db_artifact hardcoded 'idb-<digest>' while the read path in
_get_content_addressed_artifact_tag went through
iib_index_db_artifact_tag_template. Identical under the default, silently
divergent under any site override -- every lookup would miss. Route the
write path through the same template.
- remote_branch_exists passed the bare branch name to 'git ls-remote', which
matches a pattern against the tail of a ref at slash boundaries: 'v4.17'
also matches 'refs/heads/team/v4.17'. A nested branch was reported as the
tag branch, misrouting a divergent-tag request onto the normal path where
the subsequent clone then fails. Pass the fully-qualified ref.
- extract_files_from_image_non_privileged stages with symlinks=True so a link
is never followed against the worker filesystem, but prepare_build_sources
then copies the configs tree with a plain copytree, which resolves it. An
image carrying '/configs/x -> /etc/passwd' would get host content committed
and pushed to GitLab. Reject symlinks escaping the extraction root in
extract_catalog_and_db_from_image, covering both copies, and fail closed
naming the offending path -- an FBC catalog is declarative JSON/YAML, so an
escaping link is not a legitimate shape for an index image to have.
- Chain the exceptions raised on missing index.db so the original traceback
survives for outer handlers.
Config:
- The tag template placeholders changed from {image_name}/{tag} to {digest}
when cache keys became content-addressed. A deployment carrying an override
from the old scheme failed deep inside a build with a bare KeyError;
validate at worker startup and name the setting instead. Only validated
when present, since absence means the class default applies. Documented in
the containerized README.
Cleanup:
- Move run_cmd to the module-level import (no circular-import reason; the
same module is already imported there) and repoint the tests onto
containerized_utils.run_cmd, matching every other mock in that file.
- Rename _get_artifact_combined_tag to _get_content_addressed_artifact_tag;
nothing is "combined" anymore, it is a pure content digest.
- Freeze BuildSources so the is_divergent guard, which decides whether an MR
may be merged, cannot be flipped after resolution.
- Note why prepare_git_repository_for_build is retained alongside
prepare_build_sources; add the missing :return: on remote_branch_exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pull_index_db_artifact caught every IIBError out of get_oras_artifact and rewrote it as "No index.db found ... Onboard the image to build." A registry outage, an auth failure or a 5xx therefore told operators to re-onboard an image that was already onboarded. Add ArtifactNotFoundError(IIBError), following the FileNotFoundInImageError pattern: run_cmd classifies 'oras pull' stderr against the registry codes that mean the artifact is absent (MANIFEST_UNKNOWN, NAME_UNKNOWN, BLOB_UNKNOWN, "not found", 404) and raises it; everything else stays a plain IIBError. Deliberately does not match a bare 401/403, since an authenticated registry answers 404 for an absent tag. get_oras_artifact preserves the type through its cleanup wrapper, and pull_index_db_artifact keeps the onboarding message for a genuine miss while reporting a failed pull as what it is. The ImageStream fallback is unaffected, as ArtifactNotFoundError is still an IIBError. Also collapse the FileNotFoundInImageError docstring to a single line, moving its rationale to a comment above the class, to match every other exception in iib/exceptions.py. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Copy the divergent-path catalog with symlinks=True, matching the extraction copy. Escaping symlinks are already rejected, so the links that remain are internal and should be committed as links rather than dereferenced into duplicate regular files. - Move the rationale for FileNotFoundInImageError and ArtifactNotFoundError from block comments into their class docstrings, matching the rest of iib/exceptions.py. - Reject an iib_index_db_artifact_tag_template that cannot fit the "-<request_id>" suffix within the 128-character OCI tag limit, so a long custom prefix fails at worker startup instead of at push time. - Note at the three handler merge guards that "not sources.is_divergent" is defense-in-depth over the rejection in prepare_build_sources. - Clarify in AGENTS.md that only the git side rolls back on failure; content-addressed index.db artifacts are never overwritten. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 6:50 PM UTC · Completed 7:31 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $21.81 |
PR Summary by QodoMigrate IIB builds to containerized Konflux workflows
AI Description
Diagram
High-Level Assessment
Files changed (97)
|
Code Review by Qodo
1. Successful builds can fail cleanup
|
| last_commit_sha: Optional[str] = None | ||
| output_pull_spec: Optional[str] = None | ||
|
|
||
| with tempfile.TemporaryDirectory(prefix=f'iib-{request_id}-') as temp_dir: |
There was a problem hiding this comment.
1. Successful builds can fail cleanup 🐞 Bug ☼ Reliability
The merge, catalog-operation, and empty-index handlers run containerized OPM commands inside TemporaryDirectory but never restore write permissions as the add handler does. When Podman creates non-writable files, context cleanup raises PermissionError after build side effects have occurred, affecting all three workflows.
Agent Prompt
## Issue description
Containerized OPM commands can leave non-writable files in temporary build directories, causing successful merge, FBC-operation, and empty-index tasks to fail when `TemporaryDirectory` removes their contents.
## Fix Focus Areas
- iib/workers/tasks/build_containerized_merge.py[163-414]
- iib/workers/tasks/build_containerized_fbc_operations.py[132-282]
- iib/workers/tasks/build_containerized_create_empty_index.py[179-381]
## Recommended Fix
Ensure each temporary-directory body normalizes file and directory permissions with `chmod_recursively` before cleanup. Place that normalization in a `finally` path so it also runs when an OPM operation or later build step raises, following the permission modes used by the containerized add workflow.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Configure Git user for commits | ||
| configure_git_user(local_repo_dir) | ||
|
|
There was a problem hiding this comment.
2. Catalog updates cannot be committed 🐞 Bug ☼ Reliability
push_configs_to_git and revert_last_commit no longer configure a repository-local Git identity before commit_and_push invokes git commit. The worker image writes Git's global identity as root but sets runtime HOME to /home/iib-worker, so normal OpenShift worker commits cannot find that root-owned configuration and fail when a catalog update or merge-request branch has changes.
Agent Prompt
Issue description
`configure_git_user()` was removed after cloning repositories, but `commit_and_push()` still creates commits. The Docker build configures root's global Git config while the runtime HOME is `/home/iib-worker`, leaving runtime commits without an author identity.
Fix Focus Areas
- iib/workers/tasks/git_utils.py[76-80]
- iib/workers/tasks/git_utils.py[243-250]
Recommended Fix
Restore repository-local `user.name` and `user.email` configuration immediately after each clone that can create a commit, or configure an identity in a runtime-visible system Git config. Keep the identity setup before both direct catalog commits and merge-request commits.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if build_request_config.binary_image_less_arches_allowed_versions: | ||
| if binary_image not in build_request_config.binary_image_less_arches_allowed_versions: | ||
| raise IIBError( | ||
| 'The binary image is not available for the following arches: {}'.format( |
There was a problem hiding this comment.
3. Requested platforms are skipped 🐞 Bug ≡ Correctness
prepare_request_for_build only rejects an unavailable architecture when binary_image_less_arches_allowed_versions is truthy, then replaces the requested set with its supported intersection in every other case. All containerized task entry points default that parameter to None, so requests without an explicit allow-list now build only a subset of their requested platforms instead of retaining the previous unsupported-platform error.
Agent Prompt
Issue description
An absent or empty `binary_image_less_arches_allowed_versions` currently bypasses the allow-list check and permits a partial-platform build. The parameter defaults to `None` in task entry points, making partial output the default whenever the selected binary image lacks one requested platform.
Fix Focus Areas
- iib/workers/tasks/utils.py[1429-1451]
- iib/workers/tasks/build_containerized_add.py[66-82]
Recommended Fix
Treat a missing or empty allow-list as disallowing reduced-platform builds. Only filter `arches` to the supported intersection when the selected `binary_image` is explicitly present in a non-empty allow-list; otherwise raise the existing unavailable-architectures error.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if "index.db" in pull_spec: | ||
| raise IIBError(f'Cannot get label "{label}" from {pull_spec}') |
There was a problem hiding this comment.
21. Bundle images with dotted names fail 🐞 Bug ≡ Correctness
get_image_label raises whenever the pull specification merely contains the substring index.db, rather than identifying an actual local database path. Bundle and deprecation processing pass user-provided image pull specifications directly through this helper, so an otherwise normal image whose repository or tag contains that string cannot have its required package label read.
Agent Prompt
Issue description
`get_image_label()` rejects any pull specification containing `index.db`, including valid image repository and tag components. Its callers use this helper for bundle and deprecation pull specifications, so the broad substring test blocks ordinary image inspection.
Fix Focus Areas
- iib/workers/tasks/utils.py[1302-1315]
- iib/workers/tasks/utils.py[509-538]
Recommended Fix
Remove the broad substring guard. If a local database-path check is required, validate an actual local path with an exact filename/path condition rather than matching text anywhere in an image pull specification.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| deps = | ||
| hadolint-py==2.15.1.2 | ||
| commands = | ||
| hadolint --failure-threshold warning docker/Dockerfile-api docker/Dockerfile-workers docker/message_broker/Dockerfile |
There was a problem hiding this comment.
4. Main branch checks fail on hadolint 🐞 Bug ☼ Reliability
The new hadolint tox command treats warnings as failures, while the added configuration neither ignores DL3007 nor trusts Quay. The scanned API and message-broker Dockerfiles use :latest, and the worker Dockerfile additionally uses the untrusted quay.io base image, so every tox run including the new environment fails.
Agent Prompt
## Issue description
The newly mandatory Hadolint invocation fails on existing Dockerfile constructs: `:latest` tags and the worker base image hosted on Quay.
## Fix Focus Areas
- tox.ini[112-118]
- .hadolint.yaml[3-17]
- docker/Dockerfile-api[1-1]
- docker/Dockerfile-workers[4-5]
- docker/message_broker/Dockerfile[2-2]
## Recommended Fix
Either make the Dockerfiles comply by pinning their base images to immutable tags or digests and allowlisting the required Quay registry, or explicitly ignore the applicable rules in `.hadolint.yaml` if floating tags are intentional. Keep the warning failure threshold only once all scanned Dockerfiles satisfy the selected policy.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| except Exception: | ||
| # MUST revert git commit first | ||
| revert_git_commit(commit_sha, repo_url, branch) | ||
| set_request_state(request_id, 'failed', str(error)) | ||
| raise |
There was a problem hiding this comment.
29. Failure cleanup raises a second error 🐞 Bug ≡ Correctness
The failure template calls nonexistent revert_git_commit and uses error without binding it in the except Exception clause. A handler copied from this template fails again while handling its original exception, preventing the documented failed-state update from completing.
Agent Prompt
## Issue description
The worker-handler failure example cannot execute because it uses an undefined revert helper and an undefined exception variable.
## Fix Focus Areas
- .agents/skills/worker-task-handler/SKILL.md[51-57]
- iib/workers/tasks/containerized_utils.py[594-644]
- iib/workers/tasks/git_utils.py[352-385]
## Recommended Fix
Replace the illustrative direct revert code with the repository's `cleanup_on_failure(...)` pattern, or use `except Exception as error:` and the real `revert_last_commit` signature. Preserve the distinction between closing an MR and reverting a direct-push commit.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| Worker handler tests mock two categories of dependencies: | ||
| - **Handler-local functions** — mock on `iib.workers.tasks.build_containerized_<type>.<function>` | ||
| - **Shared containerized utilities** — mock on `iib.workers.tasks.containerized_utils.<function>` | ||
|
|
There was a problem hiding this comment.
30. Handler tests can call real services 🐞 Bug ☼ Reliability
The testing skill says containerized utility functions should be patched in containerized_utils, even when handlers imported those functions into their own module namespace. When a handler directly imports Git, artifact, or pipeline helpers, patches at the defining module do not replace the handler's bound references and its test can invoke the real dependency.
Agent Prompt
## Issue description
The testing guide gives a generic patch target that does not intercept dependencies directly imported by containerized handlers.
## Fix Focus Areas
- .agents/skills/writing-tests/SKILL.md[72-96]
- .agents/skills/writing-tests/SKILL.md[162-168]
- iib/workers/tasks/build_containerized_add.py[22-32]
- tests/test_workers/test_tasks/test_build_containerized_add.py[30-62]
## Recommended Fix
State that mocks must target the namespace where each dependency is looked up. For functions imported directly by a handler, use `iib.workers.tasks.build_containerized_<type>.<function>`; reserve `containerized_utils.<function>` for calls looked up from within that module.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| 1. Apply the fix to the relevant source file | ||
| 2. The dev environment uses watchmedo for auto-reload — the worker will restart automatically after file changes | ||
| 3. Re-submit the same request |
There was a problem hiding this comment.
31. Fixes are retested against stale workers 🐞 Bug ≡ Correctness
The debugging skill says the containerized development worker uses watchmedo and restarts automatically after source changes. The containerized compose service instead starts Celery directly, so a resubmitted request after an edit continues using the already imported worker code until the service is restarted.
Agent Prompt
## Issue description
The containerized debugging instructions claim automatic worker reload even though the compose service starts Celery without a file watcher.
## Fix Focus Areas
- .agents/skills/debugging-request-failures/SKILL.md[137-144]
- podman-compose-containerized.yml[94-140]
## Recommended Fix
Replace the automatic-reload claim with an explicit command to restart `iib-worker-containerized` after worker-code changes, then resubmit the request. Keep any automatic reload guidance scoped only to the legacy compose configuration that actually runs watchmedo.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| | `bundles` | Yes | `List[str]` — bundle image pull specs | | ||
| | `from_index` | Yes | `str` — index image to add to | |
There was a problem hiding this comment.
32. Index-only additions cannot be reproduced 🐞 Bug ≡ Correctness
The endpoint reference marks both bundles and from_index as required for an add request. RequestAdd.from_json() permits either value and rejects only the case where neither is supplied, so agents following this reference cannot submit the supported index-only form.
Agent Prompt
## Issue description
The endpoint parameter reference incorrectly requires both add inputs even though the API accepts an add request with either bundles or a source index.
## Fix Focus Areas
- .agents/skills/debugging-request-failures/references/endpoint-parameters.md[3-16]
- .agents/skills/debugging-request-failures/SKILL.md[45-55]
- .agents/skills/validating-changes/SKILL.md[89-99]
- iib/web/models.py[1168-1180]
- iib/web/models.py[1215-1228]
## Recommended Fix
Describe `bundles` and `from_index` as conditionally required: at least one must be supplied. Update both quick-reference tables so the reproduction and validation instructions agree with the API.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| ## `POST /builds/regenerate-bundle` | ||
| | Parameter | Required | Type | | ||
| |---|---|---| | ||
| | `from_bundle_image` | Yes | `str` — bundle image to regenerate | | ||
| | `organization` | No | `str` | | ||
| | `registry_auths` | No | `Dict[str, Any]` | |
There was a problem hiding this comment.
33. Replacement-based rebuilds go untested 🐞 Bug ≡ Correctness
The regenerate-bundle parameter table omits bundle_replacements while claiming to provide the full required and optional parameter set. The API forwards that value to the containerized handler, so agents relying on the table do not gather or reproduce requests that use supported bundle substitutions.
Agent Prompt
## Issue description
The regenerate-bundle endpoint reference omits a supported optional parameter that is forwarded to the worker handler.
## Fix Focus Areas
- .agents/skills/debugging-request-failures/references/endpoint-parameters.md[30-35]
- iib/web/api_v1.py[889-917]
- iib/workers/tasks/build_containerized_regenerate_bundle.py[64-83]
## Recommended Fix
Add `bundle_replacements` as an optional `Dict[str, str]` parameter and explain that it maps original bundle pull specifications to rebuilt bundle pull specifications.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Risk Assessment: elevated (3/5) DetailsA bulk 'master to main' import of 97 files and 18k+ lines touching 19 protected paths, multiple CI workflows, and 3 dependency files produces high Tier 1 metadata risk (3.25), which is partially offset by low git churn and stable authorship history on the changed files (Tier 2 avg 1.71), yielding a composite score of 3 (elevated). |
ReviewFindingsHigh
Medium
Low
Labels: PR adds 6 new containerized build handlers, modifies CI workflows, touches 19 protected paths, and risk assessment scored elevated (3/5) Next steps:
|
There was a problem hiding this comment.
Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:
iib/web/api_v1.py(file-level): Line 162 · [high] breaking-api
_get_safe_args() calls safe_args.index(payload['cnr_token']) but _get_add_args() no longer includes cnr_token in args. Any caller sending cnr_token gets a 500 ValueError.
Suggested fix: Remove the cnr_token branch from _get_safe_args().
tests/test_workers/test_tasks/test_git_utils.py(file-level): Line 900 · [medium] test-adequacy
@mock.patch references configure_git_user which was removed from git_utils.py in this PR. Will raise AttributeError at test collection time.
Suggested fix: Remove the stale mock.patch decorator.
.github/workflows/build.yml(file-level): Line 68 · [low] CI/CD-supply-chain
redhat-actions/push-to-registry@v2.7.1 referenced by mutable tag while other actions are pinned to SHAs.
Suggested fix: Pin to commit SHA.
.github/workflows/build.yml(file-level): Line 1 · [low] CI/CD-permissions
build.yml and build_on_tag.api.yml lack explicit permissions blocks unlike new workflows.
Suggested fix: Add permissions: contents: read.
iib/web/api_v1.py(file-level): Line 533 · [low] breaking-api
Validation error messages changed; clients doing string matching will break.
| from iib.workers.config import get_worker_config | ||
| from iib.workers.tasks.celery import app | ||
|
|
||
| # from iib.workers.tasks.celery import app |
There was a problem hiding this comment.
[high] architectural-coherence
Circular dependency between build.py and containerized_utils.py. containerized_utils.py imports from build.py at module level, and build.py imports from containerized_utils.py via a local import with a comment documenting the problem rather than resolving it.
Suggested fix: Extract shared symbols into a dedicated utility module.
|
|
||
| @app.task | ||
| @request_logger | ||
| @instrument_tracing(span_name="workers.tasks.handle_add_request", attributes=get_binary_versions()) |
There was a problem hiding this comment.
[high] naming-convention
@instrument_tracing span name is 'workers.tasks.handle_add_request', missing 'build.' prefix and 'containerized' qualifier. Every other containerized handler uses 'workers.tasks.build.handle_containerized_*_request'.
Suggested fix: Change span_name to 'workers.tasks.build.handle_containerized_add_request'.
| if not isinstance(payload, dict): | ||
| raise ValidationError('The input data must be a JSON object') | ||
|
|
||
| if not payload.get('from_index'): |
There was a problem hiding this comment.
[high] breaking-api
POST /builds/add now unconditionally requires 'from_index'. Previously only required when no bundles were specified. Breaks callers that submit add-only requests without from_index.
Suggested fix: Document as intentional API change, or replicate old conditional validation.
| set_request_state( | ||
| request_id, | ||
| 'complete', | ||
| f"The operator(s) {operators_in_db} were successfully removed " |
There was a problem hiding this comment.
[medium] logic-error
Success message says 'were successfully removed from the index image' but this handler adds FBC fragments. Copy-paste error from the RM handler.
Suggested fix: Change message to reflect the add operation.
| @@ -1275,11 +1427,28 @@ def prepare_request_for_build( | |||
| binary_image_arches = get_image_arches(binary_image_resolved) | |||
|
|
|||
| if not arches.issubset(binary_image_arches): | |||
There was a problem hiding this comment.
[medium] logic-error
When binary_image_less_arches_allowed_versions is falsy (default), the arch mismatch check silently falls through instead of raising IIBError. Old behavior always raised. Affects ALL request types.
Suggested fix: Add an else clause to restore the old strict behavior.
| @mock.patch('iib.workers.tasks.build_containerized_rm.reset_docker_config') | ||
| @mock.patch('iib.workers.tasks.build_containerized_rm.cleanup_on_failure') | ||
| @mock.patch('iib.workers.tasks.containerized_utils._skopeo_copy') | ||
| @mock.patch('iib.workers.tasks.containerized_utils.get_worker_config') |
There was a problem hiding this comment.
[low] test-adequacy
Duplicate mock.patch decorators target the same path.
Suggested fix: Fix or remove the duplicate.
| fbc_dir, _ = opm_registry_rm_fbc( | ||
| base_dir=temp_dir, | ||
| from_index=from_index_resolved, | ||
| operators=list[str](operators_in_db), |
There was a problem hiding this comment.
[low] api-contract
liststr implies type enforcement that doesn't occur at runtime.
Suggested fix: Replace with list(operators_in_db).
| Parse a container image pullspec (URL) to extract the index name and tag. | ||
|
|
||
| :param str image_pullspec: The full image pullspec string (registry/path/name:tag[@digest]). | ||
| :returns Tuple[str, str]: The extracted index name and tag (e.g., 'iib-pub-pending', 'v4.17'). |
There was a problem hiding this comment.
[low] documentation-comment-format
Non-standard :returns: format used instead of the established :return:/:rtype: pair.
Suggested fix: Use standard two-line format.
|
|
||
|
|
||
| def validate_bundles_in_parallel( | ||
| bundles: Union[List[BundleImage], List[str]], threads=5, wait=True |
There was a problem hiding this comment.
[low] naming-convention
threads and wait parameters lack type annotations unlike all other new functions.
Suggested fix: Add type annotations.
|
|
||
| try: | ||
| handle_add_request.apply_async( | ||
| handle_containerized_add_request.apply_async( |
There was a problem hiding this comment.
[low] breaking-api
All six Celery task dispatches renamed to containerized_* variants. External monitoring and integration tests will break.
Suggested fix: Document task name changes and ensure deployment sequencing.
|
🤖 Finished Retro · ✅ Success · Started 8:08 PM UTC · Completed 8:18 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.07 |
Retro: PR #1383 — "Import changes from master to main"Timeline
AssessmentReview quality was excellent. The agent found substantive, real issues: breaking API changes ( The 422 inline comment recovery worked correctly. Five findings that couldn't be posted on diff lines were automatically posted in the review body — no findings were lost. Cost was high but proportional to PR size. $21.81 for a 97-file, 18K-line review using Opus at high effort is within expected bounds. However, the PR was closed without merging, meaning the detailed code-level findings may not be acted upon if the code is restructured for resubmission. Superseded workflow runs were handled correctly. Three Existing issues this retro provides evidence for
Proposals skipped (target repo not allowed)File manually or update
|
No description provided.