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

#8579 & #8614: Migrate mod component form state #8734

Merged
merged 15 commits into from
Jul 1, 2024

Conversation

grahamlangford
Copy link
Collaborator

@grahamlangford grahamlangford commented Jul 1, 2024

What does this PR do?

Remaining Work

  • Validate linting and unit tests are passing
  • Migrate/rename more nested form state values
    • eg blockPipeline -> brickPipeline

Checklist

  • Added jest or playwright tests and/or storybook stories

For more information on our expectations for the PR process, see the
code review principles doc

@grahamlangford grahamlangford requested review from twschiller and BLoe July 1, 2024 15:41
@grahamlangford grahamlangford marked this pull request as ready for review July 1, 2024 15:59
availableActivatedModComponentIds: availableInstalledIds,
isPendingAvailableActivatedModComponents: isPendingInstalledExtensions,
availableDraftModComponentIds: availableDynamicIds,
isPendingDraftModComponents: isPendingDynamicExtensions,
};
}

function migrateFormStateV2(state: BaseFormStateV2): BaseFormStateV3 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual redux-persist migrations

Copy link

github-actions bot commented Jul 1, 2024

Playwright test results

passed  82 passed
skipped  2 skipped

Details

report  Open report ↗︎
stats  84 tests across 29 suites
duration  11 minutes, 55 seconds
commit  12df107

Skipped tests

chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
edge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

RegistryId,
ModComponentFormState[]
>;
deletedModComponentFormStatesByModId: Record<RegistryId, BaseFormStateV2[]>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure we're pointing to the previous BaseFormState in the previous EditorState

@twschiller
Copy link
Contributor

At first glance looking good. A callout on mod naming here: https://github.com/pixiebrix/pixiebrix-extension/pull/8734/files#r1661264032

@grahamlangford grahamlangford marked this pull request as draft July 1, 2024 16:07
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 75.65789% with 37 lines in your changes missing coverage. Please review.

Project coverage is 74.25%. Comparing base (8318d74) to head (12df107).
Report is 1 commits behind head on main.

Files Patch % Lines
src/pageEditor/slices/editorSlice.ts 42.85% 4 Missing ⚠️
src/pageEditor/starterBricks/quickBarProvider.ts 0.00% 4 Missing ⚠️
...c/pageEditor/sidebar/DraftModComponentListItem.tsx 50.00% 3 Missing ⚠️
src/pageEditor/slices/editorSelectors.ts 25.00% 3 Missing ⚠️
src/pageEditor/starterBricks/quickBar.ts 25.00% 3 Missing ⚠️
src/pageEditor/analysisManager.ts 33.33% 2 Missing ⚠️
src/pageEditor/sidebar/modals/CreateModModal.tsx 0.00% 2 Missing ⚠️
src/pageEditor/starterBricks/base.ts 33.33% 2 Missing ⚠️
...quickBarProvider/QuickBarProviderConfiguration.tsx 0.00% 2 Missing ⚠️
src/store/editorMigrations.ts 80.00% 2 Missing ⚠️
... and 10 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8734   +/-   ##
=======================================
  Coverage   74.24%   74.25%           
=======================================
  Files        1332     1332           
  Lines       40817    40828   +11     
  Branches     7634     7634           
=======================================
+ Hits        30306    30315    +9     
- Misses      10511    10513    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -39,6 +41,7 @@ export const migrations: MigrationManifest = {
1: (state) => state,
2: (state: EditorStateV1 & PersistedState) => migrateEditorStateV1(state),
3: (state: EditorStateV2 & PersistedState) => migrateEditorStateV2(state),
4: (state: EditorStateV3 & PersistedState) => migrateEditorStateV3(state),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented migration here

@grahamlangford grahamlangford marked this pull request as ready for review July 1, 2024 17:06
@@ -15,4 +15,4 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

export const PIPELINE_BLOCKS_FIELD_NAME = "extension.blockPipeline";
export const PIPELINE_BRICKS_FIELD_NAME = "modComponent.brickPipeline";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debated going through the code and replacing hardcoded "modComponent.brickPipeline..." strings with joinPathParts(PIPELINE_BRICKS_FIELD_NAME, ...), but decided that could be left for later

Copy link
Contributor

@BLoe BLoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link

github-actions bot commented Jul 1, 2024

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@grahamlangford grahamlangford enabled auto-merge (squash) July 1, 2024 18:54
@grahamlangford grahamlangford merged commit ecd0763 into main Jul 1, 2024
18 checks passed
@grahamlangford grahamlangford deleted the migrate-mod-component-form-state branch July 1, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants