Skip to content

sync push: write adopted-by-id configs back into the manifest (follow-up to #482) #497

Description

@padak

Follow-up to #482 / PR #494, from the non-blocking review findings.

NB-1: adopted config is never written back into the manifest

When an untracked _config.yml is adopted via the id-matching guard (its _keboola.config_id resolves on the target branch and is unclaimed by the manifest) and pushed as modified, push_update() succeeds but the post-update manifest hash refresh finds no entry, so no manifest writeback happens. The state self-heals on the next sync pull (the config is in the remote listing, is_new → entry written), but until then:

  • a local deletion of that file is not detected as deleted (it is not in tracked_keys),
  • every sync diff/push re-derives the adopt decision instead of reading a stable manifest entry.

Suggested fix: after a successful adopted-by-id push_update, append a ManifestConfiguration entry (analogous to writeback_create_config_in_manifest) with fresh pull_hash/pull_config_hash.

NB-3: E2E test for the branch-switch-then-push regression

tests/test_e2e.py has test_sync_diff_branch_override but not the #482 sequence (pull main → pull dev branch → push with zero edits → assert no_changes). The fix was verified manually against a live project (pre-fix dry-run showed phantom added entries, post-fix push was a no-op); an automated E2E test needs a disposable dev branch created/deleted by the harness.

NB-2: gotcha entry at release time

When the next version is cut, add a (since vX.Y.Z) gotcha to plugins/kbagent/skills/kbagent/references/gotchas.md (and the keboola-expert inline gotchas if warranted): pre-fix versions duplicate branch-inherited configs on sync push after branch use + pull; agents on older installs should upgrade before pushing on a dev branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions