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

feat(cli): select org and add to sanity.cli.ts on initialization #8573

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

cngonzalez
Copy link
Member

@cngonzalez cngonzalez commented Feb 10, 2025

Description

FIXES SDK-180
Since core applications will not be attached to specific projects, they need to be attached to organizations instead. This PR updates the sanity init --template core-app process to use the "select organization" part of the CLI flow and pass the resulting organization ID to the sanity.cli.ts template.

What to review

This should hopefully be straightforward. I had to update some variable names in legacy code because of an ESLint no-shadow rule. If you disagree with this choice, please let me know!

Testing

  1. Run pnpx [email protected]+a9a66e73d5 init --template core-app
  2. Verify that you are prompted for an organization.
  3. Verify that the organization ID is in your sanity.cli.ts

Notes for release

None, should be internal.

@cngonzalez cngonzalez requested a review from a team as a code owner February 10, 2025 15:52
@cngonzalez cngonzalez requested review from RitaDias and removed request for a team February 10, 2025 15:52
Copy link

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

@cngonzalez cngonzalez requested a review from binoy14 February 10, 2025 15:52
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.43% 53732 / 126632
🔵 Statements 42.43% 53732 / 126632
🔵 Functions 47.93% 2769 / 5777
🔵 Branches 78.76% 10278 / 13049
File CoverageNo changed files found.
Generated in workflow #30131 for commit 34c7aec by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Component Testing Report Updated Feb 10, 2025 10:15 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) 12s 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) 27s 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 33s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 4s 21 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 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

github-actions bot commented Feb 10, 2025

⚡️ Editor Performance Report

Updated Mon, 10 Feb 2025 22:12:46 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 19.0 efps (53ms) 19.6 efps (51ms) -2ms (-2.9%)
article (body) 58.5 efps (17ms) 60.2 efps (17ms) -0ms (-2.9%)
article (string inside object) 21.7 efps (46ms) 22.2 efps (45ms) -1ms (-2.2%)
article (string inside array) 18.9 efps (53ms) 19.6 efps (51ms) -2ms (-3.8%)
recipe (name) 50.0 efps (20ms) 50.0 efps (20ms) +0ms (-/-%)
recipe (description) 50.0 efps (20ms) 55.6 efps (18ms) -2ms (-10.0%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 19.0 efps (53ms) 18.2 efps (55ms) +3ms (+4.8%)
synthetic (string inside object) 20.4 efps (49ms) 18.3 efps (55ms) +6ms (+11.2%)

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) 53ms 82ms 93ms 603ms 1454ms 13.4s
article (body) 17ms 21ms 29ms 313ms 481ms 6.4s
article (string inside object) 46ms 48ms 53ms 157ms 285ms 7.7s
article (string inside array) 53ms 55ms 65ms 327ms 853ms 8.8s
recipe (name) 20ms 22ms 23ms 48ms 0ms 7.1s
recipe (description) 20ms 23ms 26ms 43ms 0ms 4.8s
recipe (instructions) 5ms 6ms 7ms 9ms 0ms 3.1s
synthetic (title) 53ms 58ms 70ms 452ms 1306ms 13.4s
synthetic (string inside object) 49ms 51ms 56ms 442ms 967ms 7.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 51ms 81ms 95ms 491ms 975ms 12.7s
article (body) 17ms 19ms 28ms 224ms 262ms 5.9s
article (string inside object) 45ms 47ms 54ms 305ms 525ms 8.0s
article (string inside array) 51ms 53ms 60ms 253ms 698ms 8.2s
recipe (name) 20ms 22ms 24ms 42ms 0ms 7.1s
recipe (description) 18ms 19ms 20ms 36ms 0ms 4.4s
recipe (instructions) 5ms 7ms 8ms 21ms 0ms 3.1s
synthetic (title) 55ms 58ms 62ms 241ms 1154ms 13.4s
synthetic (string inside object) 55ms 59ms 83ms 411ms 1282ms 9.0s

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

@cngonzalez cngonzalez enabled auto-merge February 10, 2025 16:19
Copy link
Contributor

@binoy14 binoy14 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 overall. Only putting it as comment to solve for the question

Comment on lines +7 to +9
api: {
organizationId: '%organizationId%'
},
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be worth discussing. Do we want to use the existing api key or introduce a new one for the specific use case for this.

Copy link
Member Author

@cngonzalez cngonzalez Feb 10, 2025

Choose a reason for hiding this comment

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

Semantically I'm not sure. I can read the api key as "these are the parameters that go into building the URL you need for operations" (so projectId, dataset), and organizationId technically fits that requirement, since you need it for deployment for example.

But if we want to keep all core app logic located in one place, then maybe it belongs elsewhere.

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