Skip to content

[OTA-2089] fall back to local source for plc_lookup - #45

Open
ankitathomas wants to merge 2 commits into
openshift:mainfrom
ankitathomas:plcc-products-json
Open

[OTA-2089] fall back to local source for plc_lookup#45
ankitathomas wants to merge 2 commits into
openshift:mainfrom
ankitathomas:plcc-products-json

Conversation

@ankitathomas

Copy link
Copy Markdown

Include product lifecycle data as a file in agentic-skills image and have plc_lookup.py use the local file if the products lifecycle API is unreachable, such as in a disconnected environment.

@openshift-ci
openshift-ci Bot requested review from Cali0707 and PratikMahajan July 29, 2026 15:05
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
Comment thread Containerfile Outdated
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS builder

RUN mkdir -p /cincinnati-graph-data && \
curl -L -o /cincinnati-graph-data/products.json https://access.redhat.com/product-life-cycles/api/v2/products || true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will fail in ART/Konflux builds, which happen in a hermetic, zero-egress environment to protect against bringing in potentially-dangerous content from the wider internet. If we want to go with the "bake a recent product snapshot into the skills image to ship with OCP" approach, we need to actually commit periodic snapshots of the product JSON to this repo in Git commits. And we can do that via OCPBUGS into 5.0.z releases, without needing to make any changes by the feature-development cutoff.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have an initial snapshot added to the PR and removed any changes to the Containerfiles. I can look into automating the snapshot PRs if this looks okay

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ankitathomas
Once this PR has been reviewed and has the lgtm label, please assign wking for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ankitathomas
ankitathomas requested a review from wking July 29, 2026 15:41
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

@ankitathomas: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/eval a8fabb4 link true /test eval

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jrangelramos jrangelramos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a few nits. Also perhaps data/product.json should be back to the repo (and later addressed/updated via PR with github action or something similar)

import urllib.request

API_BASE = "https://access.redhat.com/product-life-cycles/api/v2/products"
PRODUCTS_PATH = "data/products.json"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here it should resolve the full path first relative to the script dir

Suggested change
PRODUCTS_PATH = "data/products.json"
PRODUCTS_PATH = os.path.join(os.path.dirname(__file__), "data", "products.json")

othwise it shall fails when calling from outside the script dir

{
  "error": "file_open_error",
  "detail": "[Errno 2] No such file or directory: 'data/products.json'"
}

for i in body["data"]:
if "name" in i and cleaned_name in i["name"].lower():
result.append(i)
return {"data": result}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

here cmd_products() expects the returned data as a list and iterate over the result directly. Returning it inside a "data" fails to iterate over it.

Suggested change
return {"data": result}
return result

return body["data"]

result = []
cleaned_name=name.lower()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cleaned_name=name.lower()
cleaned_name = name.lower()

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