Skip to content

Fix set_registry_token call for token usa - #1370

Merged
yashvardhannanavati merged 1 commit into
release-engineering:masterfrom
chandwanitulsi:test-fix
Sep 11, 2026
Merged

yashvardhannanavati merged 1 commit into
release-engineering:masterfrom
chandwanitulsi:test-fix

Conversation

@chandwanitulsi

Copy link
Copy Markdown
Contributor

Assisted-by: Cursor/Gemini

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:30 AM UTC · Completed 6:50 AM UTC
Commit: 1bc0ed6 · View workflow run →

@chandwanitulsi
chandwanitulsi marked this pull request as ready for review August 3, 2026 06:45
@qodo-for-releng

Copy link
Copy Markdown

PR Summary by Qodo

Scope overwrite_from_index_token to same-registry images during resolution

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Limit overwrite_from_index_token usage to images that actually need it (same registry/repo).
• Extend set_registry_token to support writing scoped auth for multiple pull specs.
• Add unit tests to prevent cross-registry auth leakage and regressions.
Diagram

graph TD
  A["handle_add_request"] --> B["get_same_registry_images"] --> C["set_registry_token (multi)"] --> D[("~/.docker/config.json")]
  E["handle_fbc_operation_request"] --> F["_images_in_same_repository"] --> G["set_registry_token (single)"] --> D
  C --> H["get_resolved_bundles"]
  G --> I["get_resolved_image"]

  subgraph Legend
    direction LR
    _task[Task/Worker] ~~~ _util[Utility] ~~~ _cfg[(Docker config)]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use per-command auth files (podman/opm --authfile)
  • ➕ Avoids mutating ~/.docker/config.json entirely
  • ➕ Eliminates risk of leaking auth changes across concurrent operations
  • ➖ Requires plumbing an authfile path through multiple call sites (podman/opm wrappers)
  • ➖ May be harder to apply consistently across all tooling invoked by the worker
2. Always write registry-level auth for overwrite_from_index_token
  • ➕ Simpler logic (no filtering/selection)
  • ➕ Likely fixes more pull cases without extra parsing
  • ➖ High blast radius: can override worker template auth for unrelated repos on same registry
  • ➖ More likely to cause unintended auth behavior changes during a request

Recommendation: The PR’s approach is the best incremental fix: it keeps the existing context-manager model but scopes the overwrite token to only the images that should use it (same registry for bundles; same repository for FBC fragments). This reduces the risk of disturbing unrelated registry auth while still unblocking private same-registry pulls. A future hardening step could move to explicit authfile usage, but that’s a larger refactor.

Files changed (6) +301 / -20

Enhancement (1) +48 / -15
utils.pyAdd same-registry filtering helper and support multi-image set_registry_token +48/-15

Add same-registry filtering helper and support multi-image set_registry_token

• Introduces get_same_registry_images(reference_image, images) to filter pull specs by registry. Extends set_registry_token to accept either a single image or a list of images, writing scoped auth entries for each and handling empty lists safely.

iib/workers/tasks/utils.py

Bug fix (2) +26 / -5
build.pyScope overwrite_from_index_token to same-registry bundles during resolution +9/-2

Scope overwrite_from_index_token to same-registry bundles during resolution

• Changes bundle-resolution auth handling to apply overwrite_from_index_token only to bundles on the same registry as from_index. This avoids writing broader registry auth that could interfere with the worker’s Docker config template while still enabling private same-registry bundle pulls.

iib/workers/tasks/build.py

build_fbc_operations.pyOnly apply overwrite token to FBC fragments in the same repository as from_index +17/-3

Only apply overwrite token to FBC fragments in the same repository as from_index

• Adds repository-level comparison for from_index vs fragment pull specs and conditionally wraps digest resolution in set_registry_token only when they match. Prevents using a token intended for one repo to authenticate pulls from another.

iib/workers/tasks/build_fbc_operations.py

Tests (3) +227 / -0
test_build.pyTest overwrite_from_index_token is applied to same-registry bundles +80/-0

Test overwrite_from_index_token is applied to same-registry bundles

• Adds a unit test asserting handle_add_request calls set_registry_token with only same-registry bundles (not just from_index). Validates the auth-scoping behavior during bundle digest resolution.

tests/test_workers/test_tasks/test_build.py

test_build_fbc_operations.pyTest overwrite token is used only for same-repository FBC fragments +67/-0

Test overwrite token is used only for same-repository FBC fragments

• Adds a unit test verifying set_registry_token is invoked only for fragments that share registry/namespace/repo with from_index. Ensures other fragments resolve without applying the overwrite token.

tests/test_workers/test_tasks/test_build_fbc_operations.py

test_utils.pyAdd tests for multi-image auth and same-registry filtering +80/-0

Add tests for multi-image auth and same-registry filtering

• Adds coverage for set_registry_token handling multiple images and for get_same_registry_images behavior across typical and edge cases (missing reference, unresolvable registry, empty list). Also tests that empty image lists cause no docker config mutation.

tests/test_workers/test_tasks/test_utils.py

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review

Findings

High

  • [scope-creep] iib/workers/tasks/utils.py:866 — set_registry_token now writes a namespace-level auth key whenever no path-scoped credentials pre-exist. This namespace fallback applies to every existing caller project-wide, not just the callers modified in this PR. The code itself acknowledges the trade-off in comments (lines 860–865), but the PR description does not disclose this behavioral expansion to reviewers. Affected unmodified callers include _get_or_create_temp_index_db_file, opm_index_deprecatetruncate, and multiple locations in build.py.
    Remediation: Either scope the namespace fallback to the new list-accepting call sites only (e.g. via a separate boolean parameter namespace_fallback=True), or explicitly document in the PR that every set_registry_token caller is intentionally affected and obtain sign-off.

Medium

  • [missing-authorization] — This PR has 200+ net-new lines of substantive logic change and is labeled ‘bug’, but has no linked issue. The PR body only states ‘Assisted-by: Cursor/Gemini’, providing no incident reference, reported symptom, or reproduction case that would establish what specific bug is being fixed.
    Remediation: Link a GitHub issue that describes the reported bug (e.g. ‘overwrite_from_index_token clobbers broader Docker config credentials when resolving bundles’).

  • [side-effect scope] iib/workers/tasks/utils.py:866 — The namespace-level auth fallback inside set_registry_token (lines 866–876) broadens the token scope during the context manager’s lifetime: any image under the same namespace will authenticate with the overwrite token. The code bounds this with conditions (same namespace, no pre-existing path auth), but the behavioral expansion is real and applies to all callers.
    Remediation: Consider gating the namespace fallback behind an explicit opt-in parameter on set_registry_token, and only pass it from the new call sites.

  • [scope-creep] iib/workers/tasks/utils.py:1307 — get_index_image_info previously called set_registry_token without append=True (default False), starting from a clean Docker config. This PR changes it to append=True, so it now inherits whatever credentials are already in ~/.docker/config.json. This alters behavior for every caller and is not mentioned in the PR description.
    Remediation: Explain in the PR why append=True is needed here, or revert if not required for the bug fix.

  • [scope-creep] iib/workers/tasks/build.py:888 — The call to set_registry_token for from_index_resolved in handle_add_request was changed from append=False (default) to append=True. This semantic change is not explained in the PR.
    Remediation: Explain in the PR why append=True is needed here specifically, or revert if not required.

  • [stale-description] README.md:319 — The README states that iib_docker_config_template is used to ‘set the overwrite_from_index_token for the specific repository of the from_index container image when applicable.’ This PR expands the scope to same-namespace bundles/fragments and adds namespace-level fallback auth. The existing prose is now incomplete.
    Remediation: Update the sentence to reflect the expanded scope of the overwrite token.

Low

  • [maintenance] iib/workers/tasks/opm_operations.py:1281 — run_cmd is duplicated across the if token_images: and else: branches. Other functions in the same PR (opm_registry_add_fbc, opm_registry_add_fbc_fragment) use a single set_registry_token call relying on its no-op behavior for falsy input.
    Remediation: Replace with a single with set_registry_token(overwrite_from_index_token, token_images, append=True): call.

  • [naming-convention] iib/workers/tasks/utils.py:705 — docker_config_has_path_auth_for_image is only called within utils.py itself, yet it lacks the underscore prefix used by every sibling private helper (_docker_auth_key_for_image, _docker_auth_keys_covering_image, _load_docker_config_auths).
    Remediation: Rename to _docker_config_has_path_auth_for_image and update call sites.

  • [test-inadequate] tests/test_workers/test_tasks/test_opm_operations.py:465 — test_opm_registry_add_fbc always mocks get_images_needing_overwrite_token with return_value=[]. The code path where bundles_needing_token is non-empty is never exercised for this function.
    Remediation: Add a parametrized test case where get_images_needing_overwrite_token returns a non-empty list.

  • [edge-case] iib/workers/tasks/utils.py:720 — docker_config_has_path_auth_for_image always returns False for non-namespaced images, even if Docker config has a registry-level auth entry. Currently safe due to namespace-match guard in get_images_needing_overwrite_token, but fragile if used elsewhere.

  • [code-organization] iib/workers/tasks/build.py:850 — build.py and build_fbc_operations.py introduce an inner-function + nonlocal pattern not used anywhere else in the tasks package. opm_operations.py in the same PR solves the identical problem by always passing the possibly-empty list to set_registry_token.
    Remediation: Use the simpler always-call approach from opm_operations.py to avoid the inner functions and nonlocal.

  • [missing-changelog-entry] CHANGELOG.md:7 — The ‘## Unreleased’ section is empty. This PR introduces behavioral changes to set_registry_token and adds new public helpers that warrant a changelog entry.
    Remediation: Add a bullet under ‘## Unreleased’ describing the fix.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run

Review

Reason: stale-head

The review agent reviewed commit 7468a9be1acbf1ca66373b438548d776c301ecf8 but the PR HEAD is now 906a20c3486f02f346080ee3e69330a76194a4e0. This review was discarded to avoid approving unreviewed code.

Previous run (2)

Review

Findings

Medium

  • [code-duplication] iib/workers/tasks/opm_operations.py — In both opm_registry_add_fbc and opm_registry_add_fbc_fragment, multi-line operation bodies are fully duplicated between the if ..._needing_token: and else: branches. The _opm_registry_add call (6 keyword args) and the fragment-extraction for-loop (7+ lines) are copied verbatim across both branches. set_registry_token already no-ops when container_image is falsy (empty list [] is falsy), so the branching is unnecessary and creates a divergence risk for future changes.
    Remediation: Pass bundles_needing_token / fragments_needing_token directly to set_registry_token (empty list triggers no-op), or extract a helper function as done in build.py and build_fbc_operations.py.

  • [token-scope-widening] iib/workers/tasks/utils.py — The new namespace-level fallback auth in set_registry_token writes the overwrite token at the registry/namespace scope when no existing path-scoped auth is found. This broadens a user-supplied credential from registry/ns/repo to registry/ns, which in container runtimes that match auth keys hierarchically could authenticate to sibling repositories within the same namespace.
    Remediation: Document the security rationale for the namespace-level fallback. Consider making it opt-in rather than default behavior.

  • [credential-scope-change] iib/workers/tasks/utils.py:1257 — Changing get_index_image_info from set_registry_token(token, from_index) (append=False) to set_registry_token(token, from_index, append=True) changes credential merging behavior. With append=True, existing ~/.docker/config.json auths are preserved. If get_index_image_info were called while a prior set_registry_token context is active, those tokens would be inherited.
    Remediation: Verify that get_index_image_info is never called within another set_registry_token context. Document why append=True is needed.

  • [design-coherence] iib/workers/tasks/utils.py — Introduces significant new authentication complexity (namespace filtering, dynamic per-request credential selection, multi-image token application) without documented design rationale. The README describes template-based auth via iib_docker_config_template; this PR shifts to dynamic runtime filtering.
    Remediation: Document the design change covering why template auth is insufficient and how the new filtering logic interacts with existing credentials.

Low

  • [nonlocal-pattern] iib/workers/tasks/build.py — Introduces nonlocal resolved_bundles pattern not used anywhere else in the codebase. Variable resolved_bundles: List[str] = [] is declared after the function definition that references it via nonlocal, inconsistent with build_fbc_operations.py where the variable is declared before the nested function.
    Remediation: Have _resolve_bundles() return the list instead. Move variable declaration before the function definition.

  • [toctou-race] iib/workers/tasks/utils.py — get_images_needing_overwrite_token and set_registry_token both call _load_docker_config_auths() independently. The window between these reads is narrow and mitigated by process isolation, but passing the auths snapshot directly would eliminate the race.

  • [error-handling] iib/workers/tasks/utils.py — _load_docker_config_auths catches OSError/json.JSONDecodeError and returns empty dict. If Docker config exists but is corrupted, docker_config_has_path_auth_for_image returns False, causing unnecessary namespace-level fallback.

  • [missing-authorization] No linked issue for a non-trivial change (800+ lines). The PR body contains only "Assisted-by: Cursor/Gemini" with no problem statement.

  • [scope-creep] PR is labeled bug but the implementation includes new public functions, signature changes, namespace-level fallback, and Docker config introspection across 4 modules — closer to a feature/refactor in scope.

  • [abstraction-alignment] The filtering pattern (get_images_needing_overwrite_token() → check → conditional wrap) is repeated across 4 call sites. A higher-level abstraction could reduce this repetition.

  • [trajectory-alignment] This PR appears to continue work from PR Refactor set_registry_token to support repository-specific auth #1343 without referencing it. Linking to prior work would help reviewers understand context.

  • [naming-inconsistency] Inner functions _resolve_bundles() and _resolve_fbc_fragments() use leading underscore reserved for module-level privates in this codebase.

  • [inline-import-placement] iib/workers/tasks/opm_operations.py — New inline imports appear mid-function instead of immediately after docstrings, which is the established pattern.

  • [incomplete-documentation] README.md and iib/web/static/api_v1.yaml — The overwrite_from_index_token documentation doesn't reflect the new selective application behavior or bundle/fragment auth usage (pre-existing gap widened by this PR).

  • [missing-documentation] README.md — Registry Authentication section doesn't document the relationship between Docker config template and overwrite_from_index_token credential precedence.

Previous run (3)

Review

Findings

Medium

  • [logic-error] iib/workers/tasks/build_fbc_operations.py:86 — The _images_in_same_repository function used for FBC fragments compares registry, namespace, AND repo, while get_same_registry_images in utils.py (used for bundles in handle_add_request) compares registry ONLY. This creates an undocumented behavioral divergence: bundles on the same registry get the token regardless of namespace/repo, while FBC fragments must be in the exact same repository. This could cause silent authentication failures for FBC fragments that are on the same registry but in a different repo than from_index, and is inconsistent with the broader matching used for bundles.
    Remediation: Either unify both paths to use the same scoping strategy (registry-only or repository-level), or add documentation explaining why FBC fragments use stricter same-repository matching while bundles use same-registry matching.

  • [test-weakened] tests/test_workers/test_tasks/test_build_fbc_operations.py — The existing test test_handle_fbc_operation_request_with_overwrite_token now silently exercises a different code path. Since the test's fragments (quay.io/iib/fbc-fragment1:latest, quay.io/iib/fbc-fragment2:latest) have a different repo name than from_index (quay.io/iib/from-index:latest), _images_in_same_repository returns False and set_registry_token is never called. The test passes but now validates the no-token path instead of the with-token path, despite its name suggesting it tests overwrite token behavior.
    Remediation: Update the existing test to use fragments sharing the same repo as from_index (e.g., quay.io/iib/from-index:fragment-tag) to exercise the token path, or add assertions verifying set_registry_token is NOT called and rename accordingly.

Low

  • [missing-authorization] — This PR lacks a linked issue. The change modifies authentication scoping logic across multiple files. Linking to a tracking issue would improve traceability and document the rationale for the change.

  • [edge-case] iib/workers/tasks/utils.py:677 — In set_registry_token, the if not container_image check at line 670 already catches empty lists (since not [] is True), making the subsequent if not images check at line 677 unreachable when container_image is []. This is dead code that could confuse future maintainers.

  • [code-organization] iib/workers/tasks/build_fbc_operations.py:35 — The helper _images_in_same_repository is defined locally in build_fbc_operations.py rather than in utils.py alongside get_same_registry_images(). Co-locating the two related image-matching functions would improve discoverability and make the different matching strategies more visible.

  • [credential-logging] iib/workers/tasks/utils.py — The debug log in the multi-image loop now emits an entry per image receiving the token. While no credentials are leaked (only the auth key path is logged), the expanded logging volume is noted.


Labels: PR fixes token scoping behavior in registry authentication logic — a bug fix


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (4)

Review

Reason: stale-head

The review agent reviewed commit 1bc0ed6db1f694024483f3ada18d4fd59c0be19b but the PR HEAD is now ea42f2c6ce81ecab402da9541fb5f1c61d76ae9e. This review was discarded to avoid approving unreviewed code.

@fullsend-ai-review

Copy link
Copy Markdown

/fs-review

@qodo-for-releng

qodo-for-releng Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Token scope too broad ✓ Resolved 🐞 Bug ≡ Correctness
Description
handle_add_request now applies overwrite_from_index_token to every bundle sharing from_index’s
registry, which writes/overwrites per-repo docker auth entries for those bundle repos. If the token
is only valid for the from_index repository (as documented) or lacks access to some same-registry
repos, bundle resolution can fail because pulls will use the forced credentials instead of
anon************ng credentials.
Code

iib/workers/tasks/build.py[R842-845]

+    with set_registry_token(
+        overwrite_from_index_token,
+        get_same_registry_images(from_index, bundles),
+        append=True,
Relevance

●●● Strong

PR #1343 refactored set_registry_token for repo-scoped auth; team avoids broader registry-level
credential overrides.

PR-#1343

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Docs and nearby logic indicate overwrite_from_index_token is intended to be repo-scoped; the PR
expands it to many repos (all bundles on the same registry) and set_registry_token overwrites auth
keys for each image, so this change can alter which credentials are used for bundle pulls.

iib/workers/tasks/build.py[836-846]
README.md[316-320]
iib/workers/tasks/utils.py[625-658]
iib/workers/tasks/utils.py[699-702]
iib/workers/tasks/build_fbc_operations.py[81-83]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`handle_add_request()` now calls `set_registry_token(overwrite_from_index_token, get_same_registry_images(from_index, bundles), append=True)`, which applies the overwrite token to *all* bundle repos on the same registry. This can overwrite existing per-repo credentials (or force auth where anonymous pulls previously worked) for repos that the overwrite token is not intended/authorized to access.

### Issue Context
- The worker config documentation states the overwrite token is set for the **specific repository of `from_index`**.
- `set_registry_token()` overwrites the derived `auths` key for **each provided image**, so widening the image list widens the override impact.
- The FBC flow in this PR explicitly restricts overwrite token usage to the **same repository**, indicating repo-scoped intent.

### Fix Focus Areas
- iib/workers/tasks/build.py[836-846]
- iib/workers/tasks/utils.py[602-623]
- iib/workers/tasks/utils.py[699-702]
- README.md[316-320]
- iib/workers/tasks/build_fbc_operations.py[81-88]

### Suggested fix approach
Choose one (in order of safety):
1) **Align with documented semantics**: only apply `overwrite_from_index_token` to the `from_index` repository (keep bundle resolution using existing/anonymous auth), and if bundle auth is needed, introduce a separate explicit token/credential mechanism for bundles.
2) If reuse is required, **narrow the filter** from “same registry” to a safer scope (e.g., same registry+namespace, or same repository) so unrelated repos are not overridden.
3) Alternatively, apply the token only conditionally (e.g., retry bundle resolution with the override token only after an auth failure), to avoid breaking pulls that work without it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread iib/workers/tasks/build.py Outdated
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:50 AM UTC · Completed 7:07 AM UTC
Commit: ea42f2c · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the bug Something isn't working label Aug 3, 2026
lipoja
lipoja previously approved these changes Aug 4, 2026

@lipoja lipoja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once you address the [medium] logic-error you can merge it.
LGTM.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:35 PM UTC · Completed 2:16 PM UTC

Commit: f0936e7 · View workflow run →

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review August 13, 2026 14:16

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 13, 2026
Comment thread iib/workers/tasks/utils.py Outdated
@lipoja

lipoja commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

LGTM, lets fix the linting errors and remove the unused code.

@MichalZelenak

Copy link
Copy Markdown
Contributor

Apart from the comments above LGTM.

Once we migrate to the Pods, would it make sense, to craft the credentials file (docker config) per command? That way, we would have better control over the credentials.

@jfrancin

Copy link
Copy Markdown

Hello - wondering how long before this gets merged? I've been waiting for this to be done so I can once again do 'manual' IIB job submissions (I have the relevent credentials) to remove or add bundles in the Certified, Marketplace, or Community bundle indexes.

@yashvardhannanavati yashvardhannanavati left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@chandwanitulsi could you please fix the tests too?

Comment thread iib/workers/tasks/opm_operations.py Outdated
Comment thread iib/workers/tasks/utils.py
Comment thread iib/workers/tasks/utils.py
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:34 AM UTC · Completed 2:02 AM UTC

Commit: 7468a9b · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $9.63

…h-scoped Docker auth

Fixes CLOUDDST-32419 and CLOUDDST-32824 by applying the overwrite token only
where worker Docker config cannot already pull the image, and by avoiding
blanket token stamping that broke unrelated private fragments and namespace
template credentials.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Re-review anchoring applied: Tier 1 signals are unchanged from the prior assessment (large blast radius offset by zero protected/security paths, 0.43 test ratio, established non-bot author), and Tier 2 shows negligible 30-day churn and no recent regression activity, providing no articulable reason to deviate from the prior score of 2.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate risk: the large blast radius (core worker task files touching build, opm, and utility layers) elevates Tier 1, but strong test coverage (0.43 ratio), no protected or security-sensitive paths, zero regression history, and an established author keep the composite score at 2.

@fullsend-ai-review

Copy link
Copy Markdown

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:03 AM UTC · Completed 2:31 AM UTC

Commit: 906a20c · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $9.72

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

Comment thread iib/workers/tasks/utils.py
Comment thread iib/workers/tasks/utils.py
Comment thread iib/workers/tasks/utils.py
Comment thread iib/workers/tasks/build.py
Comment thread iib/workers/tasks/opm_operations.py
Comment thread iib/workers/tasks/utils.py
Comment thread tests/test_workers/test_tasks/test_opm_operations.py
Comment thread iib/workers/tasks/utils.py
Comment thread iib/workers/tasks/build.py
@fullsend-ai-review fullsend-ai-review Bot removed the requires-manual-review Review requires human judgment label Sep 11, 2026
@yashvardhannanavati
yashvardhannanavati merged commit bc84f69 into release-engineering:master Sep 11, 2026
52 checks passed
@fullsend-ai-retro

fullsend-ai-retro Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:43 AM UTC · Completed 9:55 AM UTC

Commit: 906a20c · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.01

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #1370 — Scope overwrite_from_index_token

Timeline

  • Aug 3: PR opened by chandwanitulsi (human, assisted by Cursor/Gemini). fullsend-ai-review and qodo-for-releng reviewed commit ea42f2c, producing 12 inline findings and a summary.
  • Aug 14: lipoja requested changes — fix linting errors, remove unused docker_config_has_auth_for_image function.
  • Sep 2: yashvardhannanavati requested changes with 3 deep findings: third config reader inconsistency in _load_docker_config_auths, namespace fallback risk, and repeated code in opm_operations.py.
  • Sep 11 01:33: Author pushed commit 7468a9b, triggering review run 34551130939. Force-pushed to 906a20c ~5 min later, triggering run 34551456263.
  • Sep 11 02:02: First review completed on stale commit 7468a9b ($9.63 wasted). Second review started on 906a20c.
  • Sep 11 02:31: Second review completed ($9.72). Total final-round cost: ~$19.35.
  • Sep 11 09:27–09:42: Both human reviewers approved. PR merged.

Review Quality

The agent produced ~22 findings across 3 review rounds (~50% actionable). Human reviewers produced 6 findings (~100% actionable).

Agent strengths: Caught undisclosed append=True behavioral changes in get_index_image_info and from_index_resolved that humans missed. Identified documentation gaps (stale README, missing changelog).

Agent weaknesses: Missed the deepest architectural finding — yashvardhannanavati identified _load_docker_config_auths as a third config reader with different error-handling and file-selection behavior, which could cause incorrect "already covered" decisions. The agent also missed an unused public function flagged by lipoja and linting errors. On the namespace-level fallback, the agent assigned [high] scope-creep severity despite a 9-line inline comment explaining the design rationale, while yashvardhannanavati productively framed the same concern as a design question ("Is this an acceptable risk?") — eliciting a substantive bounded-risk rationale from the author.

Existing Issue Evidence

  • Stale-commit review waste (~$9.63): Author force-pushed within 5 min, causing the first review to complete on a stale commit. Evidence for fullsend-ai/fullsend#4069 and #1331.
  • AGENTS.md for IIB: The agent's failure to identify the third config reader pattern and unused public function would be mitigated by domain-specific review guidance. Evidence for release-engineering/iib#1366.
  • Scope-creep false positives: The agent flagged the namespace fallback under 3 different labels across reviews (scope-creep, side-effect-scope, token-scope-widening) despite inline rationale. Partially related to fullsend-ai/fullsend#3864 and #2801, though neither addresses inline-comment-aware severity calibration specifically.

Autonomy Readiness

The agent is not ready for increased autonomy on complex auth/credential changes in this repo — it missed the deepest architectural finding and inflated severity on intentional design decisions. However, its strength at catching undisclosed behavioral changes (append=True) suggests it adds value as a complementary reviewer when combined with human domain experts.

Proposals skipped (target repo not allowed)

File manually or update create_issues.allow_targets in config.yaml:

  • Review agent should calibrate severity using inline design-rationale comments (fullsend-ai/agents)

yashvardhannanavati added a commit that referenced this pull request Sep 15, 2026
* Scope overwrite_from_index_token to same-namespace images without path-scoped Docker auth (#1370)

Fixes CLOUDDST-32419 and CLOUDDST-32824 by applying the overwrite token only
where worker Docker config cannot already pull the image, and by avoiding
blanket token stamping that broke unrelated private fragments and namespace
template credentials.

Co-authored-by: Tulsi Chandwani <tchandwa@tchandwa.users.ipa.redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* Scope overwrite_from_index_token at the containerized handler call sites

cca5101 (#1370) landed the scoping primitives -- docker_config_has_path_auth_for_image,
get_images_needing_overwrite_token and the list-aware set_registry_token -- and
converted the old worker architecture to use them. The containerized handlers
were left on the pre-fix pattern, so CLOUDDST-32419 and CLOUDDST-32824 still
reproduce on every request routed to build_containerized_*.

Port the call sites, applying the token only where worker Docker config cannot
already pull the image:

- build_containerized_add: the bundle resolve stamped from_index rather than the
  bundles it actually pulls, so a private same-namespace bundle failed while an
  unrelated namespace lost its template credentials. Scope it to the bundles
  instead. _opm_registry_add pulls every bundle again after that window has
  closed and was entirely unguarded; give it the same scoped window over the
  digest-resolved specs.

- build_containerized_fbc_operations: collapse the per-fragment loop of
  unfiltered context managers into one scoped window, and pass from_index down
  to opm_registry_add_fbc_fragment_containerized.

- opm_operations.opm_registry_add_fbc_fragment_containerized: takes from_index
  and scopes the extract loop, which pulls each fragment. set_registry_token
  no-ops on an empty list, so one window covers both the "some fragments need
  the token" and "none do" cases. The utils import stays function-local --
  utils imports get_list_bundles from this module, so a top-level import would
  be circular.

- Opm.set_opm_version reads a label off from_index via skopeo inspect and was
  unguarded in add, rm and fbc-operations; a private index failed there before
  reaching any of the above. Wrap all three.

from_index auth is deliberately not stamped at the bundle and fragment resolve
steps: those calls do not pull the index. prepare_request_for_build and the
later from_index accessors carry the token for the index itself.

utils.set_registry_auths gains a docstring note that it restores the
iib_docker_config_template baseline on exit rather than the configuration in
place on entry, so nesting it inside another credential window drops that outer
window's auths. No caller does this today; the note is to keep it that way.

Tests seed _load_docker_config_auths with a registry-only key to confirm that
registry-level auth does not count as path-scoped coverage. The two rm tests
that reach the credential path now mock set_registry_token -- previously they
called through to the real set_registry_auths, which writes to the developer's
~/.docker/config.json.

build_containerized_merge is intentionally left for a follow-up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>

---------

Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
Co-authored-by: Tulsi Chandwani <17147736+chandwanitulsi@users.noreply.github.com>
Co-authored-by: Tulsi Chandwani <tchandwa@tchandwa.users.ipa.redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@fullsend-ai-retro fullsend-ai-retro Bot mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants