-
Notifications
You must be signed in to change notification settings - Fork 198
Update: make undefined from nulls.
#2615
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
Conversation
Console (appwrite/console)Project ID: Tip Each function runs in its own isolated container with custom environment variables |
WalkthroughThis pull request standardizes a GitHub Actions workflow file and updates the billing SDK method signatures and their call sites. The workflow YAML was reorganized into clearer steps. In src/lib/sdk/billing.ts two parameters default values were changed from Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring extra attention:
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
🔇 Additional comments (1)
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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/lib/sdk/billing.ts (2)
488-498: Fix type mismatch: parameter type doesn't allowundefined.The parameter
billingAddressIdis typed asstringbut has a default value ofundefined, which is a type safety violation. TypeScript's type system requires the parameter type to explicitly allowundefinedif that's a possible value.Apply this diff to fix the type declaration:
async createOrganization( organizationId: string, name: string, billingPlan: string, paymentMethodId: string, - billingAddressId: string = undefined, + billingAddressId?: string, couponId: string = null, invites: Array<string> = [], budget: number = undefined, taxId: string = null ): Promise<Organization | OrganizationError> {Alternatively, use an explicit union type:
billingAddressId: string | undefined = undefined,
610-619: Fix type mismatch: parameter type doesn't allowundefined.Same type safety issue as in
createOrganization: the parameterbillingAddressIdis typed asstringbut defaults toundefined.Apply this diff to fix the type declaration:
async updatePlan( organizationId: string, billingPlan: string, paymentMethodId: string, - billingAddressId: string = undefined, + billingAddressId?: string, couponId: string = null, invites: Array<string> = [], budget: number = undefined, taxId: string = null ): Promise<Organization | OrganizationError> {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.github/workflows/dockerize-profiles.yml(1 hunks)src/lib/sdk/billing.ts(1 hunks)src/routes/(console)/apply-credit/+page.svelte(1 hunks)src/routes/(console)/create-organization/+page.svelte(1 hunks)src/routes/(console)/onboarding/create-organization/+page.svelte(0 hunks)src/routes/(console)/onboarding/create-project/+page.ts(0 hunks)src/routes/(console)/organization-[organization]/change-plan/+page.svelte(1 hunks)src/routes/(public)/functions/deploy/+page.ts(0 hunks)src/routes/(public)/template-[template]/+page.ts(0 hunks)
💤 Files with no reviewable changes (4)
- src/routes/(public)/template-[template]/+page.ts
- src/routes/(console)/onboarding/create-project/+page.ts
- src/routes/(console)/onboarding/create-organization/+page.svelte
- src/routes/(public)/functions/deploy/+page.ts
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/dockerize-profiles.yml
17-17: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
19-19: the runner of "docker/setup-qemu-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
21-21: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
⏰ 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 (4)
.github/workflows/dockerize-profiles.yml (1)
15-49: Workflow structure reorganization looks good.The restructuring of steps into explicit sequential stages (Checkout, QEMU setup, Buildx setup, Docker Hub login, metadata extraction, and build/push) improves readability and maintainability.
src/routes/(console)/organization-[organization]/change-plan/+page.svelte (1)
173-177: LGTM! Cleaner function call by relying on default parameter.The removal of the trailing
nullargument correctly relies on the SDK's default value forbillingAddressId, making the call more concise.src/routes/(console)/apply-credit/+page.svelte (1)
132-142: LGTM! Argument updated to match SDK default.The change from
nulltoundefinedforbillingAddressIdaligns with the SDK's updated default parameter value.src/routes/(console)/create-organization/+page.svelte (1)
118-128: LGTM! Argument updated to match SDK default.The change from
nulltoundefinedforbillingAddressIdaligns with the SDK's updated default parameter value.

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