Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Updates the Console to conditionally call listSpecifications() only when running on Cloud. On self-hosted deployments, the specifications list will be empty, which means the specification parameter won't be passed when creating or updating functions or sites. This allows the backend to use the default (highest available) specification instead of the lowest.

Changes Made

Layout Loaders

  • Functions Layout (src/routes/(console)/project-[region]-[project]/functions/+layout.ts): Added isCloud check to conditionally call listSpecifications() - returns empty list on self-hosted
  • Sites Settings Page (src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/+page.ts): Added isCloud check to conditionally call listSpecifications() - returns empty list on self-hosted

Component Updates

  • Function Create Pages (manual, template, repository): Updated to safely handle empty specifications arrays using optional chaining and nullish coalescing
  • UpdateResourceLimits Components (functions and sites): Updated to safely handle empty specifications arrays

Result

  • On Cloud: Specifications are fetched normally, and users can select from available specs
  • On Self-hosted: Specifications list is empty, so the specification parameter will be empty string or undefined when creating/updating, causing the backend to use the default (highest available) specification

Testing

  • ✅ Format: All files formatted correctly
  • ✅ TypeScript/Svelte check: 0 errors, 0 warnings
  • ✅ Lint: All checks passed
  • ✅ Tests: All 227 tests passed
  • ✅ Build: Successful production build

The changes are minimal and focused, affecting only specification handling without altering other functionality.

Original prompt

On self-hosted, the Console should not pass specification when creating a function or site so that the default (highest available) rather than the lowest. To keep the Console clean and not have isCloud everywhere when making the API call to the backend, let's update the places where listSpecifications is called so that it only makes the call if on Cloud. Otherwise, the specifications should be empty. Then, because the specification is empty, the Console will not include specification in the API call to the backend.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 8, 2025
@appwrite
Copy link

appwrite bot commented Dec 8, 2025

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Dynamic API keys are generated automatically for each function execution

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@stnguyen90
Copy link
Contributor

@copilot try again

- Modified functions layout loader to check isCloud before calling listSpecifications
- Modified sites settings page loader to check isCloud before calling listSpecifications
- Updated function create pages to handle empty specifications array safely
- Updated updateResourceLimits components to handle empty specifications array safely
- On self-hosted, specifications will be empty and not passed to backend, allowing default spec

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 8, 2025

@copilot try again

Done! Implemented the specification handling changes in commit a1deff6.

Changes:

  • Functions layout loader now only calls listSpecifications() when isCloud is true
  • Sites settings page loader now only calls listSpecifications() when isCloud is true
  • All components that use specifications now safely handle empty arrays
  • On self-hosted, specifications will be empty, so the specification parameter won't be passed to the backend (or will be empty string), allowing the backend to use the default (highest available) specification

Verification:

  • ✅ Format: Passed
  • ✅ TypeScript/Svelte check: 0 errors, 0 warnings
  • ✅ Lint: Passed
  • ✅ Tests: All 227 tests passed
  • ✅ Build: Successful production build

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • o1.ingest.sentry.io
    • Triggering command: /opt/hostedtoolcache/node/20.19.6/x64/bin/node node /home/REDACTED/work/console/console/node_modules/.bin/../vitest/vitest.mjs run (dns block)
    • Triggering command: /opt/hostedtoolcache/node/20.19.6/x64/bin/node node build.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update Console to handle specifications for self-hosted Update Console to handle specifications for self-hosted Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants