Repository navigation
cli: declare custom run flags on the lint and test subcommands - #531
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Leward
force-pushed
the
eng-1270-lint-test-custom-run-flags
branch
from
October 16, 2026 18:56
ca77e80 to
105a460
Compare
This comment has been minimized.
This comment has been minimized.
Leward
force-pushed
the
eng-1270-lint-test-custom-run-flags
branch
from
October 16, 2026 18:58
105a460 to
dd2d9b5
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This was referenced Oct 16, 2026
The lint and test subcommands already call CustomRunExtractFn, but they did not declare CustomRunFlags. Thus a flag such as --rpc-plugins was only settable before the subcommand name. Extend TestRunCLICustomFlags to a table over run, lint and test. Use RunCLIToCode, because RunCLI calls os.Exit on a non-zero exit code. Ref: ENG-1270
Leward
force-pushed
the
eng-1270-lint-test-custom-run-flags
branch
from
October 19, 2026 18:07
dd2d9b5 to
6ba7ffa
Compare
|
Commits Review LGTM |
Jeffail
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
After this change, the root-level form of a custom flag stops working for
lintandtestin Redpanda Connect (connect --rpc-plugins plugin.yaml lint cfg.yaml).Connect must not pick up this release without the Connect change that reads both levels.
Summary
lintandtestnow declareopts.CustomRunFlags, asrunandstreamsalready do throughcommon.RunFlags.Both actions already call
opts.CustomRunExtractFn(c), so the custom flags are now settable after the subcommand name.lintCliCommand / test.CliCommand flags = [own flags...] flags = append(flags, common.EnvFileAndTemplateFlags(...)...) + flags = append(flags, opts.CustomRunFlags...)Evidence
Unit test.
TestRunCLICustomFlags(public/service/service_test.go) is now a table overrun,lintandtest:runpasses.lintandtestfail withflag provided but not defined: -meow.End-to-end. Connect
mainwith thecatshouttest plugin, built against benthos v4.83.0 (before) and this branch (after).testgives the same results aslint.connect lint --rpc-plugins plugin.yaml cfg.yamlflag provided but not definedconnect --rpc-plugins plugin.yaml lint cfg.yamlunable to infer processor typeconnect --rpc-plugins plugin.yaml run cfg.yamlunable to infer processor typeMerge Danger
Door: two-way
A revert of two lines restores the old behaviour.
Blast Radius: downstream-CLIs
rpc-pluginslist and does not load the plugin.--secrets,--redpanda-license,--chroot, telemetry).runandstreamsalready behave like this today (last table row).lint --helpandtest --helpnow list the custom flags of downstream tools.CLIOptCustomRunFlags.Ref: ENG-1270