Skip to content

Enhance environment handling, database URL generation, and event streaming - #55

Merged
egasa21 merged 4 commits into
masterfrom
daily/ega
Jun 16, 2026
Merged

Enhance environment handling, database URL generation, and event streaming#55
egasa21 merged 4 commits into
masterfrom
daily/ega

Conversation

@egasa21

@egasa21 egasa21 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces real-time streaming of deploy events using Server-Sent Events (SSE), along with a robust in-memory event broadcaster and associated tests. It also improves environment file handling and adds utility methods for deploy status checks. The main themes are deploy event streaming, event broadcasting infrastructure, environment file handling, and test coverage.

Deploy event streaming and SSE support:

  • Added a StreamEvents HTTP handler in deploy.go that streams deploy events in real time to clients using Server-Sent Events (SSE). It backfills existing events, sends live updates, and properly handles deploy completion and client disconnects. [1] [2]
  • Implemented helper functions like writeSSEEvent and renderDeployEventsHTML for formatting event data and HTML responses.

Event broadcasting infrastructure:

  • Added a thread-safe EventBroadcaster in event_broadcaster.go that supports subscribing/unsubscribing to deploy event streams, publishing events, and cleaning up slow or disconnected subscribers.
  • Integrated the event broadcaster into the deploy Engine and handler, ensuring that new events are published to all active subscribers. [1] [2] [3] [4]

Environment file handling improvements:

  • Enhanced environment file handling by adding resolveEnvFilePath to locate the correct .env file, supporting multiple locations and the TALOS_ENV_FILE environment variable. The persistEncryptionKey function now returns the path used and creates parent directories as needed. [1] [2] [3]

Utility and status helpers:

  • Added an IsTerminal method to the DeployStatus type to easily check if a deploy is complete or failed.

Test coverage:

  • Added comprehensive tests for the event broadcaster (event_broadcaster_test.go), deploy event streaming handler (deploy_test.go), and environment file handling (main_test.go), ensuring correct behavior, resource cleanup, and non-blocking event delivery. [1] [2] [3]

@egasa21
egasa21 merged commit fb2f1f3 into master Jun 16, 2026
1 check failed
@egasa21
egasa21 deleted the daily/ega branch June 16, 2026 04:53
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