feat: script for detecting unstable producer urls - #1627
Draft
ianktc wants to merge 2 commits into
Draft
Conversation
…on realtime schema for future
emmambd
reviewed
Aug 21, 2026
emmambd
left a comment
Contributor
There was a problem hiding this comment.
Someone else on the team is probably better positioned to review this one than me. Are there specific requirements you wanted to discuss?
Contributor
Author
I saw comments on the other pr #1629 so I'll refine the detection rules so we don't catch false positives. I'll bring it up to the team after I can finalize them with you |
Contributor
|
@ianktc Sounds good - looking at the "Detection rules" here, there may be some that I mistook as a false positive |
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.
Summary
is_producer_url_unstableis used to identify feeds whose urls may change over time due to a date or a version baked into it. The feed url therefore stops being accessible the moment the agency publishes again with a different version or date. Only active and inactive feeds are scanned, and deprecated feeds can be scanned if a flag is added.This PR adds
scripts/identify_unstable_urls.py, which scans producer URLs for thatevidence and applies the field to what it finds. It also adds the
is_producer_url_unstablefield to the realtime feed schema in case of future adoption.Usage
The script never writes on a plain run. The intended workflow is scan, read the CSV, then
apply:
Other options:
--data-type {gtfs,gtfs-rt,all}to narrow the catalog,--include-deprecatedto also scan deprecated feeds (raises the count from 86 to 126), and
--weakto print thesignals that are deliberately never flagged, for manual review.
Redaction rules — Tokens to ignore (allow-list)
Blanked to a sentinel before any matching runs, so they cannot contribute a hit.
uuidhex_idazure_service_versionsv=YYYY-MM-DDazure_signaturesig=…credentialapi_key/token/key/subscription-key=…apiKeyis indistinguishable from a pinned commit; 8 feeds were mis-flagged before thisapi_version_segment/vN/as a whole segmentapi_version_segment_dotted/vN.0/as a whole segmentdata.waltti.fiserves 11 feeds from/v1.0/transitfeeds_id/p/<agency>/<id>/latestdrive_file_id?id=<25+ chars>Detection rules — Token to trigger hit
Set
is_producer_url_unstableto"True"iso_dateYYYYMMDD/-/_/.separated, plus optionalHHMM/HHMMSSdelimited_yearwordpress_upload_folderwp-content/uploads/[sites/N/]YYYY/MM/dated_version_tag2020.0401.1style release tagsdotted_versionv2.8,?v=0.16.0,v1.0.0locale_date03.10.2025,06-07-2021,5.12.21month_abbreviation_with_digitscoquimbo10feb16version_query_parameter&version=20250220epoch_timestampmonth_namedotnet_ticksDateTime.Tickslabelled_year2025Winter,Spring2025,Q1-CY2025,CY2026shared_access_signature_windowst=/se=expirycache_busterrefresh=/nocache=/timestamp=+ 8+ hexpinned_git_shalarge_version_countervNN+—GTFS-V126year_monthYYYYMM—gtff-202311