View the workflow.
The file at /inputs/dse-sofi-express.csv
contains special Express Bus service serving Dodger Stadium and SoFi Stadium during baseball and football seasons.
A new calendar_dates.txt
file is generated weekly Tuesday night/Wednesday morning. It contains data for only the following two weeks. Each new calendar_dates.txt
overlaps the previous one by 1 week. As a result, the weekly calendar_dates.txt
file cannot just be appended to the GTFS base calendar_dates.txt
file. The GTFS base files are the ones released from the most recent shakeup.
This automation script performs the following steps:
- Load GTFS base
calendar_dates.txt
file. - Load the weekly
calendar_dates.txt
file.
Bus GTFS processing and Rail GTFS processing looks different.
Options:
- Combined Bus & Rail + Validation Code
- One single repository that includes bus GTFS, rail GTFS, separate processing code for each, common code for automating validation and email notifications.
- Separate Bus & Rail + Validation Repo
- Separate repositories for bus GTFS + processing and rail GTFS + processing.
- Automated validation and email notifications would live in a separate place and would just be triggered by the bus/rail rep os as needed. This could be a third repository or a GH Action.
Concerns:
- Code redundancy
- Repo size
Workflow:
-
Rail GTFS
- Runs nightly
- File is picked up from FTP location
- File is run through validation
- If validation is successful:
- Update repository files
- Send email notification of update to data consumers
- If validation is not successful:
- Do not update repository files
- Send email notification to administrators
-
Bus GTFS
- 3 active branches:
main
,future-service
,current-base
- Multiple triggers for runs:
- Bus Shakeups multiple times a year, cannot be scheduled
- Dodger Stadium & SoFi Stadium Express service, cannot be scheduled
- Weekly
calendar_dates.txt
files.
- Weekly
calendar_dates.txt
file- Weekly basis, Wednesday early AM
- File is picked up from FTP location
- Add this file to
main
branch under a sub-folder:current/calendar_dates.txt
- Merge this new file into the existing
calendar_dates.txt
withinmain
, removing the existing 2-week span. - Re-zip all the files into a new GTFS
- Run new file through validation
- If validation is successful:
- Update
main
branch files - Send email notification of update to data consumers
- Update
- If validation is not successful:
- Do not update
main
branch files - Send email notification to administrators
- Do not update
- Stadium Express Service
- A few times a year, not predictable and cannot be scheduled.
- The
dse-sofi-express.csv
file is updated in themain
branch. - This triggers processing:
- The
dse-sofi-express.csv
file is merged intocalendar_dates.txt
in themain
branch.
- The
- Re-zip all the files into a new GTFS
- Run new file through validation
- If validation is successful:
- Update
main
branch files - Send email notification of update to data consumers
- Update
- If validation is not successful:
- Do not update
main
branch files - Send email notification to administrators
- Do not update
- Bus Shakeup
- Upload file to
future-service
branch and we set a publish date in a config file - This triggers processing (GH-Action #1):
- Checkout the
current/calendar_dates.txt
file from themain
branch and commit it to thefuture-service
branch - Merge the
current/calendar_dates.txt
file into thecalendar_dates.txt
file in thefuture-service
branch - Checkout the
dse-sofi-express.csv
from themain
branch and commit it to thefuture-service
branch - Merge the
dse-sofi-express.csv
file into thecalendar_dates.txt
file in thefuture-service
branch
- Checkout the
- Re-zip all the files into a new GTFS
- Run new file through validation
- If the validation is successful:
- Update
future-service
branch files - On the configured publish date (GH-Action #2):
future-service
branch will be merged intomain
branch and the GTFS zip file tocurrent-base
- Send email notification of update to data consumers
- Update
- If the validation is not successful:
- Do not update
future-service
branch files - Send email notification to administrators
- Do not update
- Upload file to
- 3 active branches:
TEST
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;