Skip to content

feat(deployments): filter listDeployments by source slug#3044

Open
simplesagar wants to merge 1 commit into
mainfrom
worktree-deployments-filter-by-source
Open

feat(deployments): filter listDeployments by source slug#3044
simplesagar wants to merge 1 commit into
mainfrom
worktree-deployments-filter-by-source

Conversation

@simplesagar
Copy link
Copy Markdown
Member

Summary

Adds server-side source filtering to listDeployments, then uses it in two places in the dashboard.

Backend

  • New optional source_slugs array on ListDeploymentForm (/rpc/deployments.list?source_slugs=foo&source_slugs=bar).
  • SQL narrows the paged CTE to deployments whose deployments_openapiv3_assets.slug or deployments_functions.slug is in the requested set (OR semantics).
  • External MCP and Remote MCP sources are intentionally out of scope (no per-deployment slug column today).
  • New integration test ListDeployments_FilterBySourceSlugs covers single-slug, multi-slug-OR, and no-match cases.

Dashboard

  • Source overview → Deployments tab: scoped to the current source via sourceSlugs: [sourceSlug]. Previously showed every workspace deployment regardless of whether it touched the source being viewed.
  • Standalone /deployments page: new "Filter by source" multi-select above the table, options derived from the latest deployment's OpenAPI + Function assets (mirroring SourceDetails discovery). Filter state is local; refetches the deployment list when changed.

Test plan

  • /deployments page with no filter renders all deployments as before.
  • Select one source → list narrows to deployments that touched that source.
  • Select multiple sources → list expands to deployments touching ANY of the selected sources (OR).
  • Clear the filter → returns to the full list.
  • Visit /sources/function/<slug> → Deployments tab → only deployments that include that function appear in the left sidebar.
  • Same on an OpenAPI source.
  • mise run test:server ./internal/deployments/... passes (already verified locally).

🤖 Generated with Claude Code

- Add source_slugs to ListDeploymentForm (OR semantics across OpenAPI and Function source slugs)
- Scope SourceDeploymentsPanel to its source instead of showing all workspace deployments
- Add a source multi-select to the standalone /deployments page

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simplesagar simplesagar requested review from a team as code owners May 27, 2026 00:17
@simplesagar simplesagar added the enhancement New feature or request label May 27, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: c078aaf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
server Minor
dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 27, 2026 12:17am

Request Review

@github-actions github-actions Bot added the preview Spawn a preview environment label May 27, 2026
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented May 27, 2026

🚀 Preview Environment (PR #3044)

Preview URL: https://pr-3044.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Created and validated 2026-05-27 00:23:16.
✅ Images Available Container images ready 2026-05-27 00:22:59.

Gram Preview Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants