Extract sync/identity field builders from DmfsTaskBuilder#358
Open
sunkup wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts several dmfs task “sync/identity” column writers from DmfsTaskBuilder into dedicated DmfsTaskFieldBuilder implementations, moving buildTask() toward a thin orchestrator pattern (as part of the broader per-field builder migration).
Changes:
- Introduced per-column builders for UID, sync-id, ETag, flags, sequence, and dirty columns.
- Updated
DmfsTaskBuilder.buildTask()to run afieldBuilderspipeline into anEntity, then apply it viawithValues(). - Added unit tests covering each new builder’s mapping behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt | Wires new field builders into the task row build flow and removes inline withValue() calls for extracted fields. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/UidBuilder.kt | Writes Tasks._UID into the task entity. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/SyncIdBuilder.kt | Writes Tasks._SYNC_ID from the builder’s constructor value. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/ETagBuilder.kt | Writes dmfs task ETag into DmfsTask.COLUMN_ETAG. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/SyncFlagsBuilder.kt | Writes sync flags into DmfsTask.COLUMN_FLAGS. |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/SequenceBuilder.kt | Writes Tasks.SYNC_VERSION from the task’s sequence (defaulting as implemented). |
| lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/DirtyBuilder.kt | Resets Tasks._DIRTY to 0 on create/update. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/UidBuilderTest.kt | Unit tests for UID mapping behavior. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/SyncIdBuilderTest.kt | Unit tests for _SYNC_ID mapping behavior. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/ETagBuilderTest.kt | Unit tests for ETag mapping behavior. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/SyncFlagsBuilderTest.kt | Unit tests for flags mapping behavior. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/SequenceBuilderTest.kt | Unit tests for sequence → SYNC_VERSION mapping behavior. |
| lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/builder/DirtyBuilderTest.kt | Unit tests for DIRTY reset behavior. |
This was referenced May 12, 2026
e60c44b to
a30488c
Compare
Extract UidBuilder, SyncIdBuilder, ETagBuilder, SyncFlagsBuilder, SequenceBuilder, and DirtyBuilder from the inline code in DmfsTaskBuilder.buildTask(). Each builder is added to fieldBuilders and the corresponding withValue() calls are removed from DmfsTaskBuilder. # Conflicts: # lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt
a30488c to
5fee893
Compare
5fee893 to
45f6f00
Compare
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.
Closes #353. Part of #340.
Extract
UidBuilder,SyncIdBuilder,ETagBuilder,SyncFlagsBuilder,SequenceBuilder, andDirtyBuilderfrom the inline code inDmfsTaskBuilder.buildTask(). Each builder is added to thefieldBuildersarray and the correspondingwithValue()calls are removed from the orchestrator.Each builder has a corresponding unit test.