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

fix: ensure deprecated flags are correctly hidden #1974

Merged
merged 11 commits into from
Nov 14, 2024
Merged

fix: ensure deprecated flags are correctly hidden #1974

merged 11 commits into from
Nov 14, 2024

Conversation

raulb
Copy link
Member

@raulb raulb commented Nov 14, 2024

Description

Fixes #1971

The Flags() method on entrypoint.go is used in different places, and this pull-requests ensure that both the usage by this method and when using via the main Conduit CLI is correctly set.

Added unit tests to avoid regressions.

Before

Conduit CLI is a command-line that helps you interact with and manage Conduit.

Usage:
  conduit [flags]
  conduit [command]

Pipelines
  pipelines   Initialize and manage pipelines

Additional Commands:
  help        Help about any command
  init        Initialize Conduit with a configuration file and directories.

Flags:
      --api.enabled                                            enable HTTP and gRPC API (default true)
      --connectors.path string                                 path to standalone connectors' directory (default "/Users/rb/code/conduitio/conduit/connectors")
      --db.badger.path string                                  path to badger DB (default "/Users/rb/code/conduitio/conduit/conduit.db")
      --db.postgres.connection-string string                   postgres connection string, may be a database URL or in PostgreSQL keyword/value format
      --db.postgres.table string                               postgres table in which to store data (will be created if it does not exist) (default "conduit_kv_store")
      --db.sqlite.path string                                  path to sqlite3 DB (default "/Users/rb/code/conduitio/conduit/conduit.db")
      --db.sqlite.table string                                 sqlite3 table in which to store data (will be created if it does not exist) (default "conduit_kv_store")
      --db.type string                                         database type; accepts badger,postgres,inmemory,sqlite (default "badger")
      --dev                                                    used together with the dev flag it shows dev flags
      --dev.blockprofile string                                write block profile to file
      --dev.cpuprofile string                                  write cpu profile to file
      --dev.memprofile string                                  write memory profile to file
      --grpc.address string                                    address for serving the gRPC API (default ":8084")
  -h, --help                                                   help for conduit
      --http.address string                                    address for serving the HTTP API (default ":8080")
      --log.format string                                      sets the format of the logging; accepts json, cli (default "cli")
      --log.level string                                       sets logging level; accepts debug, info, warn, error, trace (default "info")
      --pipelines.error-recovery.backoff-factor int            backoff factor applied to the last delay (default 2)
      --pipelines.error-recovery.max-delay duration            maximum delay before restart (default 10m0s)
      --pipelines.error-recovery.max-retries int               maximum number of retries (default -1)
      --pipelines.error-recovery.max-retries-window duration   amount of time running without any errors after which a pipeline is considered healthy (default 5m0s)
      --pipelines.error-recovery.min-delay duration            minimum delay before restart (default 1s)
      --pipelines.exit-on-degraded                             exit Conduit if a pipeline enters a degraded state
      --pipelines.exit-on-error exit-on-degraded               Deprecated: use exit-on-degraded instead.
                                                               exit Conduit if a pipeline experiences an error while running
      --pipelines.path string                                  path to the directory that has the yaml pipeline configuration files, or a single pipeline configuration file (default "/Users/rb/code/conduitio/conduit/pipelines")
      --preview.pipeline-arch-v2                               enables experimental pipeline architecture v2 (note that the new architecture currently supports only 1 source and 1 destination per pipeline)
      --processors.path string                                 path to standalone processors' directory (default "/Users/rb/code/conduitio/conduit/processors")
      --schema-registry.confluent.connection-string string     confluent schema registry connection string
      --schema-registry.type string                            schema registry type; accepts builtin,confluent (default "builtin")
  -v, --version                                                version for conduit

Use "conduit [command] --help" for more information about a command.

After

Conduit CLI is a command-line that helps you interact with and manage Conduit.

Usage:
  conduit [flags]
  conduit [command]

Pipelines
  pipelines   Initialize and manage pipelines

Additional Commands:
  help        Help about any command
  init        Initialize Conduit with a configuration file and directories.

Flags:
      --api.enabled                                            enable HTTP and gRPC API (default true)
      --connectors.path string                                 path to standalone connectors' directory (default "/Users/rb/code/conduitio/conduit/connectors")
      --db.badger.path string                                  path to badger DB (default "/Users/rb/code/conduitio/conduit/conduit.db")
      --db.postgres.connection-string string                   postgres connection string, may be a database URL or in PostgreSQL keyword/value format
      --db.postgres.table string                               postgres table in which to store data (will be created if it does not exist) (default "conduit_kv_store")
      --db.sqlite.path string                                  path to sqlite3 DB (default "/Users/rb/code/conduitio/conduit/conduit.db")
      --db.sqlite.table string                                 sqlite3 table in which to store data (will be created if it does not exist) (default "conduit_kv_store")
      --db.type string                                         database type; accepts badger,postgres,inmemory,sqlite (default "badger")
      --dev.blockprofileblockprofile string                    write block profile to file
      --dev.cpuprofile string                                  write cpu profile to file
      --dev.memprofile string                                  write memory profile to file
      --grpc.address string                                    address for serving the gRPC API (default ":8084")
  -h, --help                                                   help for conduit
      --http.address string                                    address for serving the HTTP API (default ":8080")
      --log.format string                                      sets the format of the logging; accepts json, cli (default "cli")
      --log.level string                                       sets logging level; accepts debug, info, warn, error, trace (default "info")
      --pipelines.error-recovery.backoff-factor int            backoff factor applied to the last delay (default 2)
      --pipelines.error-recovery.max-delay duration            maximum delay before restart (default 10m0s)
      --pipelines.error-recovery.max-retries int               maximum number of retries (default -1)
      --pipelines.error-recovery.max-retries-window duration   amount of time running without any errors after which a pipeline is considered healthy (default 5m0s)
      --pipelines.error-recovery.min-delay duration            minimum delay before restart (default 1s)
      --pipelines.exit-on-degraded                             exit Conduit if a pipeline enters a degraded state
      --pipelines.path string                                  path to the directory that has the yaml pipeline configuration files, or a single pipeline configuration file (default "/Users/rb/code/conduitio/conduit/pipelines")
      --preview.pipeline-arch-v2                               enables experimental pipeline architecture v2 (note that the new architecture currently supports only 1 source and 1 destination per pipeline)
      --processors.path string                                 path to standalone processors' directory (default "/Users/rb/code/conduitio/conduit/processors")
      --schema-registry.confluent.connection-string string     confluent schema registry connection string
      --schema-registry.type string                            schema registry type; accepts builtin,confluent (default "builtin")
  -v, --version                                                version for conduit

Use "conduit [command] --help" for more information about a command.

Quick checks

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

pkg/conduit/entrypoint.go Outdated Show resolved Hide resolved
@raulb raulb requested a review from hariso November 14, 2024 16:30
@raulb raulb changed the title fix: ensure flags are correctly hidden fix: ensure deprecated flags are correctly hidden Nov 14, 2024
@raulb raulb merged commit 3100bc4 into main Nov 14, 2024
3 checks passed
@raulb raulb deleted the fix-help-output branch November 14, 2024 16:42
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.

bug: dev and deprecated flags shown by when running conduit help
2 participants