Repository navigation
Conversation
…ints
The create, delete, update type, add feature and remove feature badge
endpoints are documented to take the ticket id or number in {ticket_id}.
SummitOrderService fell back to the lookup by number but dropped its
result, so a ticket found by number was treated as missing and the
endpoints always answered 404.
createBadge and deleteBadge also overwrote the summit received as
parameter with the summit of the order right before comparing them, so
a badge could be created or deleted through the URL of another summit.
Both now compare against the summit of the URL and answer 404.
Document {ticket_id} as ticket id or number (string) in the OpenAPI
attributes of the five endpoints and add tests for each endpoint called
with the ticket number, with an unknown number, and through another
summit.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-681/ This page is automatically updated on each push to this PR. |
ref https://app.clickup.com/t/9014802374/1k5eh578rjz
Summary
Five badge endpoints under
/api/v1/summits/{id}/tickets/{ticket_id}/badgeare documented to take the ticket id or the ticket number (TICKET_...) in{ticket_id}. With the id they worked. With the number they always answered404 Ticket not found, even when the ticket existed.SummitOrderService::createBadge,deleteBadge,updateBadgeType,addAttendeeBadgeFeatureandremoveAttendeeBadgeFeaturefell back togetByNumberExclusiveLockbut dropped its result. The result is now assigned to$ticket.createBadgeanddeleteBadgeoverwrote the$summitparameter with the summit of the order right before comparing them, so the check never failed and a badge could be created or deleted through the URL of another summit. They now compare against the summit of the URL and answer 404.{ticket_id}is documented as "Ticket ID or number" (string) in the OpenAPI attributes of the five endpoints.Tests
Eight new tests in
tests/oauth2/OAuth2SummitTicketsApiTest.php:Against current
main(tests only, without the fix) 7 of the 8 fail; the unknown-number test passes in both cases because it guards the existing 404. With the fix all pass.vendor/bin/phpunit tests/oauth2/OAuth2SummitTicketsApiTest.php:OK (49 tests, 265 assertions), includingtestCreateAttendeeBadge,testDeleteAttendeeBadge,testUpdateAttendeeBadgeType,testAddAttendeeBadgeFeatureandtestRemoveAttendeeBadgeFeature, which call the endpoints with the ticket id.php artisan l5-swagger:generateshowsticket_idas "Ticket ID or number", type string, on the five endpoints.Risks
intval(), so a ticket number starting with a digit would be taken for the id of another ticket. Numbers are generated with theTICKET_prefix and none of the 88223 tickets in production starts with a digit (checked on 2026-11-19).Out of scope
SummitOrderService::refundTickethas the same lookup by number and is fixed in fix(refunds): give back the tax an order was charged, to the cent #680.getAttendeeBadge(used by the print and can-print badge endpoints) also overwrites$summitwith the summit of the order before comparing. It is tracked separately in https://app.clickup.com/t/1k5eh578t66.Notes
To run the test class locally it must run inside the
summit-apicontainer withREGISTRATION_VALIDATE_TICKET_TYPE_REMOVAL=false, as the CI does. OtherwisetearDownfails on every test of the class, also onmain.🤖 Generated with Claude Code
Summary by CodeRabbit