fix: move swarm stacks to be under projects#2234
Open
kmendell wants to merge 1 commit into
Open
Conversation
Member
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
|
Container images for this PR have been built successfully!
Built from commit fd7fc0f |
27ca6c2 to
6b1c9e3
Compare
c11901f to
f363865
Compare
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
f363865 to
055d4f0
Compare
055d4f0 to
d119f3f
Compare
728855a to
d512351
Compare
3407efb to
456e3eb
Compare
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
Merged
5 tasks
456e3eb to
2b4f240
Compare
501fc31 to
2969fbb
Compare
f4bcd82 to
6e963b8
Compare
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
6e963b8 to
bde4678
Compare
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
bde4678 to
fd7fc0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Checklist
mainbranchWhat This PR Implements
Fixes: #2226
Changes Made
Testing Done
./scripts/development/dev.sh startjust lint all)just test backendAI Tool Used (if applicable)
AI Tool:
Assistance Level:
What AI helped with:
I reviewed and edited all AI-generated output:
I ran all required tests and manually verified changes:
Additional Context
Disclaimer Greptiles Reviews use AI, make sure to check over its work.
To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike
To have Greptile Re-Review the changes, mention
greptileai.Greptile Summary
This PR introduces a new "Swarm Stack Projects" concept that persists stack metadata in a database table (
swarm_stack_projects) and reorganises the UI so that saved stacks live under the Projects section rather than the Swarm/Stacks runtime view. The change separates "live runtime" (Swarm → Stacks) from "saved compose files" (Projects → Swarm), with a new "Down" action for the runtime view and a full editor in the Projects view.SwarmStackProjectmodel, five new API endpoints (list/get/update/delete stackprojects,down stack), and theSyncStackProjectsFromFileSystemreconciliation loop that keeps the DB in sync with the filesystem on every read.listPersistedStackSourcesInternalwith DB-backed queries, and introducesGetStackProject/UpsertStackProject/DeleteStackProjectservice methods consumed by a newSwarmProjectEditorSvelte component.dockerSocketPathInternaland related helpers to a Linux-only build file, eliminating the dead no-op stubs on non-Linux platforms.Confidence Score: 4/5
Safe to merge with awareness of a known concurrency issue in the upsert path that can surface as opaque 500 errors under concurrent writes to the same stack name.
The core logic is sound and the DB migration, model, and service layer are well-structured. The outstanding concurrency issue in
upsertStackProjectRecordInternal(select-then-insert without atomicity) identified in a prior review round remains unaddressed; under concurrent saves to the same stack name it produces a unique-constraint violation that surfaces as a 500. New findings in this pass are non-blocking performance concerns:GetStackProjecttriggers a full filesystem sync twice per call (once directly, once throughGetStackSource), which compounds withUpsertStackProjectcallingGetStackProject.backend/internal/services/swarm_service.go — the upsert and GetStackProject/GetStackSource call chain warrant a second look before shipping to production workloads with many stacks or concurrent users.
Prompt To Fix All With AI
Reviews (5): Last reviewed commit: "fix: move swarm stacks to be under proje..." | Re-trigger Greptile
Context used:
newfunction to initi... (source)