You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 18a12b9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(extensions): address Copilot review round 1 on #4351
All four review findings were valid; each is applied with regression
tests:
1. compute_extension_content_hash() excluded *-config.yml /
*-config.local.yml at every depth, but the remove/backup/restore
machinery only preserves top-level config files
(_target_follows_preserved_convention), so a changed nested shipped
file like templates/foo-config.yml was overwritten by installation
yet invisible to staleness detection. The exclusion now applies only
to direct children of the extension directory.
2. The stale-content check ran on every catalog_version <=
installed_version outcome. When the installed copy is newer than the
catalog or the running release's bundled copy (e.g. written by a
newer CLI), a hash difference is version skew, not unbumped drift -
and the suggested `extension add --force` would downgrade the
installation. The check is now gated on catalog_version ==
installed_version at the call site AND on the bundled copy declaring
the same version as the installed one inside the helper (the second
guard also covers an older CLI run against an up-to-date project,
which the call-site gate alone would miss).
3. _archive_extension_directory() followed file symlinks (is_file() +
ZipFile.write() dereference), so a symlink in a source directory
could turn out-of-tree bytes into a regular archive member before
the hardened extractor sees it. Symlinks are now skipped, matching
the rule in compute_extension_content_hash().
4. The CI guard's fallback comparison only required inequality for
non-dotted-numeric versions, so a PEP 440 prerelease downgrade like
2.0.0 -> 1.0.0rc1 passed. The script now compares with
packaging.version.Version - the same semantics extension
update/install use - and fails closed on unparseable versions; the
workflow installs packaging alongside pyyaml. Verified locally that
1.1.0 -> 1.0.0rc1 with content changes is now rejected.
Refs #4345
Assisted-by: Claude Code (model: claude-fable-5, autonomous)
Co-Authored-By: Claude Fable 5 <[email protected]>
0 commit comments