Show regex-tagged watches under their group tab#4267
Open
willyjfarrell wants to merge 1 commit into
Open
Conversation
…m group tab filter watch_matches_tag() checked only the persisted watch['tags'] list, which manual tag assignment writes to but regex auto-matching never does (it's computed live by datastore.get_all_tags_for_watch() and only consumed by the badge renderer). Thread datastore through the filter chain so the tab filter and bulk actions check the same effective tag set as the badge.
Owner
|
Thanks for this! |
Author
No problem! Do you handle merging? Any other action needed on my part to help push this through? |
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.
Resolves #4193
Watches can get a group (tag) two ways: manually via the watch edit form, or automatically when a group's
url_match_patternregex matches the watch URL. Clicking a group's tab in the main UI filters the watch list by tag, but only manually-assigned watches showed up. Regex-matched watches would display the tag badge on their row but vanish when you clicked that tag's tab.Root cause:
watch_matches_tag()inchangedetectionio/blueprint/watchlist/filters.pychecked membership against the raw, persistedwatch['tags']list. Manual assignment writes into that list. Regex auto-matching does not, it's computed on the fly bydatastore.get_all_tags_for_watch()and was only ever consumed by the tag badge template, never by the tab filter.Fix threads
datastorethrough the filter chain (watch_matches_tag,watch_in_context,watch_matches_filters, and their call sites in thewatchlistanduiblueprints) so the tab filter and bulk actions check the same effective tag set the badge already uses, instead of the raw list.Added a regression test in
changedetectionio/tests/test_tag_url_match.pycovering a watch tagged only via regex showing up under that tag's filtered view.Test plan
pytest changedetectionio/tests/test_tag_url_match.py, all pass including the new testpytest changedetectionio/tests/test_api.py, no regressions from this change