-
Notifications
You must be signed in to change notification settings - Fork 20
Ingestion filters. Fixes #1192 #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 a comprehensive filtering system for ingestion sources, allowing users to configure allow lists and block lists to selectively import materials and events. This addresses issue #1192 and supports the mTeSS-x project's exchange feature.
Key Changes
- Introduced a new
SourceFiltermodel with support for multiple filter types (keyword, title, description, URL, etc.) and modes (allow/block) - Added filtering logic to the ingestion pipeline that executes after reading from remote sources
- Created a dynamic UI for managing filters with JavaScript-based form controls
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
db/migrate/20251209112056_create_source_filters.rb |
Creates the source_filters table with mode, type, and value fields |
db/migrate/20251218100418_remove_keyword_filter_from_sources.rb |
Removes deprecated keyword_filter column from sources |
app/models/source_filter.rb |
New model implementing filter matching logic for various field types |
app/models/source.rb |
Adds association to source_filters and implements passes_filter? method |
app/controllers/sources_controller.rb |
Updates controller to handle nested source_filters attributes |
app/views/sources/_form.html.erb |
Adds UI sections for allow list and block list filter configuration |
app/views/sources/_source_filter_form.html.erb |
Partial for individual filter form fields |
app/assets/javascripts/source_filters.js |
JavaScript for dynamically adding/removing filter forms |
app/assets/stylesheets/sources.scss |
Styling for filter form layout |
lib/ingestors/ingestor.rb |
Integrates filter method into ingestion write process |
app/workers/source_test_worker.rb |
Applies filters during source testing |
test/unit/ingestors/ingestor_test.rb |
Comprehensive tests for filter behavior |
test/fixtures/source_filters.yml |
Test fixtures for various filter configurations |
test/fixtures/materials.yml |
Test materials for filter testing |
test/fixtures/events.yml |
Test events for filter testing |
test/models/source_filter_test.rb |
Empty test file placeholder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db/migrate/20251218100418_remove_keyword_filter_from_sources.rb
Outdated
Show resolved
Hide resolved
Remove unused keyword_filter from permitted parameters when editing sources. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary of changes
Motivation and context
It is useful to not ingest everything from a source. Solves #1192. Important part of the exchange feature in the mTeSS-x project.
Screenshots
Checklist
to license it to the TeSS codebase under the
BSD license.