-
Notifications
You must be signed in to change notification settings - Fork 1
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
UI-9526 - Ensures that the behaviorOnError
flag is respected
#128
Conversation
@@ -68,7 +68,7 @@ export const getMigrateSavedWidgets = | |||
|
|||
for (const fileId in content.children) { | |||
if (errorReport.widgets?.[fileId] && behaviorOnError !== "keep-going") { | |||
return; | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, returning here would cause the entire script to "short-circuit" causing none of the remaining widgets to be migrated.
src/4.3_to_5.0/__test_resources__/smallLegacyUIFolderWithInvalidWidget.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions:
src/4.3_to_5.0/migrate_43_to_50.ts
Outdated
@@ -434,19 +434,6 @@ export async function migrate_43_to_50( | |||
}); | |||
counters.widgets.success++; | |||
} catch (error) { | |||
if (error instanceof PartialMigrationError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make a difference to move this block after the call to _addErrorToReport
? I don't mind, but just trying to understand the change.
@@ -1336,7 +1336,7 @@ exports[`migrate_43_to_50 returns a valid ActiveUI5 /ui folder on a real life in | |||
"entry": { | |||
"canRead": true, | |||
"canWrite": true, | |||
"content": "{}", | |||
"content": "{"name":"Page filters","type":"container","value":{"style":{},"showTitleBar":true,"body":{},"containerKey":"filters"}}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you understand this change?
@@ -1608,7 +1608,7 @@ exports[`migrate_43_to_50 returns a valid ActiveUI5 /ui folder on a real life in | |||
"entry": { | |||
"canRead": true, | |||
"canWrite": true, | |||
"content": "{"name":"Page filters","widgetKey":"filters"}", | |||
"content": "{"name":"Page filters"}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here.
src/4.3_to_5.0/migrate_43_to_50.ts
Outdated
// The migration failed. | ||
// The widget is kept as is. | ||
migratedWidget = bookmark; | ||
widgets[fileId] = migratedWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to do this here? Isn't it already taken care of in
widgets[fileId] = migratedWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nouzbe I undid my changes within migrate_4.3_to_5.0
as indeed, preserving the bookmarks content was handled by this. There was a slight modification to one of the tests but all tests should still pass. This makes this PR more simple 👍
Co-authored-by: Benjamin Amelot <[email protected]>
Co-authored-by: Benjamin Amelot <[email protected]>
Co-authored-by: Benjamin Amelot <[email protected]>
…the bookmark was already handled
@Nouzbe I'm passing this back to you. In my latest commit, I undid the changes to
The existing changes were already valid though, just keeping the Please let me know if you have any other questions or concerns, I'm happy to address them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Summary
This PR ensures that when a 4.3 widget is being migrated, if it throws an error, it is kept as is and that the remaining widgets are still migrated as expected.
Testing
All tests should pass.