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

refactor(core): update managing permissions 2 #8700

Merged
merged 6 commits into from
Feb 20, 2025
Merged

refactor(core): update managing permissions 2 #8700

merged 6 commits into from
Feb 20, 2025

Conversation

RitaDias
Copy link
Contributor

@RitaDias RitaDias commented Feb 19, 2025

Description

  • Updates permissions hook logic to use a store that takes advantage of the resourceCache in the studio
  • A lot of file changes are related to updating mocks and making things in tests a bit smoother. Don't be scared by the number of files changed

This will then mean that there is no need to make needless dryRun requests multiple times exponentially reducing the number of calls in the release package.

What to review

Everything make sense?

Testing

Updated the tests and mocks, everything should work as expected.

Notes for release

N/A

Copy link

vercel bot commented Feb 19, 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 Feb 19, 2025 1:56pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 1:56pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 1:56pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 19, 2025 1:56pm
test-next-studio ⬜️ Ignored (Inspect) Feb 19, 2025 1:56pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.96% 54909 / 127793
🔵 Statements 42.96% 54909 / 127793
🔵 Functions 48.09% 2789 / 5799
🔵 Branches 79.48% 10629 / 13373
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/perspective/navbar/ReleasesList.tsx 96.45% 88.88% 100% 96.45% 140-145
packages/sanity/src/core/releases/components/documentHeader/contextMenu/VersionContextMenu.tsx 100% 89.47% 100% 100%
packages/sanity/src/core/releases/store/createReleasePermissionsStore.ts 80% 50% 66.66% 80% 13, 49-52, 54-55
packages/sanity/src/core/releases/store/useReleasePermissions.ts 100% 100% 100% 100%
packages/sanity/src/core/releases/store/__tests__/__mocks/useReleasePermissions.mock.ts 100% 100% 100% 100%
packages/sanity/src/core/releases/tool/components/ReleaseMenuButton/ReleaseMenu.tsx 100% 93.15% 100% 100%
packages/sanity/src/core/releases/tool/components/releaseCTAButtons/ReleasePublishAllButton.tsx 97.48% 96.96% 75% 97.48% 84, 86-87, 166
packages/sanity/src/core/releases/tool/components/releaseCTAButtons/ReleaseScheduleButton.tsx 67.37% 48% 50% 67.37% 73, 77-118, 135-138, 144-150, 157-179, 188-190, 240-245, 254-255, 258-259, 262-263
packages/sanity/src/core/releases/tool/detail/ReleaseDashboardDetails.tsx 94.4% 82% 66.66% 94.4% 59-61, 78-81, 95, 112, 140
packages/sanity/src/core/releases/tool/detail/ReleaseDetailsEditor.tsx 93.75% 84.61% 100% 93.75% 20-21
packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx 95.88% 86.58% 75% 95.88% 96, 138-139, 157, 173, 264-266, 273-277
Generated in workflow #30703 for commit 3e3efcb by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Feb 19, 2025

⚡️ Editor Performance Report

Updated Wed, 19 Feb 2025 14:00:36 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.0 efps (37ms) 27.0 efps (37ms) +0ms (-/-%)
article (body) 77.5 efps (13ms) 77.5 efps (13ms) -0ms (-/-%)
article (string inside object) 28.6 efps (35ms) 27.0 efps (37ms) +2ms (+5.7%)
article (string inside array) 24.7 efps (41ms) 23.8 efps (42ms) +2ms (+3.7%)
recipe (name) 45.5 efps (22ms) 45.5 efps (22ms) +0ms (-/-%)
recipe (description) 52.6 efps (19ms) 50.0 efps (20ms) +1ms (+5.3%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (6ms) +1ms (-/-%)
synthetic (title) 18.9 efps (53ms) 20.2 efps (50ms) -4ms (-6.6%)
synthetic (string inside object) 19.8 efps (51ms) 19.6 efps (51ms) +1ms (+1.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) 37ms 43ms 46ms 256ms 196ms 10.6s
article (body) 13ms 15ms 20ms 152ms 183ms 5.2s
article (string inside object) 35ms 37ms 40ms 58ms 112ms 6.2s
article (string inside array) 41ms 44ms 47ms 148ms 135ms 6.7s
recipe (name) 22ms 23ms 25ms 44ms 0ms 7.2s
recipe (description) 19ms 20ms 24ms 34ms 0ms 4.7s
recipe (instructions) 5ms 7ms 8ms 11ms 0ms 3.1s
synthetic (title) 53ms 56ms 88ms 269ms 1157ms 23.1s
synthetic (string inside object) 51ms 54ms 66ms 395ms 1200ms 9.0s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 37ms 39ms 61ms 366ms 168ms 10.1s
article (body) 13ms 15ms 21ms 136ms 58ms 5.2s
article (string inside object) 37ms 40ms 44ms 144ms 152ms 7.2s
article (string inside array) 42ms 43ms 48ms 66ms 68ms 6.9s
recipe (name) 22ms 22ms 25ms 54ms 0ms 7.4s
recipe (description) 20ms 22ms 24ms 43ms 0ms 4.7s
recipe (instructions) 6ms 8ms 9ms 37ms 0ms 3.4s
synthetic (title) 50ms 55ms 68ms 361ms 1029ms 12.8s
synthetic (string inside object) 51ms 55ms 57ms 494ms 994ms 8.4s

📚 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.

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Component Testing Report Updated Feb 19, 2025 2:04 PM (UTC)

❌ Failed Tests (4) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 19s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 4s 4 0 2
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 59s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ❌ Failed (Inspect) 1m 56s 14 0 1
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 51s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ❌ Failed (Inspect) 2m 58s 20 0 1
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 59s 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
Member

@jordanl17 jordanl17 left a comment

Choose a reason for hiding this comment

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

This looks great, and that all the tests are up to date too 🔥

@RitaDias RitaDias merged commit 0632832 into next Feb 20, 2025
62 checks passed
@RitaDias RitaDias deleted the sapp-2392-2 branch February 20, 2025 07:29
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.

2 participants