Skip to content
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

Wizard: Fix blueprint name update on Architecture/Distribution changes (HMS-5556) #2936

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgold1234
Copy link
Collaborator

@mgold1234 mgold1234 commented Feb 25, 2025

This commit resolves an issue where the blueprint name did not update when the user changed the Architecture or Distribution.
Additionally, it sets an initial value for blueprintName in the WizardSlice.

FIX ISSUE: #2929

JIRA: HMS-5556

@mgold1234
Copy link
Collaborator Author

/jira-epic HMS-5294

@schutzbot schutzbot changed the title Wizard: fix the bluprint name update when changing Arc or Distribution Wizard: fix the bluprint name update when changing Arc or Distribution (HMS-5556) Feb 25, 2025
@mgold1234 mgold1234 force-pushed the removing branch 3 times, most recently from 473ed4d to b9dc3f6 Compare February 25, 2025 13:22
@mgold1234 mgold1234 marked this pull request as draft February 25, 2025 13:28
@mgold1234 mgold1234 force-pushed the removing branch 6 times, most recently from e80f4ad to 3055c43 Compare March 4, 2025 10:17
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.19%. Comparing base (716c0bf) to head (84b219b).

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2936      +/-   ##
==========================================
- Coverage   85.19%   85.19%   -0.01%     
==========================================
  Files         167      167              
  Lines       20904    20901       -3     
  Branches     2104     2103       -1     
==========================================
- Hits        17810    17807       -3     
  Misses       3076     3076              
  Partials       18       18              
Files with missing lines Coverage Δ
...mponents/CreateImageWizard/steps/Details/index.tsx 100.00% <100.00%> (ø)
...ents/CreateImageWizard/steps/ImageOutput/index.tsx 100.00% <100.00%> (ø)
...omponents/CreateImageWizard/steps/Review/index.tsx 100.00% <ø> (ø)
...nents/CreateImageWizard/utilities/requestMapper.ts 95.20% <100.00%> (+<0.01%) ⬆️
...ateImageWizard/utilities/useGenerateDefaultName.ts 100.00% <100.00%> (ø)

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 716c0bf...84b219b. 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.

@mgold1234 mgold1234 marked this pull request as ready for review March 4, 2025 10:27
@regexowl
Copy link
Collaborator

regexowl commented Mar 6, 2025

Thanks for working on fixing this, works really nicely! ❤️

If we populate default name on Image Output step, we can probably get rid of useGenerateDefaultName() on Details and Review steps.

Could you also please add two tests? One to check the name gets updated with changes and second to check that custom blueprint name doesn't get overwritten.

@mgold1234
Copy link
Collaborator Author

mgold1234 commented Mar 9, 2025

@regexowl Thank you for your comments. I didn’t remove it from the Details and Review steps because sometimes, when a user opens the Review step for the first time, the blueprint name doesn’t update. Keeping it prevents this issue from happening.

Screen.Recording.2025-03-09.at.19.11.31.mov

@regexowl
Copy link
Collaborator

I see, the name is not populated until the release/arch are changed. Wouldn't that be a bug though? I mean depends on the scope of this PR, but we could both populate and update the name on the Image Output step.

@mgold1234 mgold1234 force-pushed the removing branch 3 times, most recently from 5650989 to cbb70f7 Compare March 10, 2025 13:26
@mgold1234
Copy link
Collaborator Author

mgold1234 commented Mar 10, 2025

@regexowl The name is populated when there is a value in the release/architecture, not just after it's populated. However, there is sometimes a delay, causing the blueprint not to update consistently on the first render. I explored several solutions, and I found that limiting the name generation to the Review step — and removing it from the Details step — resolves the issue with the initial render.
wdyt?

@regexowl
Copy link
Collaborator

I'm not sure I get it. This way if you click through to the Details step the Blueprint name is empty, but we still allow the user to proceed. Which I think is not really what we want as the empty Blueprint name input should be invalid and block the "Next" button, right?

image

I've tried to follow through updating of the blueprint name on the Image output step. The hook seems to be triggered correctly, but what I'd guess is happening is that the blueprintName initial value (which is an empty string) overrides the default name that gets generated before it. What if we set the proper default name as an initial value? We already have a function we could use for that and default release and arch are also set.

@mgold1234 mgold1234 force-pushed the removing branch 2 times, most recently from da3105b to 5b7c681 Compare March 10, 2025 14:28
@mgold1234 mgold1234 changed the title Wizard: Fix blueprint name update when changing Architecture or Distribution (HMS-5556) Wizard: Wizard: Fix blueprint name update on Architecture/Distribution changes (HMS-5556) Mar 13, 2025
@mgold1234 mgold1234 requested a review from lucasgarfield March 13, 2025 11:01
@mgold1234 mgold1234 force-pushed the removing branch 3 times, most recently from 06d31dc to 965fedb Compare March 16, 2025 11:50
@mgold1234
Copy link
Collaborator Author

need to update ':test_blueprint_import' in iqe_test

@regexowl
Copy link
Collaborator

regexowl commented Mar 17, 2025

need to update ':test_blueprint_import' in iqe_test

Based on the error in IQE tests, this looks like we're overwriting a custom name with the changes. Which shouldn't be the case 🤔

@mgold1234
Copy link
Collaborator Author

the IQE TEST found real bug :)
I updated the flag of isCustomName to True in the correct place, now all tests should pass

@mgold1234
Copy link
Collaborator Author

mgold1234 commented Mar 17, 2025

@regexowl yesterday I checked the import scenario by mistake in a different pr, and it was working good, so I thought I miss something in the IQE test :)
thank you for pointing this out

@mgold1234 mgold1234 changed the title Wizard: Wizard: Fix blueprint name update on Architecture/Distribution changes (HMS-5556) Wizard: Fix blueprint name update on Architecture/Distribution changes (HMS-5556) Mar 17, 2025
@mgold1234 mgold1234 force-pushed the removing branch 7 times, most recently from 6266120 to cb476db Compare March 19, 2025 13:41
@mgold1234 mgold1234 force-pushed the removing branch 5 times, most recently from 1b1e082 to cd4261d Compare March 23, 2025 13:04
This commit resolves an issue where the blueprint name did not update when the user changed the Architecture or Distribution.
Additionally, it sets an initial value for blueprintName in the WizardSlice.
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