feat(v2-data-api): provider order_key, models bulk patch, hooks, cherry-in oauth#14935
Closed
jidan745le wants to merge 3 commits into
Closed
feat(v2-data-api): provider order_key, models bulk patch, hooks, cherry-in oauth#14935jidan745le wants to merge 3 commits into
jidan745le wants to merge 3 commits into
Conversation
…ry-in oauth Split out from feat/v2/provider-settings-v2-parallel. Backend: - Add user_provider.order_key column (migration 0022) and provider reorder endpoints (PATCH /providers/:id/order, PATCH /providers/order:batch) - Add /providers/:providerId/preset-metadata endpoint via ProviderRegistryService.getProviderPresetMetadata - Add bulk PATCH /models with isDeprecated field - Update presetProviderSeeder and ProviderModelMigrator/Mappings to populate order_key - Refactor CherryIN OAuth service Renderer: - Add useModels / useProviders hooks for v2 data-api Tests: - Update connected service tests (Assistant/KnowledgeBase/KnowledgeItem/Message/KnowledgeOrchestration) to populate order_key after NOT NULL constraint change Excluded from this PR (kept in feat/v2/provider-settings-v2-parallel): - packages/ui composites (ReorderableList, Sortable) - src/renderer/src/pages/settings/ProviderSettingsV2/* + i18n + routes Signed-off-by: jidan745le <420511176@qq.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Restore src/renderer/src/components/__tests__/QuickPanelView.test.tsx to its upstream/v2 baseline. The oxlint consistent-type-imports cleanup was unrelated to this PR's v2 data-api scope and remains on feat/v2/provider-settings-v2-parallel for a follow-up. Signed-off-by: jidan745le <420511176@qq.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
user_providerhad no ordering column; provider order was implicit./providers/:providerId/preset-metadataendpoint, and no batchPATCH /models.useModels/useProvidershooks for the v2 data-api.After this PR:
user_provider.order_key(NOT NULL) is added via migration 0022, indexed, and populated by the preset seeder and v2 migrator.PATCH /providers/:id/order,PATCH /providers/order:batch,GET /providers/:providerId/preset-metadata, andPATCH /models(bulk update), with corresponding service-layer logic and tests.ModelgainsisDeprecatedplumbing through schema, mapping, andModelService.useModels/useProvidershooks (with mutations) backed by the v2 data-api.CherryINOAuthServiceis refactored with accompanying tests.order_keyafter the NOT NULL constraint change.This PR is split out from
feat/v2/provider-settings-v2-parallel. Intentionally excluded here (kept on the original branch for follow-up PRs):packages/uicomposites (ReorderableList,Sortable,PageSidePanel)src/renderer/src/pages/settings/ProviderSettingsV2/**provider-v2routereconcileDrizzleJournalOrderKeyDrift/ etc.)Fixes #
Why we need it and why it was done in this way
Provider ordering and the supporting endpoints are prerequisites for the upcoming Provider Settings v2 UI; landing them as a backend-only PR keeps the v2 UI PR scoped to UI/UX changes and lets reviewers focus on each layer independently.
The following tradeoffs were made:
CherryINOAuthServicerefactor together to avoid stacked-PR coordination across forks (GitHub does not support cross-fork stacked bases). This trades a slightly larger diff for a self-contained, CI-passing unit.user_provider.order_keyis now NOT NULL — separating them would break CI on intermediate revisions.The following alternatives were considered:
base = CherryHQ:v2, so reviewers would have to merge in a strict order anyway.Links to places where the discussion took place:
Breaking changes
None for end users in this PR (no UI consumes the new endpoints yet). Internal callers of
userProviderTable.insert()must now provide anorderKey; all in-tree call sites have been updated.Special notes for your reviewer
git restore --source=feat/v2/provider-settings-v2-parallel --pathspec-from-file=...to avoid hand-editing files.--no-verifybecause the throwaway worktree did not have local dev dependencies installed; the changes themselves were not modified by this PR.__drizzle_migrationsreconciliation logic (reconcileDrizzleJournalOrderKeyDrift) is not included here — it is being tracked separately.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note