Skip to content
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

Feat #23812 - Adjust resource owner recipients #712

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:

$settings = @{
clientId = "${{ parameters.clientId }}"
departmentFilter = "PRD"
departmentFilter = ""
projectTypeFilter = "PRD"
secretIds = @{
clientSecret = "https://$envVaultName.vault.azure.net:443/secrets/AzureAd--ClientSecret"
Expand Down
2 changes: 1 addition & 1 deletion pipelines/templates/deploy-summary-function-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:

$settings = @{
clientId = "${{ parameters.clientId }}"
departmentFilter = "PRD"
departmentFilter = ""
projectTypeFilter = "PRD"
secretIds = @{
clientSecret = Get-SecretsId -secret AzureAd--ClientSecret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class OrgUnits
public string? FullDepartment { get; set; }
public string? SapId { get; set; }
public Management Management { get; set; }
public int Level { get; set; }
}

public class Management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task RunAsync(
// Fetch all departments
var departments = (await lineOrgApiClient.GetOrgUnitDepartmentsAsync())
.DistinctBy(d => d.SapId)
.Where(d => d.FullDepartment != null && d.SapId != null);
.Where(d => d.FullDepartment != null && d.SapId != null)
.Where(d => d.Level >= 4);

if (_departmentFilter.Length != 0)
departments = departments.Where(d => _departmentFilter.Any(df => d.FullDepartment!.Contains(df)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async Task SendResourceOwnersToQueue(ServiceBusSender sender, int totalB
// Query departments from LineOrg
var departments = (await _lineOrgClient.GetOrgUnitDepartmentsAsync())
.Where(d => d.FullDepartment != null) // Exclude departments with blank department name
.Where(d => d.FullDepartment.Contains("PRD"))
.Where(d => d.Level >= 4) // Only include departments of level 4 and up
.Where(x => x.Management?.Persons.Length > 0) // Exclude departments with no receivers
.ToList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0"/>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Fusion.Resources.Functions.Common\Fusion.Resources.Functions.Common.csproj" />
Expand Down
Loading