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

Slice 2: Use ModInstance type in mod deployment code (2/3) #9190

Open
wants to merge 3 commits into
base: feature/devex-mod-instance
Choose a base branch
from

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Sep 22, 2024

@twschiller twschiller added the do not merge Merging of this PR is blocked by another one label Sep 22, 2024
@twschiller twschiller self-assigned this Sep 22, 2024
@twschiller twschiller changed the base branch from main to feature/devex-mod-instance September 22, 2024 14:47
Copy link

Playwright test results

failed  6 failed
passed  5 passed
flaky  1 flaky
skipped  122 skipped

Details

report  Open report ↗︎
stats  134 tests across 44 suites
duration  2 minutes, 11 seconds
commit  d9f410a
info  For more information on how to debug and view this report, see our readme

Failed tests

chrome-setup › setup/affiliated.setup.ts › authenticate with affiliated user
msedge-setup › setup/affiliated.setup.ts › authenticate with affiliated user
chrome-setup › setup/affiliated.setup.ts › authenticate with affiliated user
msedge-setup › setup/affiliated.setup.ts › authenticate with affiliated user
chrome-setup › setup/affiliated.setup.ts › authenticate with affiliated user
msedge-setup › setup/affiliated.setup.ts › authenticate with affiliated user

Flaky tests

chrome-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user

Skipped tests

chrome › tests/bricks/sidebarEffects.spec.ts › sidebar effect bricks › toggle sidebar brick
msedge › tests/bricks/sidebarEffects.spec.ts › sidebar effect bricks › toggle sidebar brick
chrome › tests/deployments/deploymentActivation.spec.ts › activate a deployed mod in the extension console
msedge › tests/deployments/deploymentActivation.spec.ts › activate a deployed mod in the extension console
chrome › tests/extensionConsole/activation.spec.ts › can activate a mod with no config options
chrome › tests/extensionConsole/activation.spec.ts › can activate a mod with built-in integration
chrome › tests/extensionConsole/activation.spec.ts › validates activating a mod with required integrations
chrome › tests/extensionConsole/activation.spec.ts › can activate a mod with a database
chrome › tests/extensionConsole/activation.spec.ts › activating a mod when the quickbar shortcut is not configured
chrome › tests/extensionConsole/activation.spec.ts › can activate a mod via url
msedge › tests/extensionConsole/activation.spec.ts › can activate a mod with no config options
msedge › tests/extensionConsole/activation.spec.ts › can activate a mod with built-in integration
msedge › tests/extensionConsole/activation.spec.ts › validates activating a mod with required integrations
msedge › tests/extensionConsole/activation.spec.ts › can activate a mod with a database
msedge › tests/extensionConsole/activation.spec.ts › activating a mod when the quickbar shortcut is not configured
msedge › tests/extensionConsole/activation.spec.ts › can activate a mod via url
chrome › tests/extensionConsole/modsPage.spec.ts › can open mod in the workshop
msedge › tests/extensionConsole/modsPage.spec.ts › can open mod in the workshop
chrome › tests/extensionConsole/zapierModal.spec.ts › Zapier Integration Modal › can copy Zapier key and close modal
msedge › tests/extensionConsole/zapierModal.spec.ts › Zapier Integration Modal › can copy Zapier key and close modal
chrome › tests/modLifecycle.spec.ts › create, run, package, and update mod
msedge › tests/modLifecycle.spec.ts › create, run, package, and update mod
chrome › tests/pageEditor/addStarterBrick.spec.ts › Add new starter brick
chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add new starter brick
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
chrome › tests/pageEditor/brickActions.spec.ts › brick actions panel behavior
msedge › tests/pageEditor/brickActions.spec.ts › brick actions panel behavior
chrome › tests/pageEditor/brickConfiguration.spec.ts › brick configuration
msedge › tests/pageEditor/brickConfiguration.spec.ts › brick configuration
chrome › tests/pageEditor/copyMod.spec.ts › copying a mod that uses the PixieBrix API is copied correctly
chrome › tests/pageEditor/copyMod.spec.ts › run a copied mod with a built-in integration
msedge › tests/pageEditor/copyMod.spec.ts › copying a mod that uses the PixieBrix API is copied correctly
msedge › tests/pageEditor/copyMod.spec.ts › run a copied mod with a built-in integration
chrome › tests/pageEditor/liveEditing.spec.ts › live editing behavior
msedge › tests/pageEditor/liveEditing.spec.ts › live editing behavior
chrome › tests/pageEditor/logsPane.spec.ts › can view error logs
msedge › tests/pageEditor/logsPane.spec.ts › can view error logs
chrome › tests/pageEditor/modEditorPane.spec.ts › mod editor pane behavior
msedge › tests/pageEditor/modEditorPane.spec.ts › mod editor pane behavior
chrome › tests/pageEditor/saveMod.spec.ts › can save a standalone trigger mod
msedge › tests/pageEditor/saveMod.spec.ts › can save a standalone trigger mod
chrome › tests/pageEditor/saveMod.spec.ts › shows error notification when updating a public mod without incrementing the version
msedge › tests/pageEditor/saveMod.spec.ts › shows error notification when updating a public mod without incrementing the version
chrome › tests/pageEditor/specialPages.spec.ts › Restricted browser page
chrome › tests/pageEditor/specialPages.spec.ts › Unavailable mod
chrome › tests/pageEditor/specialPages.spec.ts › Page Editor reload
msedge › tests/pageEditor/specialPages.spec.ts › Restricted browser page
msedge › tests/pageEditor/specialPages.spec.ts › Unavailable mod
msedge › tests/pageEditor/specialPages.spec.ts › Page Editor reload
chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/regressions/formFlicker.spec.ts › forms flickering due to components unexpectedly unmounting/remounting › #8320: Search field loses focus while typing on snippet mod
msedge › tests/regressions/formFlicker.spec.ts › forms flickering due to components unexpectedly unmounting/remounting › #8320: Search field loses focus while typing on snippet mod
chrome › tests/regressions/hideModalsOnPageEditorRefresh.spec.ts › should hide add brick modal when Page Editor refreshes
msedge › tests/regressions/hideModalsOnPageEditorRefresh.spec.ts › should hide add brick modal when Page Editor refreshes
chrome › tests/regressions/sandboxBrickErrors.spec.ts › #8821: ensure Javascript script errors are thrown during brick runtime
msedge › tests/regressions/sandboxBrickErrors.spec.ts › #8821: ensure Javascript script errors are thrown during brick runtime
chrome › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links from the sidebar doesn't crash browser
msedge › tests/regressions/sidebarLinks.spec.ts › #8206: clicking links from the sidebar doesn't crash browser
chrome › tests/regressions/welcomeStarterBricks.spec.ts › #8740: can view the starter mods on the pixiebrix.com/welcome page
msedge › tests/regressions/welcomeStarterBricks.spec.ts › #8740: can view the starter mods on the pixiebrix.com/welcome page
chrome › tests/runtime/allFrames.spec.ts › 8527: availability allFrames declaration
msedge › tests/runtime/allFrames.spec.ts › 8527: availability allFrames declaration
chrome › tests/runtime/customEvents.spec.ts › custom event brick functionality
msedge › tests/runtime/customEvents.spec.ts › custom event brick functionality
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
chrome › tests/runtime/insertAtCursor.spec.ts › Insert at Cursor › 8157: can insert at cursor from side bar
chrome › tests/runtime/insertAtCursor.spec.ts › Insert at Cursor › 8154: can insert at cursor after opening sidebar from selection menu
msedge › tests/runtime/insertAtCursor.spec.ts › Insert at Cursor › 8157: can insert at cursor from side bar
msedge › tests/runtime/insertAtCursor.spec.ts › Insert at Cursor › 8154: can insert at cursor after opening sidebar from selection menu
chrome › tests/runtime/localIntegrations.spec.ts › Local Integrations Page › can create a new integration
chrome › tests/runtime/localIntegrations.spec.ts › Local Integrations Page › #8067: blank numeric text integration configuration field validated on save
msedge › tests/runtime/localIntegrations.spec.ts › Local Integrations Page › can create a new integration
msedge › tests/runtime/localIntegrations.spec.ts › Local Integrations Page › #8067: blank numeric text integration configuration field validated on save
chrome › tests/runtime/screenshotTab.spec.ts › screenshot tab brick functionality
msedge › tests/runtime/screenshotTab.spec.ts › screenshot tab brick functionality
chrome › tests/runtime/setInputValue.spec.ts › can set input value
msedge › tests/runtime/setInputValue.spec.ts › can set input value
chrome › tests/runtime/sidebar/sidebarActivation.spec.ts › initiates sidebar mod activation from activate url click
msedge › tests/runtime/sidebar/sidebarActivation.spec.ts › initiates sidebar mod activation from activate url click
chrome › tests/runtime/sidebar/sidebarActivation.spec.ts › does not redirect to non-pixiebrix domain
msedge › tests/runtime/sidebar/sidebarActivation.spec.ts › does not redirect to non-pixiebrix domain
chrome › tests/runtime/sidebar/sidebarAuth.spec.ts › Connect action in partner auth sidebar takes user to the Extension Console
msedge › tests/runtime/sidebar/sidebarAuth.spec.ts › Connect action in partner auth sidebar takes user to the Extension Console
chrome › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › can open sidebar immediately from iframe without focus dialog
chrome › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › shows focus dialog in top-level frame
chrome › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › prevents host page styles from leaking into dialog
msedge › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › can open sidebar immediately from iframe without focus dialog
msedge › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › shows focus dialog in top-level frame
msedge › tests/runtime/sidebar/sidebarController.spec.ts › sidebar controller › prevents host page styles from leaking into dialog
chrome › tests/runtime/sidebar/sidebarNavigation.spec.ts › sidebar mod panels are persistent during navigation
chrome › tests/runtime/sidebar/sidebarNavigation.spec.ts › sidebar form and temporary panels are unavailable after navigation
msedge › tests/runtime/sidebar/sidebarNavigation.spec.ts › sidebar mod panels are persistent during navigation
msedge › tests/runtime/sidebar/sidebarNavigation.spec.ts › sidebar form and temporary panels are unavailable after navigation
chrome › tests/runtime/sidebar/sidebarPanelTheme.spec.ts › custom sidebar theme css file is applied to all levels of sidebar document
msedge › tests/runtime/sidebar/sidebarPanelTheme.spec.ts › custom sidebar theme css file is applied to all levels of sidebar document
chrome › tests/runtime/srcdocFrames.spec.ts › 8143: mods can run in srcdoc iframes
msedge › tests/runtime/srcdocFrames.spec.ts › 8143: mods can run in srcdoc iframes
chrome › tests/runtime/textSnippets.spec.ts › text snippet shortcut functionality
msedge › tests/runtime/textSnippets.spec.ts › text snippet shortcut functionality
chrome › tests/smoke/floatingActionButton.spec.ts › sidebar page smoke test › can toggle the sidebar from the floating action button and view the related mod's sidebar panel
chrome › tests/smoke/floatingActionButton.spec.ts › sidebar page smoke test › can hide the floating action button
msedge › tests/smoke/floatingActionButton.spec.ts › sidebar page smoke test › can toggle the sidebar from the floating action button and view the related mod's sidebar panel
msedge › tests/smoke/floatingActionButton.spec.ts › sidebar page smoke test › can hide the floating action button
chrome › tests/smoke/modsPage.spec.ts › extension console mods page smoke test › can view available mods
msedge › tests/smoke/modsPage.spec.ts › extension console mods page smoke test › can view available mods
chrome › tests/smoke/pageEditor.spec.ts › page editor smoke test › can open the page editor and connect to an open tab
msedge › tests/smoke/pageEditor.spec.ts › page editor smoke test › can open the page editor and connect to an open tab
chrome › tests/smoke/sidebar.spec.ts › sidebar page smoke test › can open the sidebar from selection menu action and view the related mod's sidebar panel
msedge › tests/smoke/sidebar.spec.ts › sidebar page smoke test › can open the sidebar from selection menu action and view the related mod's sidebar panel
chrome › tests/smoke/workshopPage.spec.ts › extension console workshop smoke test › can navigate to workshop page without a username
msedge › tests/smoke/workshopPage.spec.ts › extension console workshop smoke test › can navigate to workshop page without a username
chrome › tests/telemetry/errors.spec.ts › can report errors to telemetry service
chrome › tests/telemetry/errors.spec.ts › can report a service worker error to telemetry service
chrome › tests/telemetry/errors.spec.ts › can report an indexdb error to telemetry service
msedge › tests/telemetry/errors.spec.ts › can report errors to telemetry service
msedge › tests/telemetry/errors.spec.ts › can report a service worker error to telemetry service
msedge › tests/telemetry/errors.spec.ts › can report an indexdb error to telemetry service
chrome › tests/workshop/createMod.spec.ts › can create a new mod from a yaml definition and update it
msedge › tests/workshop/createMod.spec.ts › can create a new mod from a yaml definition and update it

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 91.01124% with 8 lines in your changes missing coverage. Please review.

Project coverage is 74.83%. Comparing base (5f53bcc) to head (d9f410a).
Report is 1 commits behind head on feature/devex-mod-instance.

Files with missing lines Patch % Lines
src/background/teamTrialUpdater.ts 0.00% 8 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/devex-mod-instance    #9190      +/-   ##
==============================================================
+ Coverage                       74.77%   74.83%   +0.05%     
==============================================================
  Files                            1363     1364       +1     
  Lines                           41977    41985       +8     
  Branches                         7835     7833       -2     
==============================================================
+ Hits                            31390    31419      +29     
+ Misses                          10587    10566      -21     

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

@twschiller twschiller changed the base branch from feature/devex-mod-instance to main September 22, 2024 14:53
@twschiller twschiller changed the base branch from main to feature/devex-mod-instance September 22, 2024 14:55
/**
* Deployment installed on the client. A deployment may be installed but not active (see DeploymentContext.active)
*/
export type InstalledDeployment = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move to contracts.ts because it's a backend type

@twschiller twschiller changed the title Use ModInstance type in mod deployment code (2/2) Use ModInstance type in mod deployment code (2/3) Sep 22, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a new file (the other file was deleted) — GitHub getting provenance wrong

@@ -258,3 +258,18 @@ export type PackageVersionUpdates = {

export type OrganizationAuthUrlPattern =
components["schemas"]["OrganizationAuthUrlPattern"];

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to contract because the fields are defined by the backend. (Our Swagger is missing the exact shape of this part of the POST request 🤷 )

*
* @see mapModComponentDefinitionToActivatedModComponent
*/
export function mapModInstanceToActivatedModComponents(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adapter going in the reverse direction

@twschiller twschiller changed the title Use ModInstance type in mod deployment code (2/3) Slice 2: Use ModInstance type in mod deployment code (2/3) Sep 24, 2024
deployments: modComponentsToDeactivate
.map((x) => x._deployment?.id)
.filter((x) => x != null),
deployments: uniq(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would there be duplicate mods?

Copy link
Contributor Author

@twschiller twschiller Sep 27, 2024

Choose a reason for hiding this comment

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

I think you mean deployment ids? There shouldn't be ever the same deployment id across mod instances. This is just slightly more defensive. But I agree we could drop the uniq

.map((x) => x._deployment?.id)
.filter((x) => x != null),
deployments: uniq(
unassignedModInstances
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30% time developer experience do not merge Merging of this PR is blocked by another one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants