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(core): update releases permissions for main release action #8588

Draft
wants to merge 8 commits into
base: next
Choose a base branch
from

Conversation

RitaDias
Copy link
Contributor

@RitaDias RitaDias commented Feb 11, 2025

Description

  • Create useReleasePermissions which checks if a user can schedule or publish a release. We will be adding more to this in a separate PR
  • Add a permissions banner in the release permissions to warn a user
  • Disable publish / schedule main button in the release
image image image

What to review

Does this make sense? Should we do this a different way?

Testing

Have updated the tests
To manually test you should use a user that doesn't have permissions (viewer), the debug roles don't work consistently.

Notes for release

Update permissions in the release details

Copy link

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

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 11, 2025

⚡️ Editor Performance Report

Updated Tue, 11 Feb 2025 14:50:59 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.7 efps (41ms) 27.0 efps (37ms) -4ms (-8.6%)
article (body) 77.5 efps (13ms) 72.5 efps (14ms) +1ms (-/-%)
article (string inside object) 27.0 efps (37ms) 28.6 efps (35ms) -2ms (-5.4%)
article (string inside array) 22.2 efps (45ms) 24.4 efps (41ms) -4ms (-8.9%)
recipe (name) 47.6 efps (21ms) 48.8 efps (21ms) -1ms (-2.4%)
recipe (description) 52.6 efps (19ms) 52.6 efps (19ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (title) 20.0 efps (50ms) 19.6 efps (51ms) +1ms (+2.0%)
synthetic (string inside object) 20.0 efps (50ms) 20.8 efps (48ms) -2ms (-4.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) 41ms 65ms 79ms 525ms 920ms 11.1s
article (body) 13ms 16ms 22ms 182ms 198ms 5.1s
article (string inside object) 37ms 39ms 42ms 52ms 150ms 6.8s
article (string inside array) 45ms 48ms 51ms 111ms 264ms 7.4s
recipe (name) 21ms 23ms 24ms 37ms 5ms 7.6s
recipe (description) 19ms 20ms 22ms 28ms 0ms 4.6s
recipe (instructions) 6ms 8ms 10ms 29ms 0ms 3.2s
synthetic (title) 50ms 53ms 63ms 197ms 655ms 12.6s
synthetic (string inside object) 50ms 54ms 60ms 449ms 1022ms 8.4s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 37ms 39ms 43ms 313ms 28ms 10.1s
article (body) 14ms 17ms 31ms 91ms 184ms 5.2s
article (string inside object) 35ms 38ms 44ms 176ms 138ms 6.4s
article (string inside array) 41ms 43ms 47ms 66ms 238ms 7.1s
recipe (name) 21ms 22ms 25ms 49ms 0ms 8.0s
recipe (description) 19ms 20ms 22ms 40ms 0ms 4.6s
recipe (instructions) 6ms 8ms 9ms 17ms 0ms 3.2s
synthetic (title) 51ms 52ms 60ms 128ms 357ms 14.7s
synthetic (string inside object) 48ms 50ms 54ms 604ms 1093ms 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.

Copy link
Contributor

github-actions bot commented Feb 11, 2025

Component Testing Report Updated Feb 11, 2025 2:52 PM (UTC)

❌ Failed Tests (3) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 10s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 36s 3 0 3
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 54s 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) 15s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 9s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 39s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 6s 21 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 45s 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

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.47% 53843 / 126755
🔵 Statements 42.47% 53843 / 126755
🔵 Functions 47.95% 2772 / 5780
🔵 Branches 78.86% 10340 / 13111
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/releases/i18n/resources.ts 100% 100% 100% 100%
packages/sanity/src/core/releases/store/createReleaseOperationStore.ts 93.24% 100% 100% 93.24% 139-140, 149-155, 224-225, 248-249, 359-360
packages/sanity/src/core/releases/store/__tests__/__mocks/createReleaseOperationsStore.mock.ts 0% 0% 0% 0% 1-25
packages/sanity/src/core/releases/store/__tests__/__mocks/useReleaseOperations.mock.ts 100% 100% 100% 100%
packages/sanity/src/core/releases/tool/components/releaseCTAButtons/ReleasePublishAllButton.tsx 89.53% 91.17% 60% 89.53% 39, 81, 83-84, 164, 181-194
packages/sanity/src/core/releases/tool/components/releaseCTAButtons/ReleaseScheduleButton.tsx 65.78% 45.83% 50% 65.78% 61, 66, 70-111, 128-131, 137-143, 150-172, 178-180, 230-235, 244-245, 248-249, 252-253
packages/sanity/src/core/releases/tool/detail/ReleaseDashboardDetails.tsx 93.49% 88.09% 66.66% 93.49% 52-54, 60-63, 91, 119
Generated in workflow #30147 for commit 521a14b by the Vitest Coverage Report Action

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.

1 participant