Fix silent loss of files-to-download entries with directory destinations - #402
Merged
Conversation
…omic The inheritance merge keyed files-to-download entries by the raw dest string, so distinct files sharing a directory-form dest (trailing separator) collapsed into one identity and all but the last entry were silently dropped. The merge identity is now the normalized final file path: a directory-form dest is combined with the source filename, derived by a helper shared with the download-time destination resolution so the two stay in lockstep. The shared helper decodes GitLab API raw-file URLs, so a parent entry resolved to such a URL still matches a child override and deploys under its real filename instead of the literal raw. Duplicate identities within one mcp-servers, skills, or files-to-download list now collapse to the last entry with a warning instead of silently. Entries resolving to the same final path are deduplicated before the parallel download phase, and downloads are written atomically via a temp file and rename so a race or interruption can never leave a partially-written file.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
files-to-download: the merge identity was the rawdeststring, so distinct files sharing a directory-form dest (trailing/or\) collapsed into one identity and all but the last entry were silently dropped (in a real incident, two of three shared hook libraries were never deployed)._source_filename()helper shared with the download-time destination resolution so the two can never diverge. The helper decodes GitLab API raw-file URLs, so pre-merge source resolution of remote parents no longer breaks identity matching (and such entries now deploy under their real filename instead of the literalraw).mcp-servers,skills, orfiles-to-downloadlist now collapse to the last entry with a warning instead of silently.handle_resourcewrites atomically (temp file +os.replace), so a same-path race or interruption can never leave a partially-written file.docs/environment-configuration-guide.md): key reference, merge-strategies table, and inheritance bullets now state the normalized-final-file-path identity.Test plan
TestFilesToDownloadDirectoryDestMergewith a fixture pair reproducing the incident scenario.uv run pre-commit run --all-filesfully green.