feat: add auto assign calls when a feed is added#1651
Draft
davidgamez wants to merge 2 commits intomainfrom
Draft
feat: add auto assign calls when a feed is added#1651davidgamez wants to merge 2 commits intomainfrom
davidgamez wants to merge 2 commits intomainfrom
Conversation
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.
From our AI friend
This pull request introduces automated license assignment for feeds based on their
license_url, improving data quality and reducing manual review. The core change is the newassign_license_by_urlfunction, which resolves and assigns a license to a feed if a confident match is found, and records the assignment with a verification status. The implementation is integrated into both the database population scripts and the API feed creation endpoints. Additionally, a newverifiedcolumn is added to thefeed_license_changetable to track whether an assignment was auto-verified or requires human review. Comprehensive unit tests are included for the new assignment logic.Automated license assignment and verification:
assign_license_by_urltolicense_utils.py, which resolves and assigns a license to a feed using itslicense_url, auto-verifies high-confidence matches, and records the assignment infeed_license_changeswith averifiedflag.populate_db_gtfs.py,populate_db_gbfs.py) to callassign_license_by_urlwhen adding new feeds with alicense_url. [1] [2]Database and model updates:
verifiedcolumn to thefeed_license_changetable to indicate whether a license assignment was auto-verified or needs human review.assign_feed_licenseto set theverifiedflag using the same confidence threshold logic asassign_license_by_url. [1] [2]Testing and reliability:
assign_license_by_urlcovering all key behaviors, including no match, single/multiple matches, verification threshold, and duplicate assignment prevention.These changes automate and standardize license assignment for feeds, improving accuracy and auditability while reducing manual intervention.
Summary:
Summarize the changes in the pull request including how it relates to any issues (include the #number, or link them).
Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything