Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detection for incompatible flags with --run-file #1509

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

twinguy
Copy link

@twinguy twinguy commented Mar 24, 2025

Description

This PR adds detection for incompatible flags when using the --run-file flag in the dapr run command. When a user tries to use command line flags that are incompatible with the run file configuration, a warning message is now displayed to inform the user that these flags will be ignored and should instead be configured in the run file.

Issue reference

Please reference the issue this PR will close: #1508

Changes implemented

  • Added a list of flag names that are incompatible with the --run-file option
  • Implemented a detection function (detectIncompatibleFlags) that identifies when incompatible flags are being used
  • Created a message generator (generateWarningMessage) to create a clear warning for users
  • Added logic in the run command to check for incompatible flags and display warnings
  • Added unit tests for both the detection function and message generator

Behavior change

Before: When using both --run-file and other command-line flags that should be configured in the run file, the command-line flags were silently ignored, potentially causing confusion for users.

After: When using both --run-file and incompatible command-line flags, a warning message is displayed to inform the user that these flags are ignored and should be configured in the run file.

Example warning

WARNING: The following flags are ignored when using --run-file and should be configured in the run file instead: app-id, app-port, dapr-http-port

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@twinguy twinguy requested review from a team as code owners March 24, 2025 04:47
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.

dapr run arguments are not working when used with --run-file
1 participant