-
Notifications
You must be signed in to change notification settings - Fork 220
[graphql-fixtures] Graphql fixtures/seed collision fix #2312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I've just added a commit to remove the need for an as any
cast in the test.
I think this is a minor change. End users shouldn't be relying on the randomly returned filler data. If there's some data that they want to fix then they should specify it.
You can cut a beta release and test this in web by commenting /snapit
on the PR.
Add a changeset (yarn add changeset
and follow instructions). and I think we're good to go. See https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md for more info.
/snapit |
🫰✨ Thanks @BPScott! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
Give that version of graphql-fixtures a go in web and check if the changing of the seed generation has a painful effect on tests. |
thanks @BPScott. Doesn't look like |
ah, duh, I forgot that we need a changeset in this branch that mentions graphql-fixtures before snapit shall pick up that the package needs to be released (new toy, still internalising how it works) |
9f7e4d5
to
cf48ecf
Compare
/snapit |
🫰✨ Thanks @BPScott! Your snapshots have been published to npm. Test the snapshots by updating your yarn add [email protected] yarn add [email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add [email protected] yarn add [email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
there we go |
Good news: I think the code change is good. Improving the seed generation so it results in fewer trivial collisions (e.g. Bad news: I suspected that consumers would rely on this buggy behaviour in some places. However it is worse than I thought - introducing this change in web results in 370ish test failures. I am pretty confident that this is web doing the wrong thing here, and that it is web's tests that need to be updated. However the sheer number of tests suggests that relying on this buggy behaviour is easier than I anticipated, and thus a release of graphql-fixtures containing change will require more work to merge cleanly. With that in mind, I think the least surprising thing is to claim this is a major version bump and write something more detailed in the changeset to describe why this would cause test failures. Worse news: We are working on apollo3 in quilt and web and I don't want the release of this change to block the testing of that work. Thus I do not want to release this change until a version of Proposed Plan
Are you able to corral a team to make these fixes in web? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking this as blocked, till we update web to not rely on this buggy behaviour that we're removing.
We'll also want to update this to be a major change in the changeset
🔎 View this PR in Shipit Next. ℹ️ Expand to learn how to deploy and handle emergencies using Shipit NextOverviewShipit Next will merge your code on your behalf because this repository uses Shipit Next and its merge queue. To ship this PR, you can either:
Comment Commands
Commands exclusive to Deploy Before Merge
Documentation
Questions or feedback?
|
Description
Fixes #2311
Uses a quick hash of the strings that make up a graphQL object's keypath to generate a random seed for that object, instead of a sum of all of the characters values.
I think this is a breaking change, only if people are asserting on the random values that are already generated.
TODO: changelog, once I know if this is considered breaking.
Type of change
Checklist