Skip to content

fix: resolve a deployment group by name in the manager's list filter - #812

Merged
alongubkin merged 2 commits into
mainfrom
alon/alien-1146-manager-cant-resolve-a-deployment-by-group-name-groupname
Oct 1, 2026
Merged

alongubkin merged 2 commits into
mainfrom
alon/alien-1146-manager-cant-resolve-a-deployment-by-group-name-groupname

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Fixes ALIEN-1146.

Problem

The CLI resolves a <group>/<name> deployment spec by listing deployments with deploymentGroupId=<group>&name=<name> (deployment_resolver.rs). The platform API accepts a group name in that parameter; alien-manager compared it literally against group ids. alien dev creates its group named local-dev under a generated dg_… id, so alien dev deployments get local-dev/<name> (and the other spec-taking commands) said the deployment wasn't found right after ls printed it.

Fix

list_deployments resolves the deploymentGroupId filter first: an existing group id is used as is; otherwise the id of the one group with that name. More than one group with the name is a 400 asking for the id. A value that's neither still matches nothing, as before. A token scoped to a deployment group is unaffected (its own group is the filter).

Tests

  • New list_resolves_a_deployment_group_by_name: GET /v1/deployments?deploymentGroupId=local-dev&name=deployment-1 lists with the group's generated id and returns the deployment.
  • The route test harness's state setup is shared by the delete and list tests (send).
  • cargo test -p alien-manager passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds name-based lookup for deployment group filters.

The PR appears safe to merge, with non-blocking lookup-performance and test-fidelity improvements recommended.

Fix All in CodexFindings

  1. P2 Name lookup scans every group ▶
  2. P2 Test returns wrong group's deployment ▶
Fix with agent prompt
### Issue 1
crates/alien-manager/src/routes/deployments.rs:256-261
Each request that filters deployments by a group name loads all deployment groups, then filters them in memory. The SQLite query also counts deployments for every group. This makes a lookup for one group slower and more costly as the installation grows.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
crates/alien-manager/src/routes/deployments.rs:1247
The resolved group has ID `dg_generated`, but `deployment_record()` belongs to `group-1`. The mock returns that record regardless of the filter, so the test passes without showing that the resolved group actually contains the returned deployment. Make the fixture belong to the resolved group and have the mock honor the filter.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR lets the manager’s deployment-list filter resolve a deployment group name to its ID, supporting <group>/<name> CLI specs. It also shares the route-test harness and adds a name-resolution test.

  • The name lookup introduces an unbounded group scan on each name-filtered request.
  • The new test’s returned deployment belongs to a different group than the one it resolves.

Reviews (1) · Last reviewed commit: "fix: resolve a deployment group by name ..."

Comment thread crates/alien-manager/src/routes/deployments.rs
Comment thread crates/alien-manager/src/routes/deployments.rs Outdated
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@alongubkin
alongubkin merged commit 4be7004 into main Oct 1, 2026
21 checks passed
@alongubkin
alongubkin deleted the alon/alien-1146-manager-cant-resolve-a-deployment-by-group-name-groupname branch October 1, 2026 23:54
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.

1 participant