Skip to content

feat: support explicit published port selection - #539

Closed
ntltsrs-scout wants to merge 1 commit into
floci-io:mainfrom
ntltsrs-scout:feat/explicit-published-ports
Closed

ntltsrs-scout wants to merge 1 commit into
floci-io:mainfrom
ntltsrs-scout:feat/explicit-published-ports

Conversation

@ntltsrs-scout

Copy link
Copy Markdown

Summary

Gateway-only workloads currently publish ports for every enabled service, including unused database proxy ranges. Add withPublishedPorts(Integer...) so callers can keep only the emulator API port and the additional TCP ports their workload needs:

new FlociContainer().withPublishedPorts();     // API port only
new FlociContainer().withPublishedPorts(6379); // API port plus Redis proxy port

The explicit selection survives subsequent service configuration calls and is enforced before container creation. Duplicate ports are removed, invalid selections are rejected without replacing the previous selection, and conflicting fixed bindings fail before creation. Services and their listening ports are configured independently. Callers that omit the method retain automatic port selection.

The implementation lives in the shared core, with an AWS fluent override, usage documentation, unit coverage and a Docker-backed regression test that verifies the actual gateway-only bindings, an S3 round trip and container removal.

Related issue

No public issue linked. This addresses unnecessary port publications and their Docker setup/cleanup cost for workloads that only use the emulator gateway.

Type of change

  • Bug fix (fix: commit)
  • New feature (feat: commit)
  • Breaking change (feat!: commit or BREAKING CHANGE: footer)
  • Documentation or chore

Validation

Validated the exact source files on a Linux Docker agent with Corretto 21 and Maven 3.9.11:

mvn -B verify -Dit.test=FlociContainerPublishedPortsTest -Dfailsafe.failIfNoSpecifiedTests=false
  • 1,616 unit tests across all modules and the new Docker/S3 integration test passed: 1,617 total, zero failures, errors or skips.
  • Javadoc generation and AWS API compatibility checks passed.
  • The Docker test uses the repository-pinned emulator image and verifies only the API port is published, S3 create/put/get/delete succeeds, and the container is absent after close.
  • Other integration tests were excluded from this targeted run. The local development machine compiled the core/AWS sources and passed 10 focused port-selection tests; its Docker daemon was unavailable.

Checklist

  • mvn verify passes locally (requires Docker)
  • New or changed behaviour is covered by tests
  • All commit messages follow Conventional Commits (feat:, fix:, chore:, etc.)
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

The local full-verification checkbox remains unchecked because the Docker-backed validation above ran on a separate agent and selected the new integration test.

Allow gateway-only workloads to publish only the emulator API port and explicitly requested TCP ports. Preserve the selection across service configuration changes and validate fixed bindings before container creation.

Signed-off-by: Natallia Tserashchuk <natallia.tserashchuk_ext@scout24.com>
@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds withPublishedPorts(Integer...) to select the emulator API port plus any extra TCP ports a test needs.

  • Floci containers publish only the API port and any extra ports callers choose.

Reviews (1) · Last reviewed commit: "feat: support explicit published port se..." · Reviewed by Greptile

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