Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds license filtering capabilities to the search API endpoint, enabling users to filter feeds by specific license IDs or by whether the license is an SPDX-compliant license. The implementation includes database schema updates to the materialized view, new API parameters, backend filtering logic, and test data to support the new functionality.
Changes:
- Added
license_idsandlicense_is_spdxquery parameters to the search API - Updated the
feed_searchmaterialized view to include license-related columns (license_id,license_is_spdx,license_name) with corresponding indexes - Implemented filtering logic in the search API to handle the new license parameters
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/DatabaseCatalogAPI.yaml | Added API parameter definitions for license_ids (comma-separated string) and license_is_spdx (boolean) |
| liquibase/materialized_views/feed_search.sql | Extended materialized view with license fields from License table join and created indexes for efficient querying |
| api/src/feeds/impl/search_api_impl.py | Implemented filtering logic for license_ids (IN clause) and license_is_spdx (boolean with null handling) |
| api/src/shared/db_models/search_feed_item_result_impl.py | Added license_id and license_is_spdx fields to all feed type response models (GTFS, GBFS, GTFS-RT) |
| api/tests/test_data/extra_test_data.json | Added test licenses and feed-license associations for integration testing |
| api/tests/integration/test_search_api.py | Added integration test for license_ids filtering with multiple test cases |
| api/tests/unittest/models/test_search_feed_item_result_impl.py | Updated unit test mock data to include license fields |
| api/src/scripts/populate_db_test_data.py | Added logic to populate license table and link licenses to feeds during test data setup |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/ * (Desktop)
*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds * (Desktop)
*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds/gtfs/mdb-2126 * (Desktop)
*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/gbfs/gbfs-flamingo_porirua * (Desktop)
|
|
Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app |
|
We are missing a Liquibase changelog entry to ensure the materialized view is updated. |
|
@davidgamez not with the latest changes introduced in #1535 |
Summary:
This PR adds support for filtering feeds by license in the search API, including new query parameters for license IDs and SPDX status, updates to the database schema and materialized view, and enhancements to test data and integration tests. These changes enable users to search for feeds based on specific license requirements and improve the overall flexibility of the search functionality.
API and Search Enhancements:
license_idsandlicense_is_spdxas query parameters to the search API, allowing users to filter feeds by specific license IDs or whether the license is an SPDX license. [1] [2]Database and Model Updates:
feed_searchmaterialized view to includelicense_id,license_is_spdx, and related fields, and added indexes for efficient querying by license. [1] [2] [3] [4]license_idandlicense_is_spdxattributes for all feed types. [1] [2] [3] [4]Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything