Skip to content

Conversation

@kkashilk
Copy link
Contributor

Summary

Parameterize hardcoded binary names and product names throughout the codebase by replacing hardcoded strings with constants defined in central configuration files.

Changes

Python Build Scripts

  • build-scripts/const.py: Added CHAT_BINARY_BRANCH and CLI_BINARY_NAME_MINIMAL constants
  • build-scripts/build.py: Replaced hardcoded "qchat", "q_desktop", "q_cli", "prod" with constants
  • build-scripts/manifest.py: Replaced hardcoded "Amazon Q.app", binary paths, and identifiers with constants
  • build-scripts/qchatbuild.py: Updated comments to use generic placeholders
  • build-scripts/qchatmain.py: Updated description to be generic

Rust Codebase

  • crates/chat-cli/src/logging.rs: Replaced hardcoded "qchat.log" with CHAT_BINARY_NAME constant
  • crates/fig_log/src/lib.rs: Replaced hardcoded "qchat.log" with CHAT_BINARY_NAME constant
  • crates/chat-cli/src/cli/mod.rs: Replaced hardcoded "qchat.log" with CHAT_BINARY_NAME constant

Testing

  • All changes use existing constant values (no functional changes)
  • Pre-commit hooks pass (ruff, typos, clippy)
  • Code formatted with cargo +nightly fmt

- Add CHAT_BINARY_BRANCH and CLI_BINARY_NAME_MINIMAL to const.py
- Import CHAT_BINARY_BRANCH and TAURI_PRODUCT_NAME in build.py
- Replace hardcoded 'qchat' with CHAT_BINARY_NAME constant
- Replace hardcoded 'q_desktop' with TAURI_PRODUCT_NAME constant
- Replace hardcoded 'q_cli' with CLI_PACKAGE_NAME constant
- Replace hardcoded 'prod' with CHAT_BINARY_BRANCH constant
- Update comments to use generic binary name placeholders

🤖 Assisted by Amazon Q Developer
- Import APP_NAME, CLI_BINARY_NAME, PTY_BINARY_NAME, CHAT_BINARY_NAME
- Replace hardcoded 'Amazon Q.app' with f-string using APP_NAME
- Replace hardcoded binary paths and identifiers with constants

🤖 Assisted by Amazon Q Developer
- Replace hardcoded 'qchat' in comments with {chat_binary} placeholder
- Add REBRANDING_GUIDE.md to .gitignore

🤖 Assisted by Amazon Q Developer
- Replace 'qchat binary' with 'chat binary' in argparse description
- Remove REBRANDING_GUIDE.md from .gitignore (moved to .git/info/exclude)

🤖 Assisted by Amazon Q Developer
- Import CHAT_BINARY_NAME in chat-cli/src/logging.rs
- Import CHAT_BINARY_NAME in fig_log/src/lib.rs
- Import CHAT_BINARY_NAME in chat-cli/src/cli/mod.rs
- Replace hardcoded 'qchat.log' with format string using CHAT_BINARY_NAME

🤖 Assisted by Amazon Q Developer
@kkashilk kkashilk requested a review from a team as a code owner October 29, 2025 18:22
- Add CLI_BINARY_NAME, CHAT_BINARY_NAME, PTY_BINARY_NAME variables to bundle/linux/install.sh
- Replace hardcoded binary names with variables in install commands
- Add DESKTOP_BINARY_NAME variable to scripts/install.sh
- Replace hardcoded 'q_desktop' with DESKTOP_BINARY_NAME variable

🤖 Assisted by Amazon Q Developer
- Add SC2329 to bash-preexec.sh __bp_adjust_histcontrol function
- Add SC2329 disable before override function in shell integration generator
- Add cfg_attr to suppress dead_code warning on Windows for list_profiles_blocking
- Regenerate test snapshots with updated shellcheck directives

SC2329 warns about functions defined after being called, which is
intentional in our bash-preexec override pattern.

🤖 Assisted by Amazon Q Developer
Comment on lines -208 to +210
# BUILD_BUCKET/prod/latest/{target}/qchat.zip
# BUILD_BUCKET/{CHAT_BINARY_BRANCH}/latest/{target}/{CHAT_BINARY_NAME}.zip

Choose a reason for hiding this comment

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

thanks for doing the branch as well !!


APP_NAME = "Amazon Q"
CLI_BINARY_NAME = "q"
CLI_BINARY_NAME_MINIMAL = "q-minimal"

Choose a reason for hiding this comment

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

nit: I didn't find this variable being used anywhere, Follow up CRs ?

BINARY_NAME="q"
CLI_NAME="Q CLI"
COMMAND_NAME="q"
DESKTOP_BINARY_NAME="q_desktop"

Choose a reason for hiding this comment

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

I see two shell scripts, but if changes are to be need in few more. May be we create constants.sh and just do importing that on these scripts

@kkashilk kkashilk merged commit 50e57ac into main Oct 29, 2025
23 of 27 checks passed
@kkashilk kkashilk deleted the parameterize branch October 29, 2025 20:15
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.

3 participants