Repository navigation
Bound generated .spk filenames so long architecture lists fit - #330
Merged
Merged
Conversation
Merged
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
Follow-up to #329. That fix stopped the sidecar temp name from overflowing the filesystem's per-name limit, but the underlying
.spkfilename itself is still unbounded: it concatenates every architecture code, and the platform has 51 of them (joined arch list ≈ 457 bytes vs the 255-byteNAME_MAX). This bounds the filename at generation time.Changes
Bound the generated filename (
domain/shared_kernel.build_filename)Keeps the Synology convention
<package>.v<version>.f<firmware>[<archs>].spkwhen it fitsMAX_BUILD_FILENAME = 240bytes. Beyond that, it keeps the leading archs and collapses the remainder into a short deterministic token (sha1 prefix), e.g.:noarchis the only arch token the filename parser reads (target_noarch), so it is kept first and never truncated. Unique per arch set (package + version + firmware already disambiguate), and the name is hard-bounded.Preserve the sidecar's permissions (
views/tasks.py)The #329 fix used
tempfile.mkstemp, which creates files mode0600, so sidecars silently changed from-rw-r--r--to-rw-------. Now uses a shortuuid-based temp name written withio.open, restoring the original umask-based permissions. Same atomicos.replace.Tests
noarchpreservation, uniqueness, and sidecar headroom; a regression test asserting the sidecar keeps umask-based permissions.test_admin_actions.pyoverrides that were exact copies of_AdminActionTestMixintests (the inherited tests still run for both views), and removed a trivial task-binding assertion.Impact
target_noarch/target_firmware_buildstill parse from the name.Verification
pytest— 380 passed, 45 subtests.sphinx-build -W -b htmlclean;pre-commitclean.