Skip to content

Migrate event sub-row builders#67

Merged
rfc2822 merged 5 commits intomainfrom
more-builders
Sep 22, 2025
Merged

Migrate event sub-row builders#67
rfc2822 merged 5 commits intomainfrom
more-builders

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Sep 17, 2025

This pull request refactors the event-building logic for calendar synchronization by modularizing the mapping of event fields into dedicated builder classes. The main construction logic in LegacyAndroidEventBuilder2 is simplified and extended to use these new builder classes, which improves maintainability and extensibility.

Mapping logic of the fields or tests is not changed.

  • Introduced new builder classes (AttendeesBuilder, CategoriesBuilder, DescriptionBuilder, LocationBuilder, RemindersBuilder, RetainedClassificationBuilder, UnknownPropertiesBuilder, UrlBuilder) that each handle mapping a specific aspect of an event to an Android Entity.
  • Tests are now unit tests with Roboelectric.

When this is merged, #71 is the next one.

@rfc2822 rfc2822 self-assigned this Sep 17, 2025
@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Sep 17, 2025
@rfc2822 rfc2822 changed the title Migrate more builders Migrate event sub-row builders Sep 18, 2025
@rfc2822 rfc2822 requested a review from Copilot September 18, 2025 11:02
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 pull request refactors the event-building logic for calendar synchronization by extracting field mapping logic from the monolithic LegacyAndroidEventBuilder2 class into dedicated builder classes. This improves maintainability and extensibility while preserving existing functionality.

Key Changes:

  • Extracted field-specific mapping logic into dedicated builder classes (AttendeesBuilder, CategoriesBuilder, DescriptionBuilder, etc.)
  • Refactored LegacyAndroidEventBuilder2 to use these modular builders
  • Added comprehensive unit tests using Robolectric for the new builder classes

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
AndroidEntityBuilder.kt Renamed interface from AndroidEventFieldBuilder to AndroidEntityBuilder and updated documentation
TitleBuilder.kt Updated to implement the renamed AndroidEntityBuilder interface
AttendeesBuilder.kt New builder class for mapping event attendees to Android Entity
CategoriesBuilder.kt New builder class for mapping event categories to extended properties
DescriptionBuilder.kt New builder class for mapping event description to Android Events field
LocationBuilder.kt New builder class for mapping event location to Android Events field
RemindersBuilder.kt New builder class for mapping event alarms/reminders
RetainedClassificationBuilder.kt New builder class for preserving non-standard classification values
UnknownPropertiesBuilder.kt New builder class for mapping unknown iCalendar properties
UrlBuilder.kt New builder class for mapping event URL to extended properties
LegacyAndroidEventBuilder2.kt Refactored to use new builder classes, removing duplicated mapping logic
Various test files Added comprehensive unit tests for each new builder class

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

@rfc2822 rfc2822 marked this pull request as ready for review September 18, 2025 11:04
@rfc2822 rfc2822 linked an issue Sep 18, 2025 that may be closed by this pull request
@rfc2822 rfc2822 mentioned this pull request Sep 18, 2025
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.

There could be more kdoc on the builder classes for my taste, but we can add than when we look at them in detail :)

@rfc2822 rfc2822 merged commit 38917d8 into main Sep 22, 2025
10 checks passed
@rfc2822 rfc2822 deleted the more-builders branch September 22, 2025 10:31
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.

Separate builders for data rows (attendees etc).

2 participants