Skip to content

Add build trigger filters#3058

Merged
HarshMN2345 merged 5 commits into
mainfrom
fix/build-trigger-filters
May 27, 2026
Merged

Add build trigger filters#3058
HarshMN2345 merged 5 commits into
mainfrom
fix/build-trigger-filters

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

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.)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

This PR adds build trigger filter UI (branch and path patterns) for both Functions and Sites settings pages, and migrates all project-listing and project-creation API calls from the legacy projects.* SDK methods to the new organization-scoped organization(id).listProjects() / organization(id).createProject() APIs, backed by a bumped SDK pin (35c3dea).

  • Two new updateBuildTriggers.svelte components let users configure providerBranches and providerPaths glob filters; the form is conditionally shown only when a Git repository is connected.
  • All sdk.forConsole.projects.list() and sdk.forConsole.projects.create() call sites (13+ files) are updated to use the new organization-scoped API, removing the now-redundant teamId parameter from create calls.
  • The auth/preview project lookup is refactored to fan out one request per organization, replacing the previous single direct lookup by project $id.

Confidence Score: 4/5

Safe to merge for most users, but the auth/preview project lookup can silently fail for accounts belonging to more than ~25 organizations.

The auth/preview page now searches for a project by fanning out one API request per organization sourced from the root layout's organization list. That list is fetched without an explicit limit, so it caps at the API default. For users in more organizations than that cap, the target project's organization won't be included, project resolves to undefined, and the user is silently redirected to an access-denied page instead of being authorized — a regression from the previous single direct lookup by project ID.

src/routes/(public)/auth/preview/+page.svelte — the fan-out project search is bounded by the paginated organization list from the root layout.

Important Files Changed

Filename Overview
src/routes/(public)/auth/preview/+page.svelte Replaced single direct project-by-ID lookup with a fan-out over all loaded organizations; silently fails for users whose target org is beyond the default page limit.
src/lib/stores/sdk.ts Adds organization(id) factory method to createConsoleSdk; creates a fresh client per call with header snapshot — correct but allocates a new object on every invocation.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateBuildTriggers.svelte New component to manage branch/path trigger filters for functions; uses Svelte 4 syntax in a new file (already flagged in prior review thread).
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildTriggers.svelte New component to manage branch/path trigger filters for sites; mirrors the functions component with the same Svelte 4 syntax pattern.
src/routes/(public)/auth/preview/+page.ts Passes organizations from parent layout down to the page component to support the new per-org project lookup.
src/lib/components/breadcrumbs.svelte Migrated projects.list() to organization(id).listProjects(); the teamId query filter is now redundant but harmless since org context already scopes results.
package.json Bumps @appwrite.io/console SDK pin from 3ecc0b7 to 35c3dea to pick up the new Organization class and providerBranches/providerPaths support.

Reviews (3): Last reviewed commit: "fix: parallelize org project lookups in ..." | Re-trigger Greptile

Bumps @appwrite.io/console SDK to 35c3dea which introduces the Organization
class. All projects.list/create/update calls are now routed through
sdk.forConsole.organization(orgId) so requests carry the
X-Appwrite-Organization header required by the new API contract.
@HarshMN2345 HarshMN2345 merged commit 7a26e29 into main May 27, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix/build-trigger-filters branch May 27, 2026 12:20
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