Skip to content

NO-ISSUE: seed compute instance cache with correct response shape after create - #113

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
batzionb:fix/vm-details-not-found-flash
Aug 3, 2026
Merged

NO-ISSUE: seed compute instance cache with correct response shape after create#113
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
batzionb:fix/vm-details-not-found-flash

Conversation

@batzionb

@batzionb batzionb commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • After creating a VM, the details page briefly showed "Virtual machine not found" before rendering the real data a few seconds later.
  • Root cause: VmCreatePage seeded the query cache with the bare ComputeInstance from the create mutation, but useComputeInstance's select() expects the GetComputeInstanceResponse shape ({ object }) that client.get() actually returns. The shape mismatch made the freshly-seeded cache entry resolve to undefined, tripping the details page's !vm "not found" branch until the mutation's background refetch replaced it with correctly-shaped data.
  • Fix: seed the cache with { object: instance } instead of the bare instance.

Test plan

  • tsc -b tsconfig.build.json passes
  • pnpm --filter @osac/app-frontend run test — 453 tests pass
  • ESLint clean on the changed file
  • Reproduced the bug and verified the fix manually against a live cluster via the apps/playwright harness (create VM → details page loads directly, no "not found" flash)

Before

1-bug-vm-not-found-flash.webm

After

2-fix-vm-loads-directly.webm

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved VM creation state handling to ensure newly provisioned instances are stored and displayed reliably.

…eate

After creating a VM, VmCreatePage seeded the query cache with the bare
ComputeInstance returned by the create mutation, but useComputeInstance's
select() expects the GetComputeInstanceResponse shape ({ object }) that
client.get() actually returns. The mismatch made the freshly-seeded cache
read as undefined, so the details page briefly rendered "Virtual machine
not found" until the mutation's background refetch replaced it with the
correctly-shaped data a few seconds later.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: batzionb <brotman@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

VM creation cache

Layer / File(s) Summary
Wrap provisioned instance in cache entry
libs/ui-components/src/pages/tenant/VmCreatePage.tsx
The compute-instance query cache now stores the provisioned instance as { object: instance }.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: rawagner

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed The PR changes one line to wrap an instance as { object: instance }; the added content contains no API keys, tokens, passwords, private keys, credentials, or credential-bearing URLs.
No-Weak-Crypto ✅ Passed The commit only changes query-cache data shape; the full diff and referenced API files contain no weak algorithms, custom crypto, or secret comparisons.
No-Injection-Vectors ✅ Passed The sole changed line only wraps the created instance for query-cache shape; focused and structural scans found no SQL, shell, eval/exec, pickle, YAML, os.system, or dangerouslySetInnerHTML vector.
Container-Privileges ✅ Passed The PR changes only a TypeScript cache assignment; no privilege settings are added, and the container's production stage already runs as USER 1001.
No-Sensitive-Data-In-Logs ✅ Passed The PR changes only the query-cache shape; the added-line scan found no logging calls or sensitive-data terms.
Ai-Attribution ✅ Passed The PR mentions Claude Code, and HEAD includes Assisted-by: Claude Code <noreply@anthropic.com>; no AI-related Co-Authored-By trailer is present.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes seeding the compute instance cache with the correct response shape after VM creation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@batzionb batzionb changed the title fix: seed compute instance cache with correct response shape after create NO-ISSUE: seed compute instance cache with correct response shape after create Aug 2, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@batzionb: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • After creating a VM, the details page briefly showed "Virtual machine not found" before rendering the real data a few seconds later.
  • Root cause: VmCreatePage seeded the query cache with the bare ComputeInstance from the create mutation, but useComputeInstance's select() expects the GetComputeInstanceResponse shape ({ object }) that client.get() actually returns. The shape mismatch made the freshly-seeded cache entry resolve to undefined, tripping the details page's !vm "not found" branch until the mutation's background refetch replaced it with correctly-shaped data.
  • Fix: seed the cache with { object: instance } instead of the bare instance.

Test plan

  • tsc -b tsconfig.build.json passes
  • pnpm --filter @osac/app-frontend run test — 453 tests pass
  • ESLint clean on the changed file
  • Reproduced the bug and verified the fix manually against a live cluster via the apps/playwright harness (create VM → details page loads directly, no "not found" flash)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
  • Improved VM creation state handling to ensure newly provisioned instances are stored and displayed reliably.

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 openshift-eng/jira-lifecycle-plugin repository.

@rawagner

rawagner commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: batzionb, ElayAharoni

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [ElayAharoni,batzionb]

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 3631303 into osac-project:main Aug 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants