feat: Introduce ContactGroupEnrollmentPolicy and controller to automate contact group memberships.#603
Merged
JoseSzycho merged 5 commits intoMay 20, 2026
Conversation
This comment has been minimized.
This comment has been minimized.
…te contact group memberships.
… rejections for membership collisions and opt-outs
…ontacts and refine opt-out scenarios
f24676e to
b249d2a
Compare
…oup enrollment policies
scotwells
approved these changes
May 20, 2026
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.
Pull Request: Implement ContactGroupEnrollmentPolicy and Controller
Title
feat(notification): implement ContactGroupEnrollmentPolicy and controller for automated memberships
Description
This PR introduces the
ContactGroupEnrollmentPolicyAPI and its corresponding controller to automate the enrollment of newly created contacts into designated contact groups. It also includes comprehensive E2E integration tests, API registration, and auto-generated manifests.Key Changes
1. API Definition (
ContactGroupEnrollmentPolicy)ContactGroupEnrollmentPolicy(notification.miloapis.com/v1alpha1).contactGroupRef: Specifies the target group (nameandnamespace) for enrollment.trigger: Defines when enrollment happens (e.g.type: ContactCreated).contactSelector(optional): Enables filtering bySubjectKind(e.g.User).2. Reconciler (
ContactGroupEnrollmentController)ContactandContactGroupEnrollmentPolicyresources.ContactGroupMembershiprecords for matching policies when a contact is created.ContactGroupMembershipRemovalrecords and skips enrollment for opted-out contacts.enrollment.notification.miloapis.com/{policyName} = trueto avoid duplicate reconciliations.ContactGroupMembershipRemovalbyspec.contactRef.namefor fast lookup.3. Controller Manager Integration
cmd/milo/controller-manager/controllermanager.go.contacts,contactgroupenrollmentpolicies,contactgroupmemberships, andcontactgroupmembershipremovals.4. End-to-End Tests
chainsawintegration tests undertest/notification/contact-group-enrollment/covering:Verification Results
All E2E tests have passed successfully: