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

fix: forcing all search strategies to use vX API whilst releases not supported in named versions #8283

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

jordanl17
Copy link
Member

Description

This was found when migrating admin studio. Currently this change already exists inside next (here)

vX is the only current version of the sanity API that supports perspectives and releases. Therefore any studio wishing to use releases must use either the new groq search strategy (which consequentially will use vX) or must define explicitly that the S.DocumentList use .apiVersion('vX').

In the case of admin studio this was going to leave a significant footprint (since a defined apiVersion is used in a great number of areas).

Since this change is ultimately throwaway (once releases and perspective support is brought to a named version of the Sanity API then vX overriding is no longer needed), the smaller the wake the better. This felt like the smallest change - using the corel pre-release of sanity will override the api version for all searches to vX.

Important

Since this is a temporary change whilst releases is only on vX, I've already created a revert task to undo this override

What to review

Testing

Verified this against the admin studio:
Admin studio against the current corel tag causes the following error (see here)
Screenshot 2025-01-15 at 20 48 00

Admin studio running locally pointed to this branch resolves the issue (and network interrogation confirms that the api version is successfully being overridden):
Screenshot 2025-01-15 at 20 50 25

Notes for release

N/A

Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 10:23pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 10:23pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 10:23pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:23pm
test-next-studio ⬜️ Ignored (Inspect) Jan 15, 2025 10:23pm

@jordanl17 jordanl17 force-pushed the corel-search-use-vx branch from f2a886d to c31939d Compare January 15, 2025 20:53
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Component Testing Report Updated Jan 15, 2025 10:25 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 3s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 37s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 50s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 8s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 28s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 40s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 44s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Jan 15, 2025

⚡️ Editor Performance Report

Updated Wed, 15 Jan 2025 22:27:27 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 25.3 efps (40ms) 27.8 efps (36ms) -4ms (-8.9%)
article (body) 63.1 efps (16ms) 73.0 efps (14ms) -2ms (-/-%)
article (string inside object) 26.3 efps (38ms) 29.4 efps (34ms) -4ms (-10.5%)
article (string inside array) 24.4 efps (41ms) 24.4 efps (41ms) +0ms (-/-%)
recipe (name) 47.6 efps (21ms) 58.8 efps (17ms) -4ms (-19.0%)
recipe (description) 52.6 efps (19ms) 60.6 efps (17ms) -3ms (-13.2%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (title) 19.2 efps (52ms) 20.8 efps (48ms) -4ms (-7.7%)
synthetic (string inside object) 20.2 efps (50ms) 20.8 efps (48ms) -2ms (-3.0%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 40ms 62ms 75ms 404ms 734ms 10.3s
article (body) 16ms 18ms 22ms 91ms 113ms 5.6s
article (string inside object) 38ms 39ms 48ms 77ms 210ms 6.6s
article (string inside array) 41ms 44ms 55ms 144ms 178ms 6.9s
recipe (name) 21ms 23ms 30ms 49ms 0ms 7.3s
recipe (description) 19ms 21ms 29ms 46ms 0ms 4.7s
recipe (instructions) 6ms 8ms 11ms 20ms 0ms 3.2s
synthetic (title) 52ms 54ms 61ms 150ms 317ms 12.3s
synthetic (string inside object) 50ms 56ms 60ms 503ms 1013ms 8.2s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 36ms 57ms 66ms 471ms 761ms 10.2s
article (body) 14ms 14ms 19ms 157ms 234ms 5.3s
article (string inside object) 34ms 37ms 41ms 134ms 153ms 6.6s
article (string inside array) 41ms 43ms 48ms 95ms 289ms 7.1s
recipe (name) 17ms 19ms 20ms 30ms 0ms 7.4s
recipe (description) 17ms 19ms 20ms 57ms 0ms 4.8s
recipe (instructions) 6ms 7ms 8ms 10ms 0ms 3.2s
synthetic (title) 48ms 51ms 57ms 392ms 702ms 12.0s
synthetic (string inside object) 48ms 51ms 60ms 511ms 1167ms 8.6s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

/** @todo remove defined apiVersion once perspective is supported in
* non-experimental content lake API
*/
apiVersion: 'vX',
Copy link
Member Author

Choose a reason for hiding this comment

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

Only actually added this

@jordanl17 jordanl17 marked this pull request as ready for review January 16, 2025 09:48
@jordanl17 jordanl17 requested a review from a team as a code owner January 16, 2025 09:48
@jordanl17 jordanl17 requested review from rexxars, bjoerge, juice49, RitaDias and pedrobonamin and removed request for a team and rexxars January 16, 2025 09:48
Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

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

Looks good to me, would like @juice49 thoughts on this.

Copy link
Contributor

@juice49 juice49 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jordanl17 jordanl17 merged commit cc1dc74 into corel Jan 16, 2025
56 checks passed
@jordanl17 jordanl17 deleted the corel-search-use-vx branch January 16, 2025 11:54
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