Skip to content

Commit f2e4e7c

Browse files
authored
Merge branch 'KelvinTegelaar:master' into master
2 parents 31de476 + a41c494 commit f2e4e7c

133 files changed

Lines changed: 1535 additions & 907 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish_release.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,36 @@ jobs:
4848
echo "tag_exists=false" >> $GITHUB_ENV
4949
fi
5050
51+
# Get Previous Tag
52+
- name: Get Previous Tag
53+
id: previous_tag
54+
if: env.tag_exists == 'false'
55+
run: |
56+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
57+
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
58+
echo "Previous tag: $PREV_TAG"
59+
5160
# Generate Release Notes
5261
- name: Generate Release Notes
5362
id: changelog
5463
if: env.tag_exists == 'false'
55-
uses: mikepenz/release-changelog-builder-action@v5.0.0
64+
uses: actions/github-script@v7
65+
with:
66+
script: |
67+
const params = {
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
tag_name: '${{ steps.get_version.outputs.version }}',
71+
target_commitish: context.sha
72+
};
73+
74+
const previousTag = '${{ steps.previous_tag.outputs.previous_tag }}';
75+
if (previousTag) {
76+
params.previous_tag_name = previousTag;
77+
}
78+
79+
const { data } = await github.rest.repos.generateReleaseNotes(params);
80+
core.setOutput('changelog', data.body);
5681
env:
5782
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5883

@@ -75,10 +100,6 @@ jobs:
75100
if: env.tag_exists == 'false'
76101
run: |
77102
mkdir -p src/releases
78-
zip -r src/releases/release_${{ steps.get_version.outputs.version }}.zip . \
79-
--exclude "./src/releases/*" \
80-
--exclude ".*" \
81-
--exclude ".*/**"
82103
zip -r src/releases/latest.zip . \
83104
--exclude "./src/releases/*" \
84105
--exclude ".*" \

Config/ExcludeSkuList.JSON

Lines changed: 28 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,10 @@
33
"GUID": "90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96",
44
"Product_Display_Name": "Business Apps (free)"
55
},
6-
{
7-
"GUID": "90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96",
8-
"Product_Display_Name": "Business Apps (free)"
9-
},
10-
{
11-
"GUID": "f30db892-07e9-47e9-837c-80727f46fd3d",
12-
"Product_Display_Name": "MICROSOFT FLOW FREE"
13-
},
146
{
157
"GUID": "f30db892-07e9-47e9-837c-80727f46fd3d",
168
"Product_Display_Name": "MICROSOFT FLOW FREE"
179
},
18-
{
19-
"GUID": "f30db892-07e9-47e9-837c-80727f46fd3d",
20-
"Product_Display_Name": "MICROSOFT FLOW FREE"
21-
},
22-
{
23-
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
24-
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
25-
},
26-
{
27-
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
28-
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
29-
},
30-
{
31-
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
32-
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
33-
},
34-
{
35-
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
36-
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
37-
},
38-
{
39-
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
40-
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
41-
},
4210
{
4311
"GUID": "16ddbbfc-09ea-4de2-b1d7-312db6112d70",
4412
"Product_Display_Name": "MICROSOFT TEAMS (FREE)"
@@ -47,10 +15,6 @@
4715
"GUID": "a403ebcc-fae0-4ca2-8c8c-7a907fd6c235",
4816
"Product_Display_Name": "Power BI (free)"
4917
},
50-
{
51-
"GUID": "a403ebcc-fae0-4ca2-8c8c-7a907fd6c235",
52-
"Product_Display_Name": "Power BI (free)"
53-
},
5418
{
5519
"GUID": "61e6bd70-fbdb-4deb-82ea-912842f39431",
5620
"Product_Display_Name": "Dynamics 365 Customer Service Insights Trial"
@@ -59,26 +23,6 @@
5923
"GUID": "bc946dac-7877-4271-b2f7-99d2db13cd2c",
6024
"Product_Display_Name": "Dynamics 365 Customer Voice Trial"
6125
},
62-
{
63-
"GUID": "bc946dac-7877-4271-b2f7-99d2db13cd2c",
64-
"Product_Display_Name": "Dynamics 365 Customer Voice Trial"
65-
},
66-
{
67-
"GUID": "bc946dac-7877-4271-b2f7-99d2db13cd2c",
68-
"Product_Display_Name": "Dynamics 365 Customer Voice Trial"
69-
},
70-
{
71-
"GUID": "bc946dac-7877-4271-b2f7-99d2db13cd2c",
72-
"Product_Display_Name": "Dynamics 365 Customer Voice Trial"
73-
},
74-
{
75-
"GUID": "bc946dac-7877-4271-b2f7-99d2db13cd2c",
76-
"Product_Display_Name": "Dynamics 365 Customer Voice Trial"
77-
},
78-
{
79-
"GUID": "338148b6-1b11-4102-afb9-f92b6cdc0f8d",
80-
"Product_Display_Name": "DYNAMICS 365 P1 TRIAL FOR INFORMATION WORKERS"
81-
},
8226
{
8327
"GUID": "338148b6-1b11-4102-afb9-f92b6cdc0f8d",
8428
"Product_Display_Name": "DYNAMICS 365 P1 TRIAL FOR INFORMATION WORKERS"
@@ -87,26 +31,6 @@
8731
"GUID": "fcecd1f9-a91e-488d-a918-a96cdb6ce2b0",
8832
"Product_Display_Name": "Microsoft Dynamics AX7 User Trial"
8933
},
90-
{
91-
"GUID": "fcecd1f9-a91e-488d-a918-a96cdb6ce2b0",
92-
"Product_Display_Name": "Microsoft Dynamics AX7 User Trial"
93-
},
94-
{
95-
"GUID": "dcb1a3ae-b33f-4487-846a-a640262fadf4",
96-
"Product_Display_Name": "Microsoft Power Apps Plan 2 Trial"
97-
},
98-
{
99-
"GUID": "dcb1a3ae-b33f-4487-846a-a640262fadf4",
100-
"Product_Display_Name": "Microsoft Power Apps Plan 2 Trial"
101-
},
102-
{
103-
"GUID": "dcb1a3ae-b33f-4487-846a-a640262fadf4",
104-
"Product_Display_Name": "Microsoft Power Apps Plan 2 Trial"
105-
},
106-
{
107-
"GUID": "dcb1a3ae-b33f-4487-846a-a640262fadf4",
108-
"Product_Display_Name": "Microsoft Power Apps Plan 2 Trial"
109-
},
11034
{
11135
"GUID": "dcb1a3ae-b33f-4487-846a-a640262fadf4",
11236
"Product_Display_Name": "Microsoft Power Apps Plan 2 Trial"
@@ -116,71 +40,59 @@
11640
"Product_Display_Name": "Microsoft Teams Trial"
11741
},
11842
{
119-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
120-
"Product_Display_Name": "Microsoft Teams Trial"
121-
},
122-
{
123-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
124-
"Product_Display_Name": "Microsoft Teams Trial"
125-
},
126-
{
127-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
128-
"Product_Display_Name": "Microsoft Teams Trial"
129-
},
130-
{
131-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
132-
"Product_Display_Name": "Microsoft Teams Trial"
43+
"GUID": "606b54a9-78d8-4298-ad8b-df6ef4481c80",
44+
"Product_Display_Name": "Power Virtual Agents Viral Trial"
13345
},
13446
{
135-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
136-
"Product_Display_Name": "Microsoft Teams Trial"
47+
"GUID": "1f2f344a-700d-42c9-9427-5cea1d5d7ba6",
48+
"Product_Display_Name": "MICROSOFT STREAM"
13749
},
13850
{
139-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
140-
"Product_Display_Name": "Microsoft Teams Trial"
51+
"GUID": "6470687e-a428-4b7a-bef2-8a291ad947c9",
52+
"Product_Display_Name": "WINDOWS STORE FOR BUSINESS"
14153
},
14254
{
143-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
144-
"Product_Display_Name": "Microsoft Teams Trial"
55+
"GUID": "710779e8-3d4a-4c88-adb9-386c958d1fdf",
56+
"Product_Display_Name": "MICROSOFT TEAMS EXPLORATORY"
14557
},
14658
{
147-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
148-
"Product_Display_Name": "Microsoft Teams Trial"
59+
"GUID": "8c4ce438-32a7-4ac5-91a6-e22ae08d9c8b",
60+
"Product_Display_Name": "Rights Management Adhoc"
14961
},
15062
{
151-
"GUID": "74fbf1bb-47c6-4796-9623-77dc7371723b",
152-
"Product_Display_Name": "Microsoft Teams Trial"
63+
"GUID": "5b631642-bd26-49fe-bd20-1daaa972ef80",
64+
"Product_Display_Name": "Microsoft Power Apps for Developer"
15365
},
15466
{
155-
"GUID": "606b54a9-78d8-4298-ad8b-df6ef4481c80",
156-
"Product_Display_Name": "Power Virtual Agents Viral Trial"
67+
"GUID": "6a4a1628-9b9a-424d-bed5-4118f0ede3fd",
68+
"Product_Display_Name": "Dynamics 365 Business Central for IWs"
15769
},
15870
{
159-
"GUID": "606b54a9-78d8-4298-ad8b-df6ef4481c80",
160-
"Product_Display_Name": "Power Virtual Agents Viral Trial"
71+
"GUID": "6ec92958-3cc1-49db-95bd-bc6b3798df71",
72+
"Product_Display_Name": "Dynamics 365 Sales Premium Viral Trial"
16173
},
16274
{
163-
"GUID": "606b54a9-78d8-4298-ad8b-df6ef4481c80",
164-
"Product_Display_Name": "Power Virtual Agents Viral Trial"
75+
"GUID": "3f9f06f5-3c31-472c-985f-62d9c10ec167",
76+
"Product_Display_Name": "Power Pages vTrial for Makers"
16577
},
16678
{
167-
"GUID": "1f2f344a-700d-42c9-9427-5cea1d5d7ba6",
168-
"Product_Display_Name": "MICROSOFT STREAM"
79+
"GUID": "9c7bff7a-3715-4da7-88d3-07f57f8d0fb6",
80+
"Product_Display_Name": "Dynamics 365 For Sales Professional Trial"
16981
},
17082
{
171-
"GUID": "1f2f344a-700d-42c9-9427-5cea1d5d7ba6",
172-
"Product_Display_Name": "MICROSOFT STREAM"
83+
"GUID": "8f0c5670-4e56-4892-b06d-91c085d7004f",
84+
"Product_Display_Name": "App Connect IW"
17385
},
17486
{
175-
"GUID": "6470687e-a428-4b7a-bef2-8a291ad947c9",
176-
"Product_Display_Name": "WINDOWS STORE FOR BUSINESS"
87+
"GUID": "87bbbc60-4754-4998-8c88-227dca264858",
88+
"Product_Display_Name": "Power Apps and Logic Flows"
17789
},
17890
{
179-
"GUID": "6470687e-a428-4b7a-bef2-8a291ad947c9",
180-
"Product_Display_Name": "WINDOWS STORE FOR BUSINESS"
91+
"GUID": "e5788282-6381-469f-84f0-3d7d4021d34d",
92+
"Product_Display_Name": "Office 365 Extra File Storage for GCC"
18193
},
18294
{
183-
"GUID": "710779e8-3d4a-4c88-adb9-386c958d1fdf",
184-
"Product_Display_Name": "MICROSOFT TEAMS EXPLORATORY"
95+
"GUID": "99049c9c-6011-4908-bf17-15f496e6519d",
96+
"Product_Display_Name": "Office 365 Extra File Storage"
18597
}
18698
]

Modules/CIPPCore/Public/Add-CIPPDbItem.ps1

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,55 @@ function Add-CIPPDbItem {
6969
if ($ExistingEntities) {
7070
Remove-AzDataTableEntity @Table -Entity $ExistingEntities -Force | Out-Null
7171
}
72-
$Entities = foreach ($Item in $Data) {
73-
$ItemId = $Item.id ?? $Item.ExternalDirectoryObjectId ?? $Item.Identity ?? $Item.skuId
74-
@{
75-
PartitionKey = $TenantFilter
76-
RowKey = Format-RowKey "$Type-$ItemId"
77-
Data = [string]($Item | ConvertTo-Json -Depth 10 -Compress)
78-
Type = $Type
72+
73+
# Calculate batch size based on available memory
74+
$AvailableMemory = [System.GC]::GetTotalMemory($false)
75+
$AvailableMemoryMB = [math]::Round($AvailableMemory / 1MB, 2)
76+
77+
# Estimate item size from first item (with fallback)
78+
$EstimatedItemSizeBytes = 1KB # Default assumption
79+
if ($Data.Count -gt 0) {
80+
$SampleJson = $Data[0] | ConvertTo-Json -Depth 10 -Compress
81+
$EstimatedItemSizeBytes = [System.Text.Encoding]::UTF8.GetByteCount($SampleJson)
82+
}
83+
84+
# Use 25% of available memory for batch processing, with min/max bounds
85+
$TargetBatchMemoryMB = [Math]::Max(50, $AvailableMemoryMB * 0.25)
86+
$CalculatedBatchSize = [Math]::Floor(($TargetBatchMemoryMB * 1MB) / $EstimatedItemSizeBytes)
87+
# Reduce max to 500 to prevent OOM with large datasets
88+
$BatchSize = [Math]::Max(100, [Math]::Min(500, $CalculatedBatchSize))
89+
90+
$TotalCount = $Data.Count
91+
$ProcessedCount = 0
92+
Write-Information "Adding $TotalCount items of type $Type to CIPP Reporting DB for tenant $TenantFilter | Available Memory: ${AvailableMemoryMB}MB | Target Memory: ${TargetBatchMemoryMB}MB | Calculated: $CalculatedBatchSize | Batch Size: $BatchSize (est. item size: $([math]::Round($EstimatedItemSizeBytes/1KB, 2))KB)"
93+
for ($i = 0; $i -lt $TotalCount; $i += $BatchSize) {
94+
$BatchEnd = [Math]::Min($i + $BatchSize, $TotalCount)
95+
$Batch = $Data[$i..($BatchEnd - 1)]
96+
97+
$Entities = foreach ($Item in $Batch) {
98+
$ItemId = $Item.id ?? $Item.ExternalDirectoryObjectId ?? $Item.Identity ?? $Item.skuId
99+
@{
100+
PartitionKey = $TenantFilter
101+
RowKey = Format-RowKey "$Type-$ItemId"
102+
Data = [string]($Item | ConvertTo-Json -Depth 10 -Compress)
103+
Type = $Type
104+
}
79105
}
106+
107+
Add-CIPPAzDataTableEntity @Table -Entity $Entities -Force | Out-Null
108+
$ProcessedCount += $Batch.Count
109+
110+
# Clear batch variables to free memory
111+
$Entities = $null
112+
$Batch = $null
113+
[System.GC]::Collect()
80114
}
81-
Add-CIPPAzDataTableEntity @Table -Entity $Entities -Force | Out-Null
82115

83116
}
84-
85-
Write-LogMessage -API 'CIPPDbItem' -tenant $TenantFilter -message "Added $($Data.Count) items of type $Type$(if ($Count) { ' (count mode)' })" -sev Info
117+
Write-LogMessage -API 'CIPPDbItem' -tenant $TenantFilter -message "Added $($Data.Count) items of type $Type$(if ($Count) { ' (count mode)' })" -sev Debug
86118

87119
} catch {
88-
Write-LogMessage -API 'CIPPDbItem' -tenant $TenantFilter -message "Failed to add items of type $Type : $($_.Exception.Message)" -sev Error
120+
Write-LogMessage -API 'CIPPDbItem' -tenant $TenantFilter -message "Failed to add items of type $Type : $($_.Exception.Message)" -sev Error -LogData (Get-CippException -Exception $_)
89121
throw
90122
}
91123
}

Modules/CIPPCore/Public/Add-CippTestResult.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function Add-CippTestResult {
4848
[string]$TestId,
4949

5050
[Parameter(Mandatory = $false)]
51-
[string]$testType = 'Identity',
51+
[string]$TestType = 'Identity',
5252

5353
[Parameter(Mandatory = $true)]
5454
[string]$Status,

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMXRecordChanged.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ function Get-CIPPAlertMXRecordChanged {
2424
"$($Domain.Domain): MX records changed from [$($PreviousRecords -join ', ')] to [$($CurrentRecords -join ', ')]"
2525
}
2626
}
27-
28-
if ($ChangedDomains) {
29-
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $ChangedDomains
30-
}
31-
3227
# Update cache with current data
3328
foreach ($Domain in $DomainData) {
3429
$CurrentRecords = $Domain.ActualMXRecords.Hostname | Sort-Object
@@ -42,6 +37,12 @@ function Get-CIPPAlertMXRecordChanged {
4237
}
4338
Add-CIPPAzDataTableEntity @CacheTable -Entity $CacheEntity -Force
4439
}
40+
41+
if ($ChangedDomains) {
42+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $ChangedDomains
43+
}
44+
return $true
45+
4546
} catch {
4647
Write-LogMessage -message "Failed to check MX record changes: $($_.Exception.Message)" -API 'MX Record Alert' -tenant $TenantFilter -sev Error
4748
}

0 commit comments

Comments
 (0)