Repository navigation
feat!: group work-package schedule fields in WorkPackageSchedule - #59
Conversation
WorkPackage and WorkPackageUpdate expose ScheduleManually, StartDate, DueDate, Date, EstimatedTime and DerivedEstimatedTime through a Schedule property. A converter keeps them flat in the JSON, as OpenProject sends and expects them. Breaking: workPackage.StartDate becomes workPackage.Schedule.StartDate; version 3.1.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
| Duplication | -2 |
🟢 Coverage 100.00% diff coverage · +5.96% coverage variation
Metric Results Coverage variation ✅ +5.96% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (8ac75f1) 166 114 68.67% Head commit (575ff35) 205 (+39) 153 (+39) 74.63% (+5.96%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#59) 39 39 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking findings were identified. The reviewed changes have corresponding coverage for flat schedule serialization/deserialization, collection handling, null omission, and both read/write converter paths.
Test suggestions
- Deserialize flat schedule fields into WorkPackage.Schedule.
- Serialize WorkPackageUpdate.Schedule as flat fields with null values omitted.
- Deserialize collection items using the flat schedule converter.
- Exercise converter behavior for both reading and writing IHasSchedule implementations.
Make this review better
TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP How was this review? Give us feedback
Groups the work-package scheduling and estimate fields in a new
WorkPackageScheduleobject, removing the duplicated property block that Codacy graded C (37% duplication) onWorkPackage.csandWorkPackageUpdate.cs.Breaking change (version 3.0 → 3.1):
ScheduleManually,StartDate,DueDate,Date,EstimatedTimeandDerivedEstimatedTimemove fromWorkPackageandWorkPackageUpdateinto theirScheduleproperty, soworkPackage.StartDatebecomesworkPackage.Schedule.StartDate.Wire format unchanged: OpenProject sends and expects these as top-level JSON fields.
FlatScheduleConverterFactory, registered in the client's JSON options (Refit's defaults plus this converter), reads them from the top level intoScheduleand writes them back to the top level, leaving null fields out.WorkPackageCreateis not changed.Tests (
WorkPackageScheduleJsonTests): reading flat fields intoSchedule, writing an update flat with nulls omitted, and work packages inside a collection. Local run with CI's filter (Category!=Integration): 11 passed; line coverage 74.6%.