Skip to content

Comments

return original zod schema after app module validation#6889

Open
ryancbahan wants to merge 1 commit intomainfrom
do-not-replace-config-input-on-validation
Open

return original zod schema after app module validation#6889
ryancbahan wants to merge 1 commit intomainfrom
do-not-replace-config-input-on-validation

Conversation

@ryancbahan
Copy link
Contributor

@ryancbahan ryancbahan commented Feb 23, 2026

WHY are these changes introduced?

See incident notes. The current validation mutates data in-place twice: once for zod.transform and once during json schema validation. We can keep the json schema validation approach as-is with its stripping behavior (sohuld we long term? IMO no, but different discussion) so long as we return the zod object, which we don't strip. This is a least-we-can-do approach to gain some safety back by reducing the amount of mutation to data happening inside a validation loop. I've also added a check to run transforms on the data pre-json schema validation only if a transform function is provided. This allows us a migration path to get things on contracts.

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

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 documentation changes

Copy link
Contributor Author

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

@ryancbahan ryancbahan force-pushed the do-not-replace-config-input-on-validation branch from 8e6e893 to 087fef7 Compare February 23, 2026 23:36
},
}

// When
Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleting some unneeded llm output as i pass by

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is llm 😅, is something we used to do as a team to separate the different parts of a test. And llm's have picked it up when adding new tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's actually part our testing conventions: https://shopify.github.io/cli/cli/testing-strategy.html

@ryancbahan ryancbahan marked this pull request as ready for review February 23, 2026 23:40
@ryancbahan ryancbahan requested a review from a team as a code owner February 23, 2026 23:40
@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.

@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.82% 14487/18379
🟡 Branches 73.18% 7207/9848
🟡 Functions 79.01% 3686/4665
🟡 Lines 79.17% 13695/17299

Test suite run success

3771 tests passing in 1448 suites.

Report generated by 🧪jest coverage report action from 087fef7

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.

3 participants