Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(app,docker): add extension points for port-forward (BE)#355

Merged
clangenb merged 2 commits into
mainfrom
feat/port-forward-extension-points
May 11, 2026
Merged

feat(app,docker): add extension points for port-forward (BE)#355
clangenb merged 2 commits into
mainfrom
feat/port-forward-extension-points

Conversation

@eldara-cruncher
Copy link
Copy Markdown
Collaborator

@eldara-cruncher eldara-cruncher commented May 6, 2026

Summary

Two purely additive changes to the OSS that the upcoming Pro port-forward feature (issue Eldara-Tech/swarmcli-be#13) needs as extension points. Mirrors the established pattern by which the OSS exposes generic hooks (no Pro-specific logic) for the BE to plug into.

  • docker.TaskEntry.ContainerID — populated from task.Status.ContainerStatus.ContainerID with a nil-guard, in both GetTasksForStack and GetTasksForService. The BE port-forward replica picker needs the container ID to send to the agent without a second TaskInspectWithRaw round-trip.
  • app.RegisterShutdownHook(fn func()) / app.RunShutdownHooks() — package-level cleanup hooks. swarmcli-be/main.go will register portforwards.Default().CloseAll here so local TCP listeners and WebSocket connections drain synchronously after tea.Program.Run returns.

Phase 1 of 14 in the port-forward implementation plan. No callsite in this repo reads either; the changes are ready for use by Pro once a CE release tag lands.

Test plan

  • go build ./... clean
  • go test ./docker/ ./app/ ./views/services/ passes
  • golangci-lint run ./docker/... ./app/... clean
  • CI green
  • CE release tag cut after merge so swarmcli-be can bump .swarmcli-ref

🤖 Generated with Claude Code

- TaskEntry.ContainerID populated from task.Status.ContainerStatus.ContainerID
  (nil-guarded). Needed by the BE port-forward replica picker so the agent
  can dial the correct container without a second TaskInspectWithRaw.
- app.RegisterShutdownHook / RunShutdownHooks for app-level cleanup hooks
  invoked synchronously after tea.Program.Run returns. The BE port-forward
  manager will register CloseAll here so listeners drain on tea.Quit.

Both purely additive; no existing callsite changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Reflects the additive exports added in the same PR. Documentation-only.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@clangenb clangenb merged commit 88c709c into main May 11, 2026
13 checks passed
@eldara-cruncher eldara-cruncher deleted the feat/port-forward-extension-points branch June 5, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants