-
Notifications
You must be signed in to change notification settings - Fork 5
Feat/improve tools synchronization #166
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
Open
NicolasLafitteMM
wants to merge
3
commits into
main
Choose a base branch
from
feat/improve-tools-synchronization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
…, and Slack This commit implements a robust bidirectional synchronization system: ## New Features - **Bidirectional sync**: Full sync between Impact incidents and Jira tickets - **Real-time webhook processing**: Handle Jira webhook updates instantly - **Loop prevention**: Cache-based mechanism to prevent infinite sync loops - **Field-level sync**: Granular synchronization of title, description, priority, status - **Smart filtering**: Only sync relevant field changes, ignore system updates ## Architecture - **sync.py**: Core synchronization functions with comprehensive error handling - **incident_updated_sync.py**: Django signal handlers for incident changes - **Enhanced serializers**: Improved webhook processing with sync integration - **Factory improvements**: Better support for test fixtures and incidents ## Quality Improvements - **Comprehensive tests**: 45 new test cases covering all sync scenarios - **Proper priority handling**: Respect static priority data, no more deletions - **MyPy compliance**: Full type safety with proper annotations - **Django best practices**: Proper signal handling and database transactions ## Database Safety - Fixed foreign key constraint issues in tests - Proper cleanup order: JiraTicket → Incident (preserving Priority objects) - Use get_or_create for reference data instead of deletion
073c434 to
926f0c4
Compare
The RaidJiraClient was not calling the parent JiraClient's __init__ method, which prevented proper initialization and access to inherited methods like get_jira_user_from_user. This caused test failures in the CI pipeline. This fix ensures the parent class is properly initialized, allowing all inherited methods to work correctly.
Two tests were causing timeouts in CI because they made real JIRA API calls: - test_sync_jira_priority_to_incident_success - test_sync_jira_fields_to_incident Added @patch decorators to mock jira_client and prevent external API calls. This allows tests to run in CI environment without JIRA access. All tests now pass: 345/345 ✅
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
==========================================
+ Coverage 65.77% 66.06% +0.28%
==========================================
Files 199 202 +3
Lines 8907 9223 +316
Branches 912 970 +58
==========================================
+ Hits 5859 6093 +234
- Misses 2836 2895 +59
- Partials 212 235 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
/rerun |
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.
Summary
Implements bidirectional synchronization between Impact incidents and JIRA tickets with loop prevention.
Key Changes
Technical Details