Skip to content

PT-2368 - refactor all tools cli#1096

Open
BON4 wants to merge 2 commits into3.xfrom
PT-2368-new-config-support
Open

PT-2368 - refactor all tools cli#1096
BON4 wants to merge 2 commits into3.xfrom
PT-2368-new-config-support

Conversation

@BON4
Copy link
Contributor

@BON4 BON4 commented Mar 25, 2026

Summary

This PR migrates CLI/config handling to the new Kong-based configuration layer across all affected Go tools.

The goal is to standardize flag parsing, config-file behavior, password prompts, and version/version-check flow using shared config primitives.

Changes

  • Switched shared version flag to Kong-native kong.VersionFlag in lib/config/commonFlags.go.
  • Migrated CLI bootstrap to config.Setup(...) in:
    • pt-mongodb-index-check
    • pt-mongodb-query-digest
    • pt-mongodb-summary
    • pt-pg-summary
    • pt-secure-collect
  • Replaced legacy parsers (getopt / kingpin) with Kong struct tags and hooks (AfterApply, command Run methods).
  • Unified version-check flow via config.VersionCheckFlag + versioncheck.CheckUpdates(...).
  • Unified interactive secret handling via config.StdinRequestString for DB/encryption passwords.
  • Refactored pt-secure-collect subcommands (collect, encrypt, decrypt, sanitize) to command structs with explicit validation and runtime handlers.

Notes

  • This is primarily a CLI/config refactor; no intended functional changes in business logic.

  • Main expected impact is behavior consistency across tools (flags, defaults, help/version output, password prompts).

  • The contributed code is licensed under GPL v2.0

  • Contributor Licence Agreement (CLA) is signed

  • util/update-modules has been ran

  • Documentation updated

  • Test suite update

BON4 added 2 commits March 12, 2026 15:27
This change intorduces refactoring of all tools to work
with new config implementation.
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.

2 participants