Repository navigation
fix(hotels): share and fly to a city without an IATA code (PET-504) - #116
ahsan-amin-wego wants to merge 8 commits into
Conversation
…ports-near PET-504: a places city row with a code that is not 3 letters (Makkah 8283) is not a flight endpoint. Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
Original prompt from Ahsan.amin
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Resolve airports for selected cities skills/wego/references/cli.md |
For selected cities with codes that are not three uppercase letters, the instructions direct resolving nearby airports from city coordinates, checking result names for train stations, and reporting the chosen airport and its computable distance. |
Numeric Hotel City Codes
| Layer / File(s) | Summary |
|---|---|
Document accepted city-code forms contract/openapi.json |
The getHotelSearchLink contract documents numeric city codes alongside three-letter codes. The required status and BKK example remain. |
Parse and validate hotel-share locations src/commands.ts, skills/wego/references/cli.md, integration/hotels.test.ts, src/hotels.test.ts |
The parser accepts three-uppercase-letter codes, numeric codes, and numeric ranges. Guidance says to use a city code from wego places, not a hotel ID, name, or coordinates. Tests cover accepted formats, including 8283, and reject invalid locations. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Possibly related PRs
- wego/cli#115: Changes hotel-share code resolution through
GET /v1/places; both PRs change the hotel-share contract.
Merge Risk: 
Low · previous review a47ad
-
This change lets hotel sharing accept numeric city codes and adds flight guidance for cities without airports. Two small gaps remain in the agent guidance. They are worth fixing but do not block merge.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title uses the Conventional Commits form
fix(hotels): .... The typefixis valid and the scopehotelsnames a real area of the change (hotel sharing and the hotels test/command code). The subject is imperative and lowercase. The title matches the main change: makinghotels shareaccept numeric city codes and updating flight guidance for cities without IATA codes. It does not mention the flights guidance change, which is a secondary part of the PR, but it is not misleading. No breaking-change!is needed because the change widens accepted input rather than altering the wire contract or stdout. The PET-504 key is included, which the repo requirements do not mandate.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
Mirrors the search-link cityCode of wego/wego-ai#2134 (API 0.19.4) ahead of its deploy. bun run api-contract:refresh replaces it once the API ships. Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
hotels share accepts 8283 (Makkah) and 1293-74 (Cannes), which wego.com opens like a 3-letter city code, and the refusal points at places --types city. A hotelId is numeric too, so it is no longer refused by shape; the skill says to pass only a places code. (PET-504) Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
|
@coderabbitai review |
Action performed
|
…hout coordinates airports-near refuses a numeric code, so a city row with no latitude and longitude ends with a question to the user. (PET-504) Co-Authored-By: ahsan.amin@wego.com <ahsan.amin@wego.com>
Summary
PET-504 · Done when 4 (
hotels share) and Done when 5 (flights skill guidance). API fix: wego/wego-ai#2134.After wego/wego-ai#2134,
wego places Makkah --types cityreturns a city with code8283. A code that is not 3 uppercase letters is not a flight endpoint. The flights bullet inskills/wego/references/cli.mdnow tells the agent to:wego info airports-near <latitude>,<longitude>with the city row's coordinates.name, because some rows are train stations (MKXis Makkah Train Station).JED, orTIFif Jeddah is ruled out), and tell the user which airport it chose. It gives the distance only when the row has coordinates. It searches a second airport only when the user asks to compare, because each search is metered.hotels share(Done when 4):parseHotelsShareArgsaccepts^([A-Z]{3}|\d{1,9}(-\d{1,9})?)$, so8283(Makkah) and1293-74(Cannes) share likeBKK. A refused code now gets:Pass a city code from `wego places <name> --types city`: 3 uppercase letters (BKK), or the numeric code a city without an airport carries (Makkah is 8283).710862) is numeric too, so the parser can no longer refuse it by shape. The usage-error case for it is removed, and the skill says to pass only aplacescode. The API cannot tell them apart either.contract/openapi.jsongets the search-linkcityCodeof wego/wego-ai#2134 (nopattern, new description), committed on its own. It is hand-applied because the API is not deployed yet;bun run api-contract:refreshreplaces it after the deploy.wego hotels share 8283 2027-01-20 2027-01-22gives a 400 against API main and…/hotels/searches/8283/2027-01-20/2027-01-22?guests=2&ulang=enagainst API PR. That URL on wego.com opens Makkah, Saudi Arabia (216 properties):PET-508 (rebase needed): this branch is off
mainand independent of wego/cli#115.git merge-treeof the two heads conflicts insrc/hotels.test.ts(both add imports and tests).src/commands.ts,contract/openapi.jsonandintegration/hotels.test.tsmerge clean. A rebase is needed after whichever PR lands first, thenbun run api-contract:refreshonce both API PRs are deployed.AGENTS.md: it says not to edit
skills/. Hereskills/wego/references/cli.mdis the shipped skill text the ticket asks to change, as #112 did.Done when (PET-504)
--types citytotalCandidates: 0,hasAmbiguity: falsehotels share 8283builds a link that opens Makkah, and the refusal points atplaces --types cityDone when 5 evidence
wego places Makkah --types city→8283at21.4227,39.8259(PR API only, main returns no row). Thenwego info airports-near 21.4227,39.8259, same on main and PR API:Table A: the ticket's commands, CLI at this repo's
main(1.5.1) against API main vs API PRCell: where the expected code is among the
cityrows, the first city row,metadata.totalCandidates,metadata.hasAmbiguity.wego places "Makkah" --types city8283wego places "Al Khobar" --types city45884wego places "Bethlehem" --types city31956wego places "Nazareth" --types city9475wego places "Interlaken" --types city6407wego places "Assisi" --types city1014wego places "Cannes" --types city1293-74wego places "Medina" --types cityMEDwego places "Jeddah" --types cityJEDwego places "Riyadh" --types cityRUHwego places "Dubai" --types cityDXBwego places "Cairo" --types cityCAIwego places "Doha" --types cityDOHwego places "Kuwait" --types cityKWIwego places "Manama" --types cityBAHwego places "Amman" --types cityAMMwego places "Taif" --types cityTIFwego places "Abha" --types cityAHBSetup: both APIs ran locally (
bun --env-file=.env.local.example src/dev.ts, ports 3101 and 3102, local JWKS and token,POSTHOG_PROJECT_TOKENandGENZO_API_URLempty). The CLI ran from source withWEGO_API_URL=http://localhost:<port>, so no PostHog key is baked in.bun run check: 1463 pass, 0 fail.🤖 Generated with Devin
Open in Devin Desktop: https://app.devin.ai/desktop/session/688f10f7af7747e4bc50b1e40d8b65fd?variant=devin
Requested by: @ahsan-amin-wego
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work
Summary by CodeRabbit
8283, while rejecting invalid location formats.