Skip to content

Visibility and Go updates#1

Open
benrobey wants to merge 1 commit intomainfrom
step1-visible-filter-and-deps
Open

Visibility and Go updates#1
benrobey wants to merge 1 commit intomainfrom
step1-visible-filter-and-deps

Conversation

@benrobey
Copy link
Owner

Visibility Filtering + Go version and dependency upgrades

Add optional visible_only filter to ListRaces

Behavior:

  • Omit the field or set it to false => you get all races (same as before).
  • Set it to true => you only get races where visible = true.

Upgraded out of date go 1.16 -> 1.22 for needed updated language features

Example 1: Get All Races (no filtering)

curl -s -X POST http://localhost:8000/v1/list-races \
  -H "Content-Type: application/json" \
  -d '{}'

Shows every race (visible + non‑visible). This matches legacy behavior.

Example 2: Only Visible Races

curl -s -X POST http://localhost:8000/v1/list-races \
  -H "Content-Type: application/json" \
  -d '{
        "filter": {
          "visible_only": true
        }
      }'

Narrows the list to races currently marked visible.

Example 3: Combine With Meeting IDs

curl -s -X POST http://localhost:8000/v1/list-races \
  -H "Content-Type: application/json" \
  -d '{
        "filter": {
          "meeting_ids": [1,2],
          "visible_only": true
        }
      }'

Returns only visible races whose meeting_id is 1 or 2.

Sample Truncated Response

{
  "races": [
    {
      "id": 42,
      "meeting_id": 1,
      "name": "Morning Dash",
      "number": 3,
      "visible": true,
      "advertised_start_time": "2025-08-17T09:15:00Z"
    }
  ]
}

- Add optional visible_only filter to ListRaces (proto + gateway),
- Repository now applies WHERE visible = 1 only when visible_only=true; default behavior unchanged. - - Regenerated protobufs correctly under proto/racing.
- Modernized go directive to 1.22 (left most dependency versions conservative after failed genproto upgrade attempt) and ran mod tidy
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