Skip to content

Omit Node Info rendering for 4.18 and earlier#787

Draft
sdodson wants to merge 3 commits into
openshift:mainfrom
sdodson:omit-node-info-4.18-and-earlier
Draft

Omit Node Info rendering for 4.18 and earlier#787
sdodson wants to merge 3 commits into
openshift:mainfrom
sdodson:omit-node-info-4.18-and-earlier

Conversation

@sdodson

@sdodson sdodson commented Jun 29, 2026

Copy link
Copy Markdown
Member

rpmdb collection on 4.18 and earlier requires pulling the entire rhel-coreos image. 4.19+ stores the rpmdb separately, making it significantly cheaper.

Changes

Adds ReleaseTagHasCheapRpmdb() to pkg/release-controller/semver.go, which returns false for 4.x tags where x <= 18. Unparseable tags (nightlies, CI builds) are not gated.

Uses the new function to skip Node Info in three places:

  • getChangeLog() / renderChangeLog() — HTML page and compare page
  • apiReleaseInfo() — API endpoint (/api/v1/releasestream/{release}/release/{tag})

For gated releases the API response will have a null nodeImageStreams field, which is already a valid state. The #node-image-info anchor links that oc may emit in the changelog body for older releases are left as dead anchors for now.

sdodson added 3 commits June 5, 2026 15:19
Profiling the changelog handler for a two-release diff
(4.22.0-rc.4 → 4.22.0-rc.5, two machine-OS streams) showed the
following oc invocations in the NodeImageSectionMarkdown path:

  Step                                     Duration
  oc adm release info -o json <to>          ~4.2s   ListMachineOSStreams
  oc adm release info --image-for \
    rhel-coreos <from>                       ~4.1s   ImageReferenceForComponent
  oc adm release info --image-for \
    rhel-coreos-10 <from>                    ~4.0s   ImageReferenceForComponent
  oc adm release info --rpmdb-diff ...      ~18s    RpmDiffForStream (×2)

The two --image-for calls together added ~8 seconds of wall time per
changelog request. Each invoked a separate oc process for data that is
already present in the release JSON: references.spec.tags[*].from.name
contains the full pullspec for every component in the release, and that
JSON is already cached in groupcache under the "releaseinfo" key.

Changes:
- Extend releaseInfoImageRefs with from.name so imageRefFromReleaseJSON
  can extract pullspecs from the cached release JSON.
- ExecReleaseInfo.ImageReferenceForComponent now calls ReleaseInfo() and
  parses the JSON instead of shelling out to oc --image-for.
- CachingReleaseInfo "imagefor" groupcache getter fetches "releaseinfo"
  via cache.Get and parses locally — no extra oc invocation.
- CachingReleaseInfo "machineosstreams" getter likewise reads from the
  "releaseinfo" cache entry instead of calling info.ListMachineOSStreams
  (which bypassed groupcache and ran oc independently), eliminating a
  duplicate oc adm release info -o json call per request.

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
ImageReferenceForComponent now resolves from groupcache (JSON parse,
no oc subprocess, no /tmp/rpmdb/ access) after the --image-for
elimination. Move it outside the RpmdbOCSlots semaphore in both
NodeImageSectionMarkdown and the API handler so the slot is only held
during RpmListForStream and RpmDiffForStream — the calls that actually
spawn oc subprocesses and write to /tmp/rpmdb/.

On a cold cache with two machine-OS streams, profiling showed:
  ImageReferenceForComponent × 2:  ~8s  (now outside semaphore)
  RpmListForStream × 2:            ~8s  (inside semaphore)
  RpmDiffForStream × 2:           ~18s  (inside semaphore)

This reduces per-request semaphore hold time from ~34s to ~26s,
allowing more concurrent changelog requests to proceed before the
16-slot limit causes 429 responses. On a freshly restarted controller
where hundreds of release pages hit the semaphore simultaneously, this
frees ~8 seconds of slot time per request for other callers.

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
rpmdb collection on 4.18 and earlier requires pulling the entire
rhel-coreos image. 4.19+ stores the rpmdb separately, making it
significantly cheaper.

Add ReleaseTagHasCheapRpmdb() which returns false for 4.x tags
where x <= 18, and use it to skip Node Info in:
- getChangeLog() / renderChangeLog() (HTML page and compare page)
- apiReleaseInfo() (API endpoint)

Unparseable tags (nightlies, CI builds) are not gated.

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6d18c4b3-91df-44ac-905f-0a2d34354d10

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2026
@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sdodson
Once this PR has been reviewed and has the lgtm label, please assign jupierce 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant