Skip to content

[68582] Represent Meetings duration as ISO8601#22753

Merged
oliverguenther merged 1 commit intodevfrom
fix/68582-meetings-ap-duration-indicated-as-number-instead-of-iso-8601-duration
Apr 15, 2026
Merged

[68582] Represent Meetings duration as ISO8601#22753
oliverguenther merged 1 commit intodevfrom
fix/68582-meetings-ap-duration-indicated-as-number-instead-of-iso-8601-duration

Conversation

@dfriquet
Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/68582

What are you trying to accomplish?

Like most other durations indicated in the API, e.g. spentTime or duration on work_packages, the duration on meetings should be indicated as an ISO 8601 duration. For example PT2H.

Screenshots

What approach did you choose and why?

Mimics the WorkPackageRepresenter.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@dfriquet dfriquet marked this pull request as ready for review April 14, 2026 09:22
@github-actions
Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@dfriquet dfriquet force-pushed the fix/68582-meetings-ap-duration-indicated-as-number-instead-of-iso-8601-duration branch 2 times, most recently from ec9660e to 5c2f2d9 Compare April 14, 2026 09:33
property :duration,
exec_context: :decorator,
getter: ->(*) do
datetime_formatter.format_duration_from_hours(represented.duration)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here, I’m not sure if I should allow_nil or not.

The model validates the presence through numericallity:

validates :duration, numericality: { greater_than: 0 }

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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was also concerned about that. I think we have two options:

  1. 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
  2. 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

@dfriquet dfriquet force-pushed the fix/68582-meetings-ap-duration-indicated-as-number-instead-of-iso-8601-duration branch from 5c2f2d9 to 5ce3b29 Compare April 14, 2026 17:05
@oliverguenther oliverguenther merged commit cfdcebd into dev Apr 15, 2026
20 of 23 checks passed
@oliverguenther oliverguenther deleted the fix/68582-meetings-ap-duration-indicated-as-number-instead-of-iso-8601-duration branch April 15, 2026 08:00
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants