Fidd format change / Metadata alignment#25
Conversation
There was a problem hiding this comment.
Pull request overview
This PR begins metadata alignment work by splitting logical file metadata headers into separate sections, updating packing/unpacking utilities for the new section model, and renamespacing FiddView HTTP URLs under /fidds/v1 on port 4199.
Changes:
- Introduces
FiddKey.SectionWithHeaderand stores logical file body/header offsets and CRCs separately. - Reworks packer section ordering via
SectionDescriptor/SectionArranger, including an option to align metadata sections. - Updates FiddView REST route prefixes, generated URLs, and related tests/imports.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.gitignore |
Ignores the FiddView SPA resources directory. |
FiddCore/src/main/java/com/fidd/connectors/FastFiddConnector.java |
Narrows FastFiddConnector to chunk-based access and extends FiddConnector. |
FiddCore/src/main/java/com/fidd/core/common/LogicalFileMetadataUtil.java |
Reads logical file metadata from the new header section offsets. |
FiddCore/src/main/java/com/fidd/core/common/LogicalFileUtil.java |
Removes offset skipping from full logical file stream reads. |
FiddCore/src/main/java/com/fidd/core/common/StreamUtils.java |
Adds shared stream skipping utility. |
FiddCore/src/main/java/com/fidd/core/fiddkey/FiddKey.java |
Splits logical file sections into SectionWithHeader. |
FiddCore/src/main/java/com/fidd/service/wrapper/WrapperFiddContentService.java |
Uses SectionWithHeader when loading logical file metadata. |
FiddCore/src/test/java/com/fidd/core/common/LogicalFileMetadataUtilTest.java |
Updates metadata util tests for header offsets. |
FiddCore/src/test/java/com/fidd/core/common/LogicalFileUtilTest.java |
Moves skip tests to StreamUtils. |
FiddCore/src/test/java/com/fidd/core/fiddkey/yaml/YamlFiddKeySerializerTest.java |
Updates YAML serializer fixture to use SectionWithHeader. |
FiddPacker/src/main/java/com/fidd/packer/forms/MainForm.java |
Passes the new metadata alignment option to packing. |
FiddPacker/src/main/java/com/fidd/packer/pack/FiddPackManager.java |
Writes logical file bodies and metadata headers as separate sections. |
FiddPacker/src/main/java/com/fidd/packer/pack/FiddUnpackManager.java |
Updates unpacking flow for SectionWithHeader and separated body/header layout. |
FiddPacker/src/main/java/com/fidd/packer/pack/FilePathTuple.java |
Converts file path tuple to mutable state holder for section results. |
FiddPacker/src/main/java/com/fidd/packer/pack/LengthAndCrcs.java |
Adds section offset to length/CRC write results. |
FiddPacker/src/main/java/com/fidd/packer/pack/SectionArranger.java |
Adds section arrangement logic for metadata alignment. |
FiddPacker/src/main/java/com/fidd/packer/pack/SectionDescriptor.java |
Adds descriptor classes for packer section planning. |
FiddView/src/main/java/com/fidd/view/App.java |
Changes FiddView API port to 4199. |
FiddView/src/main/java/com/fidd/view/forms/FiddViewForm.java |
Updates copied file and playlist URLs to /fidds/v1. |
FiddView/src/main/java/com/fidd/view/rest/invoker/FiddHttpServerVerticle.java |
Updates custom download route and listener port. |
FiddView/src/test/java/com/fidd/view/rest/mapper/LogicalFileInfoMapperTest.java |
Adjusts mapper tests after removing Section.headerLength. |
Comments suppressed due to low confidence (1)
FiddCore/src/test/java/com/fidd/core/fiddkey/yaml/YamlFiddKeySerializerTest.java:37
- This
ImmutableSectionWithHeaderbuilder does not setheaderOffset, which is a required attribute onSectionWithHeader. The test will fail while building the fixture before serialization is exercised; add a valid header offset to the test data.
List<FiddKey.SectionWithHeader> logicalFiles = List.of(ImmutableSectionWithHeader.builder()
.sectionOffset(100)
.sectionLength(1000)
.encryptionAlgorithm("AES-256")
.encryptionKeyData(new byte[] { 1,2,3,4,5 })
.crcs(List.of(FiddSignature.of("Adler32", new byte[] { 6,7,8,9,10 })))
.headerLength(765)
.build()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 31 changed files in this pull request and generated 11 comments.
Comments suppressed due to low confidence (1)
FiddCore/src/test/java/com/fidd/core/fiddkey/yaml/YamlFiddKeySerializerTest.java:37
SectionWithHeaderhas a required primitiveheaderOffset()attribute, but this test fixture only setsheaderLength. The Immutables builder will fail at runtime with a missing required attribute before the serializer round-trip can run; add a header offset to the fixture.
List<FiddKey.SectionWithHeader> logicalFiles = List.of(ImmutableSectionWithHeader.builder()
.sectionOffset(100)
.sectionLength(1000)
.encryptionAlgorithm("AES-256")
.encryptionKeyData(new byte[] { 1,2,3,4,5 })
.crcs(List.of(FiddSignature.of("Adler32", new byte[] { 6,7,8,9,10 })))
.headerLength(765)
.build()
1st batch of updates