Skip to content

fix: keep an in-project encryption key path valid when push renames the project - #753

Open
pcbeingused333 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused333:c4318-rename-key
Open

pcbeingused333 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused333:c4318-rename-key

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #742

Root cause. PushManager._push_project reads encryption-key-path (and may hold an explicit --key) before calling rename_project_and_contents. When the key file lives inside the project directory it moves with the rename, but the captured path and the stored encryption-key-path keep pointing at the old directory, so the push fails opening the key.

Fix. After the rename, a key path located inside the old project directory is remapped to the new directory, and the config entry is updated. Keys outside the project directory are left unchanged.

Test. test_cloud_push_follows_encryption_key_inside_project_when_push_renames_project pushes an encrypted project whose key is inside it, with the cloud returning a different name. It fails before the change (the project is never updated) and passes after.

Disclosure: this change was prepared with the assistance of an AI coding agent (Claude) and submitted through the contributor's account.

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.

Push-induced rename leaves an in-project encryption key path pointing at the old directory

1 participant