Skip to content

feat: added license filtering to search endpoint#1593

Merged
cka-y merged 5 commits intomainfrom
feat/1562
Feb 5, 2026
Merged

feat: added license filtering to search endpoint#1593
cka-y merged 5 commits intomainfrom
feat/1562

Conversation

@cka-y
Copy link
Contributor

@cka-y cka-y commented Feb 5, 2026

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:

  • Added license_ids and license_is_spdx as 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]
  • Updated backend search logic to handle these new filters, including parsing, filtering, and passing the parameters through the query-building functions. [1] [2] [3] [4] [5] [6] [7]

Database and Model Updates:

  • Modified the feed_search materialized view to include license_id, license_is_spdx, and related fields, and added indexes for efficient querying by license. [1] [2] [3] [4]
  • Updated the feed search result model to include license_id and license_is_spdx attributes for all feed types. [1] [2] [3] [4]

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ids and license_is_spdx query parameters to the search API
  • Updated the feed_search materialized 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

cka-y and others added 3 commits February 5, 2026 08:45
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>
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 96 🟢 100 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 93 🟢 91 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 76 🔴 0 🟢 93 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 77 🟠 87 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 100 🟢 100 🟢 100

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-1593-8mpjitkh.web.app

@davidgamez
Copy link
Member

We are missing a Liquibase changelog entry to ensure the materialized view is updated.

@cka-y
Copy link
Contributor Author

cka-y commented Feb 5, 2026

@davidgamez not with the latest changes introduced in #1535

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cka-y cka-y merged commit 8dd6737 into main Feb 5, 2026
7 checks passed
@cka-y cka-y deleted the feat/1562 branch February 5, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add license information and filters to the search endpoint

2 participants