-
Notifications
You must be signed in to change notification settings - Fork 253
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
notification: move message definitions to nfymsg package #4027
Merged
Conversation
This file contains 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
- Added `Equal` method to `DestV1` for comparison. - Consolidated `type` and `value` fields into `dest`. - Adjusted SQL queries and methods to handle `dest`. - Updated ContactMethod normalization and validation logic. - Introduced destination registry for contact methods. - Modified tests to reflect the new structure.
- Switched resolver methods for `dest` and `type` fields - Deprecated `value` and `type` fields in schema in favor of `dest` - Removed redundant `Dest` resolver and its related code
- Deleted `contactmethod_test` file - Test was redundant and covered elsewhere
- Removed CompatCMToDest function - Updated method to use obj.Dest directly for DisplayInfo
- Removed unnecessary validation logic for input fields - Streamlined the creation of the contact method object - Dropped dependencies on several unused packages to clean up imports
- Retrieve and use additional type information to determine support and requirement for status updates - Simplify conditions by removing redundant checks
- Refactor hard-coded email and webhook destination types - Improve code maintainability and reduce import cycles risk
- Ensure proper error handling for unknown field IDs and destination types. - Fix missing return statements in Twilio SMS and Voice validation functions.
- Added stub-notifiers to Procfile variations - Configured fake Twilio credentials for testing
- Deleted Type field and related Value field from ContactMethod - Removed type.go file and associated logic - Cleanup to simplify code and remove unused functionality
- Added Twilio destination type to contact methods - Updated data generation to set Twilio SMS/Voice types - Modified database columns and data population logic
- Added support for dynamic notification destination types. - Refactored SQL queries to handle flexible destination types. - Removed hardcoded 'SLACK_DM' to allow for more adaptable updates. - Incorporated nfydest.Registry for better type management.
- Removed hard-coded destination types for contact methods - Simplified contact method database fields - Updated search parameters and query to use new destination fields - Removed unused imports and validation logic
- Remove redundant SQL statement - Delete unused `cmtype.go` - Replace contact method types with a new enum - Simplify and normalize destination creation - Add validation for input values in mutations
- Eliminated unneeded `if err != nil` checks in `Channel` and `ListChannels` methods to streamline error handling.
- Added CompatCMTypeValToDest helper function - Refactored CreateUserContactMethod to use new helper - Simplified user search logic to use new CompatCMTypeValToDest function - Removed redundant import statements
- Check if DestArgs length is 0 rather than just existence
- Fixed handling of CMType and CMValue to avoid null issues - Corrected SQL queries to properly check DestArgs length
- Moved message-related types and functions to `nfymsg` subpackage for better organization. - Introduced `compat.go` for backwards compatibility. - Renamed and relocated message handling and status files. - Removed redundant status definitions from the base notification package.
- Added new alert states and constants to `compat.go` - Removed obsolete `AlertPendingNotification` type - Standardized the use of `nfymsg` constants in `store.go` - Cleaned up `messagetype.go` to remove redundant type definition
Correctly reference `s.Age` property and method to ensure accurate alert notification state formatting based on age.
Corrected the error message assertion to use the appropriate enum name "nfymsg.ScheduleOnCallUsers" for consistency and accuracy in test validations.
- Added enum-based LastStatus mapping - Improved accuracy of status representation
- Consolidate status mapping logic into helper function - Add error handling for status conversion
KatieMSB
approved these changes
Aug 1, 2024
allending313
approved these changes
Aug 1, 2024
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:
Moves message definitions to a separate package to prevent import cycles when moving sender definitions to the nfydest.Registry (needs to point to messages, but notification pkg needs to point to nfydest)