Fix mypy attr-defined errors in JobRegistry - #2395
Conversation
…te for mypy Co-authored-by: amirbiron <215461772+amirbiron@users.noreply.github.com>
|
This branch has conflicts that must be resolved services/job_registry.py |
|
פתרתי את הקונפליקט ב- הפתרון משלב את שני השינויים:
הסרתי את ה-type annotation מתוך הקוד הסופי:
Learn more about Cursor Agents |
Merged changes from base branch (cursor/github-context-response-a963): - Keep the race-condition-safe pattern in __new__ (initialize _jobs before exposing instance) - Keep the __init__ method with type annotation for mypy compatibility - Remove inline type annotation from __new__ (mypy doesn't allow type declarations on non-self attributes) Both the race condition fix and mypy compatibility are preserved.
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Cursor Agent can help with this pull request. Just |
⏱️ Performance report(No performance test durations collected. Mark tests with |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
b4d5579
into
cursor/github-context-response-a963
* feat: Add background jobs monitor API and UI Co-authored-by: amirbiron <amirbiron@gmail.com> * feat: Add background jobs monitor to settings Co-authored-by: amirbiron <amirbiron@gmail.com> * Fix: Implement job trigger endpoint and improve error handling Co-authored-by: amirbiron <amirbiron@gmail.com> * Fix mypy attr-defined errors in JobRegistry (#2395) * Initial plan * fix: Add __init__ to JobRegistry to properly initialize _jobs attribute for mypy Co-authored-by: amirbiron <215461772+amirbiron@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: amirbiron <215461772+amirbiron@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> * Make get_job_tracker thread-safe Co-authored-by: amirbiron <amirbiron@gmail.com> * Refactor job tracking and registry, improve error handling Co-authored-by: amirbiron <amirbiron@gmail.com> * Refactor: Improve logging levels in JobTracker Co-authored-by: amirbiron <amirbiron@gmail.com> * Refactor: Improve job registry and command handling Co-authored-by: amirbiron <amirbiron@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: amirbiron <215461772+amirbiron@users.noreply.github.com>
✨ תיאור קצר
תיקון שגיאות mypy
attr-definedב-JobRegistryשנגרמו מאתחול דינמי של_jobsב-__new__. mypy לא זיהה את האטריביוט כאשר הוא הוגדר רק במתודת הסינגלטון.📦 שינויים עיקריים
פירוט נקודות (רשימת תבליטים):
services/job_registry.py: נוספה מתודת__init__ל-JobRegistryהמאתחלת את_jobs: Dict[str, JobDefinition]עם type annotation מפורש. הדבר שומר על דפוס הסינגלטון תוך פתרון 7 שגיאות mypyattr-defined.🧪 בדיקות
🧪 בדיקות נדרשות ב‑PR
📝 סוג שינוי
✅ צ'קליסט
docs/environment-variables.rstוגםservices/config_inspector_service.pydocs/webapp/theming_and_css.rst+FEATURE_SUGGESTIONS/theme_matrix.md🧩 השפעות/סיכונים
🔗 קישורים
🧯 סיכון / החזרה לאחור (Rollback)
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Note
Resolves mypy
attr-definederrors by ensuring_jobsis defined with a clear type on instance initialization.services/job_registry.py, adds__init__that setsself._jobs: Dict[str, JobDefinition] = {}if missing__new__to assignnew_instance._jobs = {}(type annotation moved to__init__) to keep thread-safe singleton setupWritten by Cursor Bugbot for commit 88c3e88. This will update automatically on new commits. Configure here.