refactor: Enhance error handling in contest filters to log non-fatal warnings for missing categories and unrecognized wikis - #67
Merged
jhsoby merged 5 commits intoNov 21, 2025
Conversation
…warnings for missing categories and unrecognized wikis
Contributor
There was a problem hiding this comment.
Pull Request Overview
The PR refactors error handling in contest filters to log warnings instead of immediately failing for non-fatal issues such as missing categories or unrecognized wikis.
- Replaces the direct category resolution with an iterative approach that logs warnings for missing categories.
- Adds an extra validation loop for categories on unrecognized wikis, attaching corresponding warnings.
- Updates contest rule extraction to differentiate between fatal errors and non-fatal warnings based on error message checks.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ukbot/filters.py | Replaces direct list comprehension with iterative error logging for categories and adds validation for unrecognized wikis. |
| ukbot/contest.py | Updates error handling in rule extraction to distinguish fatal errors from warnings. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…unrecognized sites and missing categories
…unrecognized sites and missing categories
DiFronzo
marked this pull request as ready for review
May 25, 2025 14:55
jhsoby
approved these changes
Nov 21, 2025
jhsoby
deleted the
62-results-not-updated-if-a-category-given-in-criteria-doesnt-exist
branch
November 21, 2025 13:52
jhsoby
pushed a commit
that referenced
this pull request
Nov 21, 2025
…warnings for missing categories and unrecognized wikis (#67) This PR adds enhanced error handling in contest filters, logging non-fatal warnings for missing categories and unrecognized wikis. It has been tested, but there may still be edge cases I haven’t considered. It will show in console like this:  On wiki[[1](https://no.wikipedia.org/w/index.php?title=Bruker:Premeditated/Sandkasse5&oldid=25156842)]:  - [ ] 🍕 Feature - [X] 🐛 Bug Fix - [ ] 📝 Documentation Update - [ ] 🎨 Style - [x] 🧑💻 Code Refactor - [ ] 🔥 Performance Improvements - [ ] ✅ Test - [ ] 🤖 Build - [ ] 🔁 CI - [ ] 📦 Chore - [ ] ⏩ Revert Fixes #62 - [X] 👍 yes - [ ] 🙅 no, because they aren't needed - [ ] 🙋 no, because I need help - [ ] 📜 README.md - [ ] 📖 own file under the docs folder - [X] 🙅 no documentation needed perform? No --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Description
This PR adds enhanced error handling in contest filters, logging non-fatal warnings for missing categories and unrecognized wikis.
It has been tested, but there may still be edge cases I haven’t considered.
It will show in console like this:


On wiki[1]:
What type of PR is this? (check all applicable)
Related Tickets & Documents
Fixes #62
Tested?
Added to documentation?
[optional] Are there any pre- or post-deployment tasks we need to perform?
No