Skip to content

Support config rename: sync pull auto-rename + config rename command #160

Description

@Matejkys

Problem

When a configuration is renamed (in Keboola UI or via config update --name), the local directory name and manifest path become stale. sync pull updates file contents but does not rename the directory, leading to drift between local directory names and actual config names.

Current workaround (manual, error-prone)

  1. Delete the old directory
  2. Edit .keboola/manifest.json — update path, clear pull_hash / pull_config_hash
  3. Run sync pull --force to re-download

Proposed solution

1. sync pull auto-detects and performs renames (high priority)

During pull, compare slugify(remote_config.name) against basename(manifest.path). If they differ, rename the local directory and update the manifest path.

Renamed: kds-team.app-custom-python/stripe-invoices-extractor
      -> kds-team.app-custom-python/stripe-extractor

Edge cases:

  • Name collision: if target directory already exists, append a numeric suffix (e.g. stripe-extractor-2)
  • Dirty working tree: rename anyway — git tracks content, not paths, and detects renames in git status
  • Git integration: optionally use git mv if inside a git repo for cleaner history

2. New command: kbagent config rename (medium priority)

For intentional renames that update remote + local atomically:

kbagent config rename \
  --project ir-l0-finance \
  --component-id kds-team.app-custom-python \
  --config-id 01kp3pmaa8n5f2kkc6b4229jj3 \
  --name "Stripe Extractor"

Steps the command should perform:

  1. Call Storage API to update config name
  2. Compute new slug from name
  3. Rename local directory (if it exists)
  4. Update manifest.json path + clear pull hashes
  5. Print summary: Renamed "Old Name" -> "New Name" (old-slug/ -> new-slug/)

3. sync push warning on name drift (low priority)

When pushing, detect that local dirname doesn't match remote config name and emit a warning:

Warning: Local directory 'stripe-invoices-extractor' doesn't match
config name 'Stripe Extractor'. Run 'kbagent config rename' or
'kbagent sync pull' to fix.

Context

Discovered while working with ir-l0-finance project — renamed "Stripe Invoices Extractor" to "Stripe Extractor" via config update --name, and the local directory remained stripe-invoices-extractor/ until manually fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions