perf: remove nodes api feature flag checks#200
Conversation
Co-authored-by: danieltaox <danieltaox@gmail.com>
|
Cursor Agent can help with this pull request. Just |
Changed Files
|
There was a problem hiding this comment.
Greptile Summary
This PR removes the "vm-provider" feature flag that was gating access to the nodes API functionality in the SF Compute CLI. The changes span two files: src/lib/nodes/index.ts and src/lib/posthog.ts.
In src/lib/nodes/index.ts, the PR eliminates the async feature flag check that was preventing the nodes command from being registered when the flag was disabled. Previously, the registerNodes function would call isFeatureEnabled("vm-provider") and return early if the flag was false. Now, the nodes command is registered unconditionally, making it available to all users.
In src/lib/posthog.ts, the "vm-provider" option is removed from the FeatureFlags union type definition. This TypeScript change ensures that any remaining usage of this flag elsewhere in the codebase will be caught at compile time, preventing partial removals.
These changes align with the nodes API transitioning from experimental/gated access to open beta status. The feature flag was originally implemented to control access during development and testing phases, but is now obsolete. The removal also eliminates the async PostHog API call and caching logic required for feature flag evaluation, providing a performance improvement by making command registration synchronous.
The changes integrate cleanly with the existing CLI architecture. The nodes command registration follows the same pattern as other commands in the system, and the PostHog integration remains intact for the remaining feature flags ("procurements", "zones", and "custom-vm-images").
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it removes unused feature flag logic for a feature now in open beta
- Score reflects straightforward cleanup changes with clear business justification and proper TypeScript safety
- No files require special attention as the changes are simple removals with good type safety
2 files reviewed, no comments
This reverts commit 6fb80cf.
Remove the "vm-provider" feature flag checks because the nodes API is now in open beta and the flag was causing flakiness.
Slack Thread