Skip to content

refactor(cli): Fail fast deprecated long-running flwr-* wrappers#6953

Draft
msheller wants to merge 39 commits intomainfrom
appio-authn/pr-6-deprecated-wrapper-policy
Draft

refactor(cli): Fail fast deprecated long-running flwr-* wrappers#6953
msheller wants to merge 39 commits intomainfrom
appio-authn/pr-6-deprecated-wrapper-policy

Conversation

@msheller
Copy link
Copy Markdown
Member

@msheller msheller commented Apr 5, 2026

Issue

Description

Part 6/6 of the SuperExec auth stack. This PR is intentionally scoped so reviewers can focus on one or two concepts at a time.

Related issues/PRs

  • Stack root base: appio-authn/2-and-3-wire-serverappio-and-clientappio-auth-interceptors
  • This PR base branch: appio-authn/pr-5-clientappio-superexec-wiring
  • Head branch: appio-authn/pr-6-deprecated-wrapper-policy
  • Previous stack PR branch: appio-authn/pr-5-clientappio-superexec-wiring
  • Companion tests branch: appio-authn/pr-6-deprecated-wrapper-policy-tests

Proposal

Explanation

This PR delivers one reviewable slice of the SuperExec shared-secret auth rollout.

Review focus for this PR:

  • Explicit fail-fast behavior for deprecated long-running wrappers
  • Clear migration path messaging to flower-superexec
  • Scope intentionally limited to wrapper policy

Reviewer notes:

  • This is one PR in a stacked sequence; review against the configured base branch.
  • Companion tests are isolated in a separate branch to keep implementation and verification review clean:
    • appio-authn/pr-6-deprecated-wrapper-policy-tests

Checklist

  • Implement proposed change
  • Write tests (in companion test-only branch)
  • Update documentation
  • Address LLM-reviewer comments, if applicable (e.g., GitHub Copilot)
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Any other comments?

This PR is part of a review-focused stacked rollout. If preferred, I can squash/reorder after initial review passes.

msheller and others added 30 commits March 16, 2026 16:30
…or.py

Co-authored-by: Heng Pan <pan@flower.ai>
…or.py

Co-authored-by: Heng Pan <pan@flower.ai>
@msheller msheller marked this pull request as ready for review April 5, 2026 21:56
@msheller msheller requested a review from Copilot April 5, 2026 21:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enforces fail-fast behavior for deprecated long-running flwr-* wrapper commands, directing users to migrate to flower-superexec.

Changes:

  • Replaced run_with_deprecation_warning(...) long-running wrapper behavior with immediate flwr_exit(...) for missing --token.
  • Removed now-unused SuperExec-related imports (ExecPluginType, stubs, plugins, and run_with_deprecation_warning) from the affected entrypoints.
  • Added migration messaging pointing users to flower-superexec --plugin-type ....

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
framework/py/flwr/supernode/cli/flwr_clientapp.py Fail-fast when invoked without token (deprecated long-running wrapper path).
framework/py/flwr/simulation/app.py Fail-fast when invoked without token; remove deprecated wrapper plumbing.
framework/py/flwr/server/serverapp/app.py Fail-fast when invoked without token; remove deprecated wrapper plumbing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to 44
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-clientapp` is no longer supported. "
"Use `flower-superexec --plugin-type clientapp` instead.",
)
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG appends short-help text about an invalid SuperExec YAML plugin config, which is misleading for this fail-fast path (missing --token/deprecated long-running wrapper usage). Consider using a more appropriate exit code, or introduce a dedicated exit code/help entry for deprecated-wrapper/unsupported long-running mode so the rendered short-help and docs URL match the actual error.

Copilot uses AI. Check for mistakes.
Comment on lines +118 to 122
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-simulation` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
)
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG will also print the short-help message "The YAML configuration for the SuperExec plugin is invalid.", which doesn’t align with the actual error here (deprecated long-running flwr-simulation invocation without --token). Please switch to a more fitting exit code or add a dedicated exit code/help entry for this deprecated-wrapper policy so users aren’t pointed at the wrong docs.

Suggested change
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-simulation` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
)
log(
ERROR,
"Long-running mode in `flwr-simulation` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
)
restore_output()
raise SystemExit(1)

Copilot uses AI. Check for mistakes.
Comment on lines +85 to 89
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-serverapp` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
)
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Same issue as in other wrappers: using ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG will append short-help text about invalid SuperExec YAML config, which is confusing for the unsupported long-running flwr-serverapp mode (missing --token). Consider a dedicated exit code/help entry for deprecated wrapper usage or another exit code that better matches this condition.

Copilot uses AI. Check for mistakes.
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-clientapp` is no longer supported. "
"Use `flower-superexec --plugin-type clientapp` instead.",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The suggested migration command (flower-superexec --plugin-type clientapp) isn’t runnable as-is: flower-superexec also requires --appio-api-address and one of --superexec-auth-secret-file/--superexec-auth-secret-stdin (and typically --insecure, given the earlier TLS check). Please update the message to include the minimum required flags or point users to a specific docs page/example command so the guidance is actionable.

Suggested change
"Use `flower-superexec --plugin-type clientapp` instead.",
"Use `flower-superexec --plugin-type clientapp "
"--appio-api-address <ADDRESS> "
"--superexec-auth-secret-file <PATH> --insecure` instead.",

Copilot uses AI. Check for mistakes.
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-simulation` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The migration hint flower-superexec --plugin-type serverapp is incomplete: flower-superexec requires --appio-api-address and a SuperExec auth secret flag (--superexec-auth-secret-file or --superexec-auth-secret-stdin), and will also require --insecure in the current TLS-less implementation. Consider expanding the message to a minimal working command or linking to the relevant docs so users can follow it successfully.

Suggested change
"Use `flower-superexec --plugin-type serverapp` instead.",
"Use `flower-superexec --plugin-type serverapp "
f"--appio-api-address {args.serverappio_api_address} "
"--superexec-auth-secret-file <path> --insecure` instead "
"(or replace `--superexec-auth-secret-file <path>` with "
"`--superexec-auth-secret-stdin`).",

Copilot uses AI. Check for mistakes.
flwr_exit(
ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG,
"Long-running mode in `flwr-serverapp` is no longer supported. "
"Use `flower-superexec --plugin-type serverapp` instead.",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The guidance Use flower-superexec --plugin-type serverapp instead. omits required flower-superexec args (--appio-api-address and one of --superexec-auth-secret-file/--superexec-auth-secret-stdin, plus --insecure given current TLS limitations). Please adjust the message to include a minimal working invocation or a docs link so the next step is clear and immediately usable.

Suggested change
"Use `flower-superexec --plugin-type serverapp` instead.",
"Use `flower-superexec --plugin-type serverapp "
"--appio-api-address <APPIO_API_ADDRESS> "
"--superexec-auth-secret-file <PATH_TO_SECRET> "
"--insecure` instead.",

Copilot uses AI. Check for mistakes.
@msheller msheller marked this pull request as draft April 5, 2026 22:22
@github-actions github-actions bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Apr 5, 2026
@msheller msheller force-pushed the appio-authn/pr-5-clientappio-superexec-wiring branch 2 times, most recently from 6b386c0 to e111e40 Compare April 8, 2026 21:16
Base automatically changed from appio-authn/pr-5-clientappio-superexec-wiring to main April 9, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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