Repository navigation
Conversation
The Room Occupancy page sends the same order param to the summit-wide
/events/published and to /locations/{id}/events/published. The summit-wide
endpoint already accepts order=location; the location endpoints rejected
it with a validation error. Add location to the location events order
allowlist (reusing the existing COALESCE(LOWER(l.name), '') mapping and
the l join) and update the OpenAPI annotations.
Tests cover +/-location on both location endpoints (real room and tbd)
and the ordering on the summit-wide published endpoint.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-640/ This page is automatically updated on each push to this PR. |
437df80
into
fix/location-events-order-occupancy-track
) * fix(events): allow ordering location events by occupancy and track The location events endpoints rejected order=occupancy and order=track with a validation error, breaking the Room Occupancy page once a room is selected. Add both fields to the allowlist, apply the extra joins on the TBD location path so the track order mapping has its category alias, and update the OpenAPI annotations. * fix(events): allow ordering location events by location (#640) The Room Occupancy page sends the same order param to the summit-wide /events/published and to /locations/{id}/events/published. The summit-wide endpoint already accepts order=location; the location endpoints rejected it with a validation error. Add location to the location events order allowlist (reusing the existing COALESCE(LOWER(l.name), '') mapping and the l join) and update the OpenAPI annotations. Tests cover +/-location on both location endpoints (real room and tbd) and the ordering on the summit-wide published endpoint. --------- Co-authored-by: sebastian marcet <[email protected]>
ref: https://app.clickup.com/t/86bchejft
Stacked on #638.
Summary
locationas an order field inOAuth2SummitLocationsApiController::_getLocationEvents(covers/locations/{id}/events,/locations/{id}/events/publishedand the public route). It reuses the existinglocationmapping inDoctrineSummitEventRepository(COALESCE(LOWER(l.name), '')) and itsljoin.GET /api/v1/summits/{id}/events/publishedalready acceptsorder=location(RetrieveSummitEventsStrategy::buildOrder); no change there, only a test to lock it.getLocationEvents,getLocationPublishedEventsandgetLocationPublishedEventsPublic.Notes
tbd), so the sort is effectively a no-op there; the point is that the sameorderthe Room Occupancy page sends to/events/publishedno longer fails validation once a room is selected.Test plan
+location/-locationadded to the location events order provider (real room andtbd, both endpoints): 8 new cases, all fail without the allowlist entry and pass with it.testGetPublishedEventsOrderByLocation: summit-wide/events/publishedputs events without location first on+locationand last on-location.OAuth2SummitLocationsApiTestin thesummit-apicontainer: 91 tests OK (before adding the summit-wide test).