Closed cka-y closed 1 week ago
Integration tests are expected to fail for this PR due to changes in the database schema. Specifically, the error encountered is:
psycopg2.errors.UndefinedColumn: column feed.operational_status does not exist
LINE 1: ...ed_contact_email, feed.provider AS feed_provider, feed.opera...
View full logs for additional details.
Integration tests are expected to fail for this PR due to changes in the database schema. Specifically, the error encountered is:
psycopg2.errors.UndefinedColumn: column feed.operational_status does not exist LINE 1: ...ed_contact_email, feed.provider AS feed_provider, feed.opera...
View full logs for additional details.
This makes sense. When we added the integration tests pointing to QA, we predicted that in cases of schema changes, this step would fail as a guardrail for merging. However, it is still a great check for PRs that don't introduce a schema change on the main tables.
Summary: This pull request introduces visibility restrictions for work-in-progress (WIP) feeds in
feeds_api_impl.py
andsearch_api_impl.py
, based on user email domains. It includes a new function to determine if a user’s email is restricted, updating query filters accordingly to enforce feed visibility rules. Additionally, a new SQL script is included to update the database schema and refresh the materialized view to support these changes.Expected Behavior: Feeds marked with an internal status of "WIP" are only visible to users with email domains ending in
@mobilitydata.org
. Users with other domains will not see these WIP feeds.Testing Instructions:
gtfs
,gtfs_rt
, andfeeds
endpoints, as well as the search functionality, while setting thex-goog-authenticated-user-email
header to emails ending with both@mobilitydata.org
and non-@mobilitydata.org
domains.@mobilitydata.org
emails can view WIP feeds.Testers are encouraged to follow these instructions but are also welcome to explore other test cases to ensure robust behavior outside the listed scenarios.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.sh
to make sure you didn't break anything