feat: enhance notification system and migrate to pubsub/v2 to fix CI#642
Open
nothing0012 wants to merge 6 commits intomainfrom
Open
feat: enhance notification system and migrate to pubsub/v2 to fix CI#642nothing0012 wants to merge 6 commits intomainfrom
nothing0012 wants to merge 6 commits intomainfrom
Conversation
- Included flag description and pre/post change values in notifications - Implemented privacy-first, opt-in JSON diffing (FLAGR_NOTIFICATION_DETAILED_DIFF_ENABLED) - Added automatic pretty-printing for JSON diffs to improve readability - Refactored notification package for better testability (removed public init, added SetNotifier) - Added handler-level integration tests for notifications - Upgraded cloud.google.com/go/pubsub to v2 to resolve deprecation warnings - Fixed various test stability issues (DB transaction ordering, nil notifier panics)
Correctly upgraded to cloud.google.com/go/pubsub/v2@latest while also restoring the modern versions of transitive dependencies (auth, iam, api) that were inadvertently downgraded in the previous commit due to an older pubsub version constraint.
Updated slack.go and email.go to use the defined Operation constants instead of string literals for better consistency and type safety.
Refactored entity.SaveFlagSnapshot to accept notification.Operation instead of a string, improving type safety and consistency across handler calls.
- Replaced deprecated cloud.google.com/go/pubsub with v2 - Updated Topic usage to Publisher in producer and tests - Resolved SA1019 lint warnings for CI compliance
marceloboeira
approved these changes
Dec 26, 2025
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 enhances the Flagr notification system with richer context and stabilizes the CI pipeline through a modern dependency upgrade.
Key Changes:
SaveFlagSnapshotto use the typednotification.Operationenum instead of raw strings.DataRecorderand tests frompubsubv1 tov2, resolvingSA1019deprecation warnings.TopictoPublisherin accordance with thepubsub/v2specification. All publishing logic and test mocks have been verified for parity.FLAGR_NOTIFICATION_DETAILED_DIFF_ENABLED=falseto protect sensitive configuration data.SetNotifierhook to replace hiddeninit()side effects, enabling clean integration testing.CI & Dependency Migration
cloud.google.com/go/pubsubfromv1tov2to resolve deprecation warnings.Topicusage toPublisherin both producer logic and tests.SA1019lint warnings which were blocking the CI pipeline.Motivation and Context
Modernizing core dependencies while significantly improving the auditing capabilities of the notification system.
How Has This Been Tested?
make cipassed with 0 lint issues and 0 test failures.pubsub/v2publishing works correctly with thepstestmock server.Types of changes
Checklist: