-
Notifications
You must be signed in to change notification settings - Fork 197
fix: include git details in deployments list queries #2589
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
base: main
Are you sure you want to change the base?
Conversation
Console (appwrite/console)Project ID: Tip GraphQL API works alongside REST and WebSocket protocols |
WalkthroughThree page route files are updated to expand deployment query selections. The Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/+page.ts (1)
33-48: Add provider fields to the second deployment query to display Git information in the rollback modal.The second query (lines 33-48) is missing provider fields that are accessed in the UI. In
instantRollbackModal.svelte(lines 177-180), the component rendersprodDeployment?.providerCommitAuthorUrlandprodDeployment?.providerCommitAuthor, but these fields are not included in theQuery.select()for theprodReadyDeploymentsquery. This causes these values to be undefined in the rollback modal.Add
providerCommitAuthorUrlandproviderCommitAuthorto the second query's select array:Query.select([ 'buildDuration', 'totalSize', 'sourceSize', 'buildSize', 'type', 'resourceId', 'providerCommitAuthorUrl', 'providerCommitAuthor' ])
🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/+page.ts (1)
32-40: Provider fields added correctly, but consider extracting to a constant.The addition of provider-related metadata fields enables git details to be displayed in the UI, addressing the PR objective.
However, the same 8-field list is duplicated across multiple files. Consider extracting it to a shared constant:
// In a shared constants file (e.g., $lib/constants.ts) export const DEPLOYMENT_PROVIDER_FIELDS = [ 'providerRepositoryUrl', 'providerRepositoryOwner', 'providerRepositoryName', 'providerBranchUrl', 'providerBranch', 'providerCommitMessage', 'providerCommitHash', 'providerCommitUrl' ] as const;Then use it in the query:
Query.select([ 'buildSize', 'sourceSize', 'totalSize', 'buildDuration', 'status', 'type', - 'resourceId', - 'providerRepositoryUrl', - 'providerRepositoryOwner', - 'providerRepositoryName', - 'providerBranchUrl', - 'providerBranch', - 'providerCommitMessage', - 'providerCommitHash', - 'providerCommitUrl' + 'resourceId', + ...DEPLOYMENT_PROVIDER_FIELDS ]),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts(1 hunks)src/routes/(console)/project-[region]-[project]/sites/site-[site]/+page.ts(1 hunks)src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/+page.ts(1 hunks)
⏰ 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: build
- GitHub Check: e2e
🔇 Additional comments (2)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/+page.ts (1)
18-30: Provider fields added correctly to the first deployment query.The expansion of selected fields enables git details to be displayed for recent deployments.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.ts (1)
44-52: Provider fields added correctly for function deployments.The addition of provider-related metadata fields enables git details to be displayed for function deployments, consistent with the changes made for site deployments.
As with the other files, consider extracting this field list to a shared constant (see comment on deployments/+page.ts) to reduce duplication and ensure consistency.

What does this PR do?
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