Bringing in new services and removing hard coded elements from the platform#6
Merged
jacksonlester merged 27 commits intomainfrom Oct 16, 2025
Merged
Bringing in new services and removing hard coded elements from the platform#6jacksonlester merged 27 commits intomainfrom
jacksonlester merged 27 commits intomainfrom
Conversation
- Update rebuild-cache.js to support staging and production modes - Add environment detection based on STAGING env var - Use staging-specific tables and buckets when STAGING=true - Skip timestamped backups in staging (cleaner staging bucket) - Update GitHub Actions workflow to handle both branches - Add staging branch trigger and environment detection - Create sync-prod-to-staging.js script for refreshing staging data - Create copy-geometries.js script for syncing geometry files - Update README with staging workflow and promotion process - Update CONTRIBUTING.md to direct PRs to staging branch
Add staging environment support to data pipeline
Add chandler flex
- Contributors now fork from main (stable) rather than staging (WIP) - PRs still target staging for testing before production - Clarified workflow in both README and CONTRIBUTING files
…ervices This adds a new 'flexibility' field to track whether riders can travel freely between any points in the service area (point-to-point) or only to/from predetermined stops (stop-to-stop). Changes: - Add flexibility column to events.csv after direct_booking - Populate all service_created events with flexibility values - Most services: Point-to-Point - Zoox Las Vegas: Stop-to-Stop - Update CONTRIBUTING.md with flexibility field documentation - Add flexibility_updated event type support to rebuild-cache.js - Add flexibility validation to test_validation.py Services with stop-to-stop flexibility will display with dashed borders and reduced opacity in the map UI to indicate limited service. The field is backward compatible - optional in TypeScript and handled gracefully when missing from old data.
This adds a new import-csv.js script that reads events.csv and syncs it to the Supabase database (production or staging). The script: - Parses events.csv with proper handling of optional columns - Converts CSV rows to the database event format (event sourcing) - Maps CSV fields to event_data structure - Handles all event types (service_created, *_updated, *_changed) - Clears and repopulates the database table - Verifies import success Usage: node import-csv.js # Import to production STAGING=true node import-csv.js # Import to staging This solves the missing flexibility field issue - now when events.csv is updated, you can run this script to sync it to the database, then rebuild the cache. Changes: - Add import-csv.js script - Add csv-parse dependency to package.json - Includes flexibility field mapping
The database stores fields in snake_case (direct_booking, vehicle_types, fleet_partner) but the frontend TypeScript interfaces expect camelCase (directBooking, vehicleTypes, fleetPartner). Added transformEventData() helper to convert field names during cache rebuild so the generated JSON uses camelCase throughout. This fixes the issue where Zoox showed directBooking: null instead of "Yes".
When the flexibility column was added, existing update events (with 14 fields) were missing the empty flexibility field, causing all subsequent columns to shift left by one. CSV changes: - Added empty flexibility field (column 10) to all rows with 14 fields - All rows now have 15 fields, properly aligned with headers Import script improvements: - For update events, only include the field being updated as new_* in event_data - Don't include the field being updated under its regular name to avoid duplication - Always include company, city, notes, and source_url for all events - For service_created, include all fields as before This fixes issues where: - fleet_partner values were appearing in the access field - source_url values were appearing in the fleet_partner field - notes values were appearing in the source_url field
The workflow now runs import-csv.js before rebuild-cache.js to ensure events.csv changes are synced to the database before rebuilding the cache. Without this, CSV changes would trigger the workflow but not actually be included in the rebuilt cache (since rebuild-cache.js reads from the database, not directly from the CSV).
Calculate area_square_miles automatically from GeoJSON geometry files during cache rebuild. Uses @turf/area to compute area in square meters, then converts to square miles. Area is calculated: - When a service is created (service_created events) - When geometry is updated (geometry_updated events) This ensures area is always up-to-date and resilient - when new service areas are added, their area is automatically calculated from the geometry file.
Added company_link and booking_platform_link columns to events.csv to make service links data-driven instead of hardcoded. Updated import and cache scripts to handle the new fields with proper snake_case to camelCase transformation.
Added historical Cruise San Francisco service (2022-2023) and May Mobility services in Grand Rapids MI/MN, Martinez CA, and Peachtree Corners GA. All events sorted chronologically.
- upload-geometries.js: Uploads local geometry files to Supabase storage - sync-geometries-table.js: Syncs storage bucket with geometries database table These scripts ensure new geometry files are properly uploaded and registered in the database.
Automatically runs when events.csv or geometry files are pushed to main or staging branches. Workflow: 1. Imports CSV to database 2. Uploads geometry files to storage 3. Syncs geometries table 4. Rebuilds cache Can also be manually triggered via workflow_dispatch.
Transform geometry fields from snake_case (geometry_name, geojson_data) to camelCase (geometryName, geojsonData) when building the cache. This fixes the issue where geometries weren't being found by the frontend because the field names didn't match.
Set platform to 'Grand Rapids' for the initial May Mobility Grand Rapids MI service to prevent it from showing as 'Unknown' and being filtered out by default.
shloksooch
pushed a commit
to shloksooch/av-map-data
that referenced
this pull request
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data Changes:
Infrastructure & Automation:
Bug Fixes:
Documentation: