Skip to content

Prevent overwriting changes to prefilled data in model catalog register form #3921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mturley
Copy link
Contributor

@mturley mturley commented Mar 13, 2025

Resolves https://issues.redhat.com/browse/RHOAIENG-21573

Description

This is a hacky fix, a better fix would be to refactor this page so it fetches catalog data before mounting its state hook and avoids prefilling in a useEffect. Opened a followup issue for that refactor: https://issues.redhat.com/browse/RHOAIENG-21678

How Has This Been Tested?

  • Go to Model Catalog, click on a model
  • Click "Register model"
  • Edit one of the fields in the form
  • Wait at least 30 seconds
  • See that your edits are not reset to the initial prefilled data

Test Impact

I attempted to write a Cypress test for this and ran into issues. This fix is low-risk and easy to verify - following up to add a test is covered in the tech debt issue https://issues.redhat.com/browse/RHOAIENG-21678. See that issue's description for context on the trouble I had.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Mar 13, 2025
@openshift-ci openshift-ci bot requested review from alexcreasy and dpanshug March 13, 2025 17:10
@mturley mturley force-pushed the RHOAIENG-21573-register-catalog-prefill-workaround branch from 8a401d1 to 63de336 Compare March 13, 2025 19:26
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.47%. Comparing base (5440381) to head (9cbf8b1).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3921      +/-   ##
==========================================
- Coverage   84.47%   84.47%   -0.01%     
==========================================
  Files        1580     1580              
  Lines       37566    37568       +2     
  Branches    10592    10592              
==========================================
  Hits        31734    31734              
- Misses       5832     5834       +2     

see 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5440381...9cbf8b1. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mturley mturley force-pushed the RHOAIENG-21573-register-catalog-prefill-workaround branch from 08ce77f to 9cbf8b1 Compare March 14, 2025 16:54
@mturley mturley changed the title WIP - Prevent overwriting changes to prefilled data in model catalog register form Prevent overwriting changes to prefilled data in model catalog register form Mar 14, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Mar 14, 2025
@YuliaKrimerman
Copy link
Contributor

/lgtm

@mturley
Copy link
Contributor Author

mturley commented Mar 14, 2025

/approve
Advisor self-approval with LGTM.
This gets the bug fixed in 2.19, we'll follow up in https://issues.redhat.com/browse/RHOAIENG-21678

Copy link
Contributor

openshift-ci bot commented Mar 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mturley, YuliaKrimerman

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

The pull request process is described here

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

@openshift-merge-bot openshift-merge-bot bot merged commit 3e8b8b2 into opendatahub-io:main Mar 14, 2025
36 checks passed
@mturley mturley deleted the RHOAIENG-21573-register-catalog-prefill-workaround branch March 14, 2025 20:50
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.

2 participants