Skip to content

More builders#71

Merged
rfc2822 merged 24 commits intomainfrom
more-builders2
Sep 22, 2025
Merged

More builders#71
rfc2822 merged 24 commits intomainfrom
more-builders2

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Sep 18, 2025

Follow-up of #67. Depends on #67.

Moved more builders into separate classes without changing the logic.

Tests are again refactored to respective unit test classes with the same name.

@rfc2822 rfc2822 self-assigned this Sep 18, 2025
@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Sep 18, 2025
Base automatically changed from more-builders to main September 22, 2025 10:31
@github-actions
Copy link

This PR/issue depends on:

# Conflicts:
#	lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/calendar/LegacyAndroidEventBuilder2Test.kt
#	lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/LegacyAndroidEventBuilder2.kt
@rfc2822 rfc2822 marked this pull request as ready for review September 22, 2025 10:36
@rfc2822 rfc2822 requested a review from Copilot September 22, 2025 10:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Android event builder by extracting individual builder classes for specific event fields, following a similar pattern introduced in PR #67. The refactoring moves logic from the monolithic LegacyAndroidEventBuilder2 class into separate, focused builder classes, making the codebase more modular and testable.

Key changes:

  • Extracted 16 new builder classes for specific event field mappings (UID, sync flags, status, sequence, etc.)
  • Moved corresponding test logic into dedicated test classes for each builder
  • Updated the main LegacyAndroidEventBuilder2 to use the new builder classes
  • Renamed RetainedClassificationBuilder to AccessLevelBuilder with enhanced functionality

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UidBuilder.kt New builder for mapping UID field to Android Events table
TimeFieldsBuilder.kt Complex builder handling DTSTART, DTEND, duration, and timezone fields
SyncIdBuilder.kt Builder for sync ID fields with main/exception logic
StatusBuilder.kt Maps iCalendar STATUS to Android Events status values
AccessLevelBuilder.kt Enhanced classification handler with access level mapping and retention logic
LegacyAndroidEventBuilder2.kt Refactored main builder to use new modular builders
Various test files Unit tests for each individual builder class

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rfc2822
Copy link
Member Author

rfc2822 commented Sep 22, 2025

@sunkup Next bunch. All builders are then now in the new style.

@rfc2822 rfc2822 requested a review from sunkup September 22, 2025 11:01
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@rfc2822 rfc2822 merged commit 3b1b133 into main Sep 22, 2025
9 checks passed
@rfc2822 rfc2822 deleted the more-builders2 branch September 22, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split LegacyAndroidEventBuilder2 event row builder logic into separate builders

2 participants