@@ -795,7 +795,7 @@ func testNewMDMAndroidConfigProfile(t *testing.T, ds *Datastore) {
795795 }
796796
797797 // Create the profile
798- result , err := ds .NewMDMAndroidConfigProfile (ctx , profile )
798+ result , err := ds .NewMDMAndroidConfigProfile (ctx , profile , nil )
799799 require .NoError (t , err )
800800 assert .NotEmpty (t , result .ProfileUUID )
801801
@@ -805,7 +805,7 @@ func testNewMDMAndroidConfigProfile(t *testing.T, ds *Datastore) {
805805 TeamID : nil ,
806806 RawJSON : []byte (`{"hello2": "world2"}` ),
807807 }
808- result2 , err := ds .NewMDMAndroidConfigProfile (ctx , profile2 )
808+ result2 , err := ds .NewMDMAndroidConfigProfile (ctx , profile2 , nil )
809809 require .NoError (t , err )
810810 assert .NotEmpty (t , result2 .ProfileUUID )
811811
@@ -837,15 +837,15 @@ func testNewMDMAndroidConfigProfile(t *testing.T, ds *Datastore) {
837837 TeamID : nil ,
838838 RawJSON : []byte (`{"hello3": "world3"}` ),
839839 }
840- _ , err = ds .NewMDMAndroidConfigProfile (ctx , androidProfile )
840+ _ , err = ds .NewMDMAndroidConfigProfile (ctx , androidProfile , nil )
841841 require .ErrorContains (t , err , "already exists" )
842842
843843 // Create that same conflicting android profile but on a different team
844844 team , err := ds .NewTeam (ctx , & fleet.Team {Name : "test team" })
845845 require .NoError (t , err )
846846 require .NotNil (t , team )
847847 androidProfile .TeamID = ptr .Uint (team .ID )
848- otherTeamProfile , err := ds .NewMDMAndroidConfigProfile (ctx , androidProfile )
848+ otherTeamProfile , err := ds .NewMDMAndroidConfigProfile (ctx , androidProfile , nil )
849849 require .NoError (t , err )
850850
851851 // Verify we can GET the newly created profile
@@ -878,7 +878,7 @@ func testDeleteMDMAndroidConfigProfile(t *testing.T, ds *Datastore) {
878878 RawJSON : []byte (`{"hello": "world"}` ),
879879 }
880880
881- profile1 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile1 )
881+ profile1 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile1 , nil )
882882 require .NoError (t , err )
883883 require .NotNil (t , profile1 )
884884
@@ -887,7 +887,7 @@ func testDeleteMDMAndroidConfigProfile(t *testing.T, ds *Datastore) {
887887 TeamID : nil ,
888888 RawJSON : []byte (`{"hello": "world"}` ),
889889 }
890- profile2 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile2 )
890+ profile2 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile2 , nil )
891891 require .NoError (t , err )
892892 require .NotNil (t , profile2 )
893893
@@ -1157,17 +1157,17 @@ func testGetHostMDMAndroidProfiles(t *testing.T, ds *Datastore) {
11571157
11581158 // Create some profiles
11591159 profile1 := androidProfileForTest ("profile1" )
1160- profile1 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile1 )
1160+ profile1 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile1 , nil )
11611161 require .NoError (t , err )
11621162 require .NotNil (t , profile1 )
11631163
11641164 profile2 := androidProfileForTest ("profile2" )
1165- profile2 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile2 )
1165+ profile2 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile2 , nil )
11661166 require .NoError (t , err )
11671167 require .NotNil (t , profile2 )
11681168
11691169 profile3 := androidProfileForTest ("profile3" )
1170- profile3 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile3 )
1170+ profile3 , err = ds .NewMDMAndroidConfigProfile (ctx , * profile3 , nil )
11711171 require .NoError (t , err )
11721172 require .NotNil (t , profile3 )
11731173
@@ -1360,13 +1360,13 @@ func testListMDMAndroidProfilesToSend(t *testing.T, ds *Datastore) {
13601360 tm , err := ds .NewTeam (ctx , & fleet.Team {Name : "team" })
13611361 require .NoError (t , err )
13621362
1363- p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-1" ))
1363+ p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-1" ), nil )
13641364 require .NoError (t , err )
1365- p2 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-2" ))
1365+ p2 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-2" ), nil )
13661366 require .NoError (t , err )
13671367 tmP3 := androidProfileForTest ("team-1" )
13681368 tmP3 .TeamID = & tm .ID
1369- p3 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP3 )
1369+ p3 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP3 , nil )
13701370 require .NoError (t , err )
13711371
13721372 // all profiles use the same raw JSON, so they share the same checksum
@@ -1404,7 +1404,7 @@ func testListMDMAndroidProfilesToSend(t *testing.T, ds *Datastore) {
14041404 require .NoError (t , err )
14051405 lblIncAll2 , err := ds .NewLabel (ctx , & fleet.Label {Name : "inclall-2" , Query : "select 1" })
14061406 require .NoError (t , err )
1407- p4 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-4" , lblIncAll1 , lblIncAll2 ))
1407+ p4 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-4" , lblIncAll1 , lblIncAll2 ), nil )
14081408 require .NoError (t , err )
14091409
14101410 // no change, host is not a member of both labels
@@ -1454,7 +1454,7 @@ func testListMDMAndroidProfilesToSend(t *testing.T, ds *Datastore) {
14541454 require .NoError (t , err )
14551455 lblIncAny2 , err := ds .NewLabel (ctx , & fleet.Label {Name : "inclany-2" , Query : "select 1" })
14561456 require .NoError (t , err )
1457- p5 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-5" , lblIncAny1 , lblIncAny2 ))
1457+ p5 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-5" , lblIncAny1 , lblIncAny2 ), nil )
14581458 require .NoError (t , err )
14591459
14601460 // no change, host 0 not a member yet
@@ -1491,7 +1491,7 @@ func testListMDMAndroidProfilesToSend(t *testing.T, ds *Datastore) {
14911491 require .NoError (t , err )
14921492 lblExclAny2 , err := ds .NewLabel (ctx , & fleet.Label {Name : "exclude-2" , LabelMembershipType : fleet .LabelMembershipTypeManual })
14931493 require .NoError (t , err )
1494- p6 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-6" , lblExclAny1 , lblExclAny2 ))
1494+ p6 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-6" , lblExclAny1 , lblExclAny2 ), nil )
14951495 require .NoError (t , err )
14961496
14971497 // no change, label membership was not updated after labels created
@@ -1673,13 +1673,13 @@ func testListMDMAndroidProfilesToSendWithExcludeAny(t *testing.T, ds *Datastore)
16731673 require .NoError (t , err )
16741674
16751675 // Dynamic exclude-any label
1676- p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-1" , lblExclAny1 ))
1676+ p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-1" , lblExclAny1 ), nil )
16771677 require .NoError (t , err )
16781678 // Manual exclude-any label only
1679- p2 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-2" , lblExclAny2 ))
1679+ p2 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-2" , lblExclAny2 ), nil )
16801680 require .NoError (t , err )
16811681 // Both manual and dynamic label exclusion
1682- p3 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-3" , lblExclAny1 , lblExclAny2 ))
1682+ p3 , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("no-team-3" , lblExclAny1 , lblExclAny2 ), nil )
16831683 require .NoError (t , err )
16841684
16851685 // all profiles use the same raw JSON, so they share the same checksum
@@ -1719,15 +1719,15 @@ func testListMDMAndroidProfilesToSendWithExcludeAny(t *testing.T, ds *Datastore)
17191719 tmP6 .TeamID = & tm .ID
17201720
17211721 // Dynamic exclude-any label
1722- p4 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP4 )
1722+ p4 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP4 , nil )
17231723 require .NoError (t , err )
17241724
17251725 // Manual exclude-any label only
1726- p5 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP5 )
1726+ p5 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP5 , nil )
17271727 require .NoError (t , err )
17281728
17291729 // Both manual and dynamic label exclusion
1730- p6 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP6 )
1730+ p6 , err := ds .NewMDMAndroidConfigProfile (ctx , * tmP6 , nil )
17311731 require .NoError (t , err )
17321732
17331733 // p5 becomes immediately applicable to host 1 because it only has a manual label
@@ -1812,7 +1812,7 @@ func testListMDMAndroidProfilesToSendCursor(t *testing.T, ds *Datastore) {
18121812 })
18131813
18141814 // Add a profile so all 5 hosts have pending work.
1815- _ , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("cursor-test-profile" ))
1815+ _ , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("cursor-test-profile" ), nil )
18161816 require .NoError (t , err )
18171817
18181818 // No cursor, no limit — returns all 5 hosts.
@@ -1901,10 +1901,10 @@ func testListMDMAndroidProfilesToSendWithCombinedLabels(t *testing.T, ds *Datast
19011901 require .NoError (t , err )
19021902
19031903 // include-all + exclude-any profile (requires both incl-all-1 and incl-all-2)
1904- pCombinedAll , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("combined-incl-all" , inclAllLbl , inclAllLbl2 , exclLbl ))
1904+ pCombinedAll , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("combined-incl-all" , inclAllLbl , inclAllLbl2 , exclLbl ), nil )
19051905 require .NoError (t , err )
19061906 // include-any + exclude-any profile
1907- pCombinedAny , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("combined-incl-any" , inclAnyLbl , exclLbl ))
1907+ pCombinedAny , err := ds .NewMDMAndroidConfigProfile (ctx , * androidProfileForTest ("combined-incl-any" , inclAnyLbl , exclLbl ), nil )
19081908 require .NoError (t , err )
19091909
19101910 profChecksum := getAndroidProfileChecksum (t , ds , pCombinedAll .ProfileUUID )
@@ -1970,11 +1970,11 @@ func testGetMDMAndroidProfilesContents(t *testing.T, ds *Datastore) {
19701970 p3 := androidProfileForTest ("p3" )
19711971 p3 .RawJSON = []byte (`{"v": 3}` )
19721972
1973- p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * p1 )
1973+ p1 , err := ds .NewMDMAndroidConfigProfile (ctx , * p1 , nil )
19741974 require .NoError (t , err )
1975- p2 , err = ds .NewMDMAndroidConfigProfile (ctx , * p2 )
1975+ p2 , err = ds .NewMDMAndroidConfigProfile (ctx , * p2 , nil )
19761976 require .NoError (t , err )
1977- p3 , err = ds .NewMDMAndroidConfigProfile (ctx , * p3 )
1977+ p3 , err = ds .NewMDMAndroidConfigProfile (ctx , * p3 , nil )
19781978 require .NoError (t , err )
19791979
19801980 cases := []struct {
@@ -2049,7 +2049,7 @@ func testBulkUpsertMDMAndroidHostProfilesN(t *testing.T, ds *Datastore, batchSiz
20492049 // last profile is for a team
20502050 p .TeamID = & tm .ID
20512051 }
2052- p , err := ds .NewMDMAndroidConfigProfile (ctx , * p )
2052+ p , err := ds .NewMDMAndroidConfigProfile (ctx , * p , nil )
20532053 require .NoError (t , err )
20542054 profiles [i ] = p
20552055 }
@@ -2428,7 +2428,7 @@ func testListHostMDMAndroidProfilesPendingInstallWithVersion(t *testing.T, ds *D
24282428 profiles := make ([]* fleet.MDMAndroidConfigProfile , 3 )
24292429 for i := range profiles {
24302430 p := androidProfileForTest (fmt .Sprintf ("profile-%d" , i ))
2431- p , err := ds .NewMDMAndroidConfigProfile (ctx , * p )
2431+ p , err := ds .NewMDMAndroidConfigProfile (ctx , * p , nil )
24322432 require .NoError (t , err )
24332433 profiles [i ] = p
24342434 }
@@ -2589,7 +2589,7 @@ func testBulkDeleteMDMAndroidHostProfiles(t *testing.T, ds *Datastore) {
25892589 profiles := make ([]* fleet.MDMAndroidConfigProfile , 3 )
25902590 for i := range profiles {
25912591 p := androidProfileForTest (fmt .Sprintf ("profile-%d" , i ))
2592- p , err := ds .NewMDMAndroidConfigProfile (ctx , * p )
2592+ p , err := ds .NewMDMAndroidConfigProfile (ctx , * p , nil )
25932593 require .NoError (t , err )
25942594 profiles [i ] = p
25952595 }
0 commit comments