Skip to content

fix(events): allow ordering location events by location - #640

Merged
smarcet merged 1 commit into
fix/location-events-order-occupancy-trackfrom
fix/location-events-order-location
Oct 13, 2026
Merged

smarcet merged 1 commit into
fix/location-events-order-occupancy-trackfrom
fix/location-events-order-location

Conversation

@smarcet

@smarcet smarcet commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

ref: https://app.clickup.com/t/86bchejft

Stacked on #638.

Summary

  • Allow location as an order field in OAuth2SummitLocationsApiController::_getLocationEvents (covers /locations/{id}/events, /locations/{id}/events/published and the public route). It reuses the existing location mapping in DoctrineSummitEventRepository (COALESCE(LOWER(l.name), '')) and its l join.
  • The summit-wide GET /api/v1/summits/{id}/events/published already accepts order=location (RetrieveSummitEventsStrategy::buildOrder); no change there, only a test to lock it.
  • Update OpenAPI annotations for getLocationEvents, getLocationPublishedEvents and getLocationPublishedEventsPublic.

Notes

  • On the location endpoints every row shares the same location (or none, on tbd), so the sort is effectively a no-op there; the point is that the same order the Room Occupancy page sends to /events/published no longer fails validation once a room is selected.

Test plan

  • +location / -location added to the location events order provider (real room and tbd, both endpoints): 8 new cases, all fail without the allowlist entry and pass with it.
  • testGetPublishedEventsOrderByLocation: summit-wide /events/published puts events without location first on +location and last on -location.
  • Full OAuth2SummitLocationsApiTest in the summit-api container: 91 tests OK (before adding the summit-wide test).

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.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df401c3e-262a-486c-a12b-c436a93f6f6d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-640/

This page is automatically updated on each push to this PR.

@smarcet smarcet self-assigned this Oct 13, 2026
@smarcet
smarcet merged commit 437df80 into fix/location-events-order-occupancy-track Oct 13, 2026
39 checks passed
smarcet added a commit that referenced this pull request Oct 13, 2026
)

* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant