-
Notifications
You must be signed in to change notification settings - Fork 198
Add: platform filter #2632
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
Add: platform filter #2632
Conversation
Console (appwrite/console)Project ID: Tip Schedule functions to run as often as every minute with cron expressions |
WalkthroughThis pull request adds a platform filter to organization listing queries across multiple pages and components. The Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/routes/(public)/template-[template]/+page.ts (1)
3-4: Consider refetching organizations after creating the default appwrite organizationWith the new platform filter,
organizationsnow represents only appwrite‑platform orgs; if none exist, you create a default org but still return the pre‑creationorganizationsvalue (which will remain empty on this first load). If consumers of this load expect the newly created org to be immediately available (similar to the functions/sites deploy flows), it may be safer to refetch after creation using the same filtered query.Also applies to: 40-47, 49-56
src/lib/stores/billing.ts (1)
557-562: Good tightening of missing‑payment query; consider aligning related upgrade checkNarrowing the query to orgs with no primary and no backup payment method and scoping to platform='appwrite' makes this alert more precise. Given this, you may want to review
checkForNewDevUpgradePro’slistOrganization([Query.notEqual('billingPlan', BillingPlan.FREE)])call to decide whether it should also be restricted to appwrite‑platform orgs for consistency, or if its broader scope is intentional.src/routes/(console)/account/organizations/+page.ts (1)
13-22: Unified query object looks good; confirm platform filter behavior on self‑hostCentralizing pagination into a shared
queriesarray and reusing it for both teams and billing calls is clean, and the platform='appwrite' filter matches the rest of the PR’s intent. Please just confirm how this filter behaves in non‑cloud/self‑hosted environments (e.g., ifplatformis missing or unset on teams) to ensure it doesn’t unexpectedly return an empty list there.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/lib/commandCenter/searchers/organizations.ts(1 hunks)src/lib/stores/billing.ts(1 hunks)src/routes/(console)/account/organizations/+page.ts(1 hunks)src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts(1 hunks)src/routes/(public)/functions/deploy/+page.ts(3 hunks)src/routes/(public)/sites/deploy/+page.ts(3 hunks)src/routes/(public)/template-[template]/+page.ts(2 hunks)src/routes/+layout.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
src/routes/(public)/functions/deploy/+page.ts (1)
src/lib/stores/sdk.ts (1)
sdk(171-194)
src/routes/(public)/template-[template]/+page.ts (1)
src/lib/stores/sdk.ts (1)
sdk(171-194)
src/routes/(console)/account/organizations/+page.ts (1)
src/lib/components/filters/store.ts (1)
queries(84-84)
src/lib/commandCenter/searchers/organizations.ts (2)
src/lib/system.ts (1)
isCloud(26-26)src/lib/stores/sdk.ts (1)
sdk(171-194)
src/routes/+layout.ts (1)
src/lib/stores/sdk.ts (1)
sdk(171-194)
src/routes/(public)/sites/deploy/+page.ts (1)
src/lib/stores/sdk.ts (1)
sdk(171-194)
src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts (6)
src/routes/(console)/account/organizations/+page.ts (1)
load(8-29)src/routes/(public)/functions/deploy/+page.ts (1)
load(12-111)src/routes/(public)/sites/deploy/+page.ts (1)
load(12-128)src/routes/(public)/template-[template]/+page.ts (1)
load(10-64)src/routes/+layout.ts (1)
load(17-71)src/lib/system.ts (1)
isCloud(26-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: e2e
- GitHub Check: build
🔇 Additional comments (5)
src/routes/(console)/organization-[organization]/domains/domain-[domain]/settings/+page.ts (1)
4-11: Cloud organization fetch correctly scoped to platformUsing a platform filter for the cloud organization list here is consistent with the rest of the PR and keeps the non‑cloud code path unchanged; the change looks good.
src/lib/commandCenter/searchers/organizations.ts (1)
6-11: Command center org searcher matches new platform‑scoped behaviorThe searcher now scopes cloud organizations to platform='appwrite' while keeping the non‑cloud path untouched, and the downstream filtering/mapping logic remains valid; this looks good.
src/routes/(public)/sites/deploy/+page.ts (1)
6-7: Platform‑scoped org list and refetch behavior for site deployThe cloud path now treats “no organizations” as “no appwrite‑platform organizations” and will create a default appwrite org in that case, then refetch using the same filter, which keeps the returned list consistent. Please double‑check that treating existing non‑appwrite orgs as effectively absent for this flow is the desired product behavior.
Also applies to: 83-92, 109-117
src/routes/+layout.ts (1)
11-12: Layout‑wide cloud organizations are now platform‑scopedFiltering layout‑level cloud organizations to platform='appwrite' aligns with the rest of this PR, but it also changes the data shape seen by all routes relying on
data.organizationsfrom this layout. It’s worth quickly checking key consumers to ensure none assume visibility into non‑appwrite organizations in cloud mode.Also applies to: 41-48
src/routes/(public)/functions/deploy/+page.ts (1)
6-7: Consistent platform‑scoped org handling for function deployThe cloud function deploy flow now mirrors the sites deploy behavior: it filters organizations to platform='appwrite', and when none are found it creates a default appwrite org and refetches with the same filter. This is internally consistent; just confirm that creating a new appwrite org when only non‑appwrite orgs exist is the intended user experience for this flow.
Also applies to: 66-74, 92-99

What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.