[68582] Represent Meetings duration as ISO8601#22753
Conversation
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
ec9660e to
5c2f2d9
Compare
| property :duration, | ||
| exec_context: :decorator, | ||
| getter: ->(*) do | ||
| datetime_formatter.format_duration_from_hours(represented.duration) |
There was a problem hiding this comment.
Here, I’m not sure if I should allow_nil or not.
The model validates the presence through numericallity:
But the database allows NULL:
Should I rely on model validation and not allow_nil, or add a safety net preventing exceptions in case a wild NULL duration appears?
I prefer (and implemented) the first option to prevent silently handling (but hiding) inconsistent data.
| description: The scheduled meeting start time. | ||
| duration: | ||
| type: number | ||
| type: string |
There was a problem hiding this comment.
This is a breaking change. Is there any way to "warn" about it?
I hesitated about adding a field (e.g. durationIso8601) instead of changing its current behaviour. Whas’s the usual policy here?
There was a problem hiding this comment.
I was also concerned about that. I think we have two options:
- Optimistically assume that no one used it so far (up until recently, the API docs even indicated that the number would be minutes, rather than hours) and just break
- Hold this change back up until OpenProject 18.0 and break it there
In any case, we can mention it in the release notes, which are managed in this repo as well.
You can already optimistically create release notes for the version that this is part of.
What I would do:
- I'd make the breaking change in the next version (before a major release)
- In the release notes I'd point out that it was an error to have this as a unit-less number in the first place
5c2f2d9 to
5ce3b29
Compare
Ticket
https://community.openproject.org/wp/68582
What are you trying to accomplish?
Screenshots
What approach did you choose and why?
Mimics the
WorkPackageRepresenter.Merge checklist