Skip to content

refactor(framework): Disable gRPC Control API by default - #8093

Merged
danieljanes merged 3 commits into
mainfrom
gate-grpc-control-api
Sep 5, 2026
Merged

refactor(framework): Disable gRPC Control API by default#8093
danieljanes merged 3 commits into
mainfrom
gate-grpc-control-api

Conversation

@jafermarq

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 5, 2026 09:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The behavior change is localized, covered by a targeted test, and does not introduce risky control-flow or interface changes.

Pull request overview

This PR refactors SuperLink startup so the gRPC Control API is disabled by default and can be explicitly enabled via an environment variable, aligning the default runtime posture with a more restricted exposed surface.

Changes:

  • Gate SuperLinkLifespan._start_control_api() behind FLWR_INTERNAL_GRPC_CONTROL_API=1.
  • Add a regression test verifying the gRPC Control API only starts when explicitly opted in.
  • Update CLI comments/log messages to reflect the new behavior.

Review Notes

Critical issues

  • None found.

Simplicity/readability suggestions

  • The new “Control HTTP API” start log is redundant because only a single FastAPI/Uvicorn server is started (same host/port); consider consolidating logs.
  • One updated comment still implies FastAPI serves only “Runtime HTTP”, but the FastAPI app also includes Control routes.

Consistency concerns

  • The "1" env-var opt-in pattern matches other toggles already used in the codebase (e.g., update check/event log toggles).

Should this PR be split?

  • No.

Verdict

  • Good change overall; a couple of small messaging cleanups suggested in review comments.
File summaries
File Description
framework/py/flwr/superlink/cli/flower_superlink.py Gate gRPC Control API startup behind an opt-in env var; adjust CLI comments/logging.
framework/py/flwr/superlink/cli/flower_superlink_test.py Add test coverage for the new opt-in behavior.
framework/py/flwr/common/constant.py Introduce FLWR_INTERNAL_GRPC_CONTROL_API constant for the new toggle.
Review details

Suppressed comments (1)

framework/py/flwr/superlink/cli/flower_superlink.py:530

  • Two INFO logs announce starting separate Runtime and Control HTTP APIs on the same host/port, but only one Uvicorn/FastAPI server is started here. This is redundant and can confuse operators into thinking there are multiple listeners; consider logging a single combined message.
    log(
        INFO,
        "Starting the SuperLink Runtime HTTP API on %s:%s.",
        lifespan_config.host,
        lifespan_config.port,
    )
    log(
        INFO,
        "Starting the SuperLink Control HTTP API on %s:%s.",
        lifespan_config.host,
        lifespan_config.port,
    )
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread framework/py/flwr/superlink/cli/flower_superlink.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c9e009cc4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread framework/py/flwr/superlink/cli/flower_superlink.py
@github-actions github-actions Bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Sep 5, 2026
@danieljanes
danieljanes merged commit 3f9bda6 into main Sep 5, 2026
69 checks passed
@danieljanes
danieljanes deleted the gate-grpc-control-api branch September 5, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controlapi-http Maintainer Used to determine what PRs (mainly) come from Flower maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants