Skip to content

Conversation

@isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Aug 28, 2025

WHY are these changes introduced?

Fixes an issue with extension type matching in the context service.

WHAT is this pull request doing?

Match extensions with both identifier​ and external_identifier​ to support the case for both Partners and Dev Dash.

How to test your changes?

  1. Try to deploy a web-pixel extension after migration without UUIDs in the env file.

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentationchanges

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.54% (+0.01% 🔼)
13438/17110
🟡 Branches
72.55% (+0.04% 🔼)
6530/9001
🟡 Functions 78.82% 3501/4442
🟡 Lines
78.9% (+0.01% 🔼)
12700/16096
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
92% (-4% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

3194 tests passing in 1346 suites.

Report generated by 🧪jest coverage report action from 25baed5

@isaacroldan isaacroldan marked this pull request as ready for review August 28, 2025 11:53
@isaacroldan isaacroldan requested a review from a team as a code owner August 28, 2025 11:53
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20250828121047

Caution

After installing, validate the version by running just shopify in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Working as expected 👌

Comment on lines 28 to 33
return (
remote.type.toLowerCase() === local.graphQLType.toLowerCase() && slugify(remote.title) === slugify(local.handle)
(remote.type.toLowerCase() === local.graphQLType.toLowerCase() ||
remote.type.toLowerCase() === (local as ExtensionInstance).externalType ||
remote.type.toLowerCase() === (local as ExtensionInstance).type) &&
slugify(remote.title) === slugify(local.handle)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it a bit confusing with the parenthesis and so on, so I'd simplify with something like this:

Suggested change
return (
remote.type.toLowerCase() === local.graphQLType.toLowerCase() && slugify(remote.title) === slugify(local.handle)
(remote.type.toLowerCase() === local.graphQLType.toLowerCase() ||
remote.type.toLowerCase() === (local as ExtensionInstance).externalType ||
remote.type.toLowerCase() === (local as ExtensionInstance).type) &&
slugify(remote.title) === slugify(local.handle)
)
const remoteType = remote.type.toLowerCase();
const localExt = local as ExtensionInstance;
const sameType = [localExt.graphQLType?.toLowerCase(), localExt.externalType, localExt.type]
.includes(remoteType)
const sameName = slugify(remote.title) === slugify(local.handle)
return sameType && sameName

const sameTypeAndName = (local: LocalSource, remote: RemoteSource) => {
return (
remote.type.toLowerCase() === local.graphQLType.toLowerCase() && slugify(remote.title) === slugify(local.handle)
(remote.type.toLowerCase() === local.graphQLType.toLowerCase() ||
Copy link
Contributor

Choose a reason for hiding this comment

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

If we have tests in place already can we add the new case? Otherwise probably fine to skip since this code will be 🔥 soon anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a test 👌

(remote.type.toLowerCase() === local.graphQLType.toLowerCase() ||
remote.type.toLowerCase() === (local as ExtensionInstance).externalType ||
remote.type.toLowerCase() === (local as ExtensionInstance).type) &&
slugify(remote.title) === slugify(local.handle)
Copy link

@fredriculrich fredriculrich Aug 28, 2025

Choose a reason for hiding this comment

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

This confused me initially because matching the remote title with the local handle likely wouldn't work in many cases.

Discussed with @isaacroldan and in this circumstance the remote.title actually represents the handle of the module. Makes this difficult to read and grok but should be gone soon so it is probably okay in the short term?

Either way a comment may be helpful for the next person.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a comment 👌

@isaacroldan isaacroldan force-pushed the 08-28-match_by_both_type_and_externaltype branch from 64a55c4 to 25baed5 Compare August 28, 2025 14:13
@isaacroldan isaacroldan added this pull request to the merge queue Aug 28, 2025
Merged via the queue into main with commit c0bf91c Aug 28, 2025
2 checks passed
@isaacroldan isaacroldan deleted the 08-28-match_by_both_type_and_externaltype branch August 28, 2025 14:58
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.

5 participants