Skip to content

Add order-insensitive deep object comparison to cli-kit#8044

Merged
isaacroldan merged 1 commit into
mainfrom
deploy-split/01-cli-kit-order-insensitive-compare
Jul 10, 2026
Merged

Add order-insensitive deep object comparison to cli-kit#8044
isaacroldan merged 1 commit into
mainfrom
deploy-split/01-cli-kit-order-insensitive-compare

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Part 1 of 8 — splitting #8040 (refactor of deploy extension matching) into a reviewable stack.

WHY are these changes introduced?

Later PRs render a deploy/release diff by comparing local vs. remote app configuration. Config arrays such as webhook subscriptions can be semantically equal while differing only in element order, so a plain deep-equal reports false differences.

WHAT is this pull request doing?

Adds deepCompareWithOrderInsensitiveArrays (and two private helpers) to @shopify/cli-kit/common/object — a deep comparison that treats arrays as unordered. Purely additive; no existing export changes.

How to test your changes?

pnpm --filter @shopify/cli-kit exec vitest run src/public/common/object.test.ts

isaacroldan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Adds `deepCompareWithOrderInsensitiveArrays` (plus private helpers) to
`@shopify/cli-kit/common/object`. Deeply compares two values while treating
arrays as unordered, which the deploy/release config breakdown will use to
compare webhook subscriptions regardless of ordering.

Purely additive: no existing export is modified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@isaacroldan isaacroldan force-pushed the deploy-split/01-cli-kit-order-insensitive-compare branch from 55483f3 to 7e9fff4 Compare July 10, 2026 12:56
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/object.d.ts
@@ -38,6 +38,14 @@ export declare function mapValues<T extends object, TResult>(source: T | null |
  * @returns True if the objects are equal, false otherwise.
  */
 export declare function deepCompare(one: object, two: object): boolean;
+/**
+ * Deeply compares two values and treats arrays as order-insensitive.
+ *
+ * @param one - The first value to be compared.
+ * @param two - The second value to be compared.
+ * @returns True if the normalized values are equal, false otherwise.
+ */
+export declare function deepCompareWithOrderInsensitiveArrays(one: unknown, two: unknown): boolean;
 /**
  * Return the difference between two nested objects.
  *

isaacroldan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 10, 1:41 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 10, 1:41 PM UTC: @isaacroldan added this pull request to the GitHub merge queue with Graphite.

@isaacroldan isaacroldan added this pull request to the merge queue Jul 10, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 10, 2026
@isaacroldan isaacroldan added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit 613bfad Jul 10, 2026
28 of 29 checks passed
@isaacroldan isaacroldan deleted the deploy-split/01-cli-kit-order-insensitive-compare branch July 10, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants