Skip to content

Conversation

@jaredneedell
Copy link

@jaredneedell jaredneedell commented Dec 16, 2025

Add CLI flags to override app name and description

Add --app-name and --app-description flags to allow overriding app_name
and app_description from the config file without modifying the YAML
configuration.

Description

  • Bug fix
  • New feature

Usage

baton-sql --config-path config.yml --app-name "My Custom App" --app-description "Custom description"Or via environment variables:h
BATON_APP_NAME="My Custom App" BATON_APP_DESCRIPTION="Custom description" baton-sql --config-path config.yml#### Useful links:

Or via environment variables:

BATON_APP_NAME="My Custom App" BATON_APP_DESCRIPTION="Custom description" baton-sql --config-path config.yml

Summary by CodeRabbit

  • New Features
    • Connector configuration now includes new optional fields for app name and app description, providing greater flexibility and control over setup parameters.
    • Added programmatic configuration options to dynamically override app name and description values when initializing the connector instance, enabling runtime customization.

✏️ Tip: You can customize this high-level summary in your review settings.

Add CLI flags to override app name and description

Add --app-name and --app-description flags to allow overriding
app_name and app_description from the config file without modifying
the YAML configuration.
@jaredneedell jaredneedell requested a review from a team December 16, 2025 02:14
@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

Two files extended the configuration system: schema.go adds AppNameField and AppDescriptionField to the configuration schema, while connector.go updates the New constructor to accept variadic options for overriding these fields at instantiation time.

Changes

Cohort / File(s) Summary
Schema Extension
pkg/config/schema.go
Added two new optional string configuration fields: AppNameField and AppDescriptionField with descriptions; included both in the ConfigurationFields slice to expand the external configuration surface.
Constructor Enhancement
pkg/connector/connector.go
Updated New constructor signature to accept variadic NewOption arguments; introduced NewOption function type and two public option creators: WithAppName(name string) and WithAppDescription(description string) to allow runtime override of config values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Configuration extension is straightforward (two new fields with standard structure)
  • Option pattern implementation follows established conventions and contains minimal logic
  • Changes are additive with no modifications to existing behavior or error handling

Poem

🐰 Two fields hop into the config today,
AppName and Description come out to play,
With options that dance, we override with grace,
A flexible connector finds its rightful place!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding CLI flags to override app name and description, which aligns with the config schema extension and constructor option additions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c04d4e and 4e73c70.

⛔ Files ignored due to path filters (1)
  • cmd/baton-sql/main.go is excluded by none and included by none
📒 Files selected for processing (2)
  • pkg/config/schema.go (1 hunks)
  • pkg/connector/connector.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: Error handling: use fmt.Errorf with contextual messages; check specific errors with errors.Is
Organize imports: standard library first, then third-party, then project imports; alphabetize within each group
Naming: CamelCase for exported identifiers; camelCase for unexported; preserve acronyms like ID, URL, HTTP, API
Limit line length to a maximum of 200 characters
Comments for exported items must be complete sentences ending with periods
Do not use log.Fatal or log.Panic (ruleguard-enforced)

Files:

  • pkg/config/schema.go
  • pkg/connector/connector.go
🧬 Code graph analysis (1)
pkg/connector/connector.go (2)
pkg/bsql/config.go (2)
  • LoadConfigFromFile (500-513)
  • Config (17-32)
pkg/config/schema.go (1)
  • Config (34-39)
🔇 Additional comments (8)
pkg/config/schema.go (3)

12-16: LGTM! Clean field definition.

The AppNameField follows SDK conventions correctly and appropriately marks the field as optional for override use cases.


18-22: LGTM! Clean field definition.

The AppDescriptionField follows SDK conventions and maintains consistency with AppNameField.


27-28: LGTM! Configuration surface extended correctly.

Adding the fields to ConfigurationFields properly exposes them for CLI flag generation and external configuration.

pkg/connector/connector.go (5)

87-96: LGTM! Clean functional options implementation.

The constructor signature change follows idiomatic Go patterns, and options are correctly applied after loading the config but before creating the connector.


101-102: LGTM! Standard functional options pattern.

The NewOption type is correctly defined following Go conventions and idiomatic functional options patterns.


104-111: LGTM! Defensive empty string handling is appropriate.

The empty string check prevents unintentional overrides (e.g., from empty environment variables) while preserving the config file value when no override is provided.


113-120: LGTM! Consistent implementation.

The WithAppDescription function mirrors the defensive behavior and structure of WithAppName, maintaining consistency across the option creators.


3-16: LGTM! Imports properly organized.

Imports follow the coding guidelines correctly: standard library first, then third-party, then project imports, with proper alphabetization within each group.


Comment @coderabbitai help to get the list of available commands and usage tips.

@laurenleach
Copy link

why not set the app name and description in the config file?

@jaredneedell
Copy link
Author

@laurenleach I want to be able to set variables to the app name in a script I am running multiple connectors with.

@ggreer
Copy link
Contributor

ggreer commented Jan 6, 2026

If the config files are identical except for the app name, wouldn't they sync identical data from the same DB, just with a different name?

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.

4 participants