Skip to content

Commit eed9faf

Browse files
Merge branch 'dev' into feature/admin-ui-playwright-e2e
2 parents aedf510 + 82f073a commit eed9faf

150 files changed

Lines changed: 31086 additions & 2991 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/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
HEALTH_CHECK_TIMEOUT: 60
6565
CHECK_INTERVAL: 10
6666
ADHOC_REPORT_TEST_DOWNLOAD_PATH: ./Tests/BackendE2ETests/TestResults/
67+
LOCAL_APIHEALTH_ENABLE_ADMINBFF_AUTH_SUITE: false
6768

6869
steps:
6970
- name: Checkout code

Azure_Pipelines/_deploy_all_services.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ parameters:
1515
- dev-scale
1616
- scale-test
1717
- scale-qa
18+
- scale-qa2
1819

1920
variables:
2021
- group: link-cloud-variables
@@ -33,6 +34,8 @@ variables:
3334
value: 'test'
3435
${{ if eq(parameters.environment, 'scale-qa') }}:
3536
value: 'qa'
37+
${{ if eq(parameters.environment, 'scale-qa2') }}:
38+
value: 'qa2'
3639

3740
jobs:
3841

Azure_Pipelines/azure-pipelines.ec.cd.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.

Azure_Pipelines/kafka-topics-sync.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ parameters:
1616
- DEV
1717
- TEST
1818
- QA
19+
- QA2
1920

2021
variables:
2122
- group: kafka_topics # variable group `kafka_topics`
@@ -35,6 +36,8 @@ variables:
3536
value: '$(test-rest-url)'
3637
${{ if eq(parameters.environment, 'QA') }}:
3738
value: '$(qa-rest-url)'
39+
${{ if eq(parameters.environment, 'QA2') }}:
40+
value: '$(qa2-rest-url)'
3841

3942
stages:
4043
- stage: Sync_Kafka_Topics_${{ parameters.environment }}

DotNet/Automation.Link/Configuration/AutomationConfig.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ public class AutomationConfig
3737
/// </summary>
3838
public string FacilityFhirServerBase { get; set; } = "http://fhir-server:8080/fhir";
3939

40-
public string LokiBaseUrl { get; set; } = "http://localhost:3100";
41-
public string LokiAppLabel { get; set; } = "link-cloud";
42-
public string GrafanaBaseUrl { get; set; } = "http://localhost:3000";
40+
public string LokiBaseUrl { get; set; } = string.Empty;
41+
public string LokiAppLabel { get; set; } = string.Empty;
4342
public string? DownloadPath { get; set; }
4443

4544
public OAuthConfig FhirServerOAuth { get; set; } = new();
@@ -53,8 +52,6 @@ public class AutomationConfig
5352
/// </summary>
5453
public FhirGenerationSettings FhirGeneration { get; set; } = new();
5554

56-
public DatabaseConfig Database { get; set; } = new();
57-
5855
public KafkaConfig Kafka { get; set; } = new();
5956

6057
public class FhirQuerySettings
@@ -91,18 +88,8 @@ public class FhirGenerationSettings
9188
};
9289
}
9390

94-
public class DatabaseConfig
95-
{
96-
public string Server { get; set; } = string.Empty;
97-
public string UserId { get; set; } = string.Empty;
98-
public string Password { get; set; } = string.Empty;
99-
}
100-
10191
public class KafkaConfig
10292
{
103-
public string BootstrapServers { get; set; } = string.Empty;
10493
public string RestProxyBaseUrl { get; set; } = string.Empty;
105-
public string User { get; set; } = string.Empty;
106-
public string Password { get; set; } = string.Empty;
10794
}
10895
}

DotNet/Automation.Link/Helpers/BackgroundDiagnosticsMonitor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Threading.Channels;
22
using LantanaGroup.Link.Automation.Link.Configuration;
33
using LantanaGroup.Link.Automation.Link.Validation;
4+
using LantanaGroup.Link.Shared.Application.Models.Configs;
45

56
namespace LantanaGroup.Link.Automation.Link.Helpers;
67

@@ -76,6 +77,7 @@ public BackgroundDiagnosticsMonitor(
7677
IAutomationOutput output,
7778
LokiScraper lokiScraper,
7879
AutomationConfig config,
80+
KafkaConnection kafkaConnection,
7981
int expectedPatientCount = 0,
8082
TimeSpan? pollInterval = null,
8183
bool forwardInternalLogsToOutput = true,
@@ -97,7 +99,10 @@ public BackgroundDiagnosticsMonitor(
9799

98100
var reader = pipelineReader ?? BuildPipelineReader(config);
99101

100-
_kafkaMonitor = new KafkaErrorMonitor(eventingOutput, config);
102+
_kafkaMonitor = new KafkaErrorMonitor(
103+
eventingOutput,
104+
config,
105+
kafkaConnection);
101106
var progressMonitor = new ProgressMonitor(eventingOutput, expectedPatientCount, lokiScraper, reader, expectsDataAcquisition);
102107
_milestoneOrchestrator = new MilestoneValidationOrchestrator(eventingOutput, reader, expectedPatientCount, expectsDataAcquisition);
103108
_pollInterval = pollInterval ?? TimeSpan.FromSeconds(5);

DotNet/Automation.Link/Helpers/DatabaseConnectionFactory.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

DotNet/Automation.Link/Helpers/KafkaErrorMonitor.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Text;
33
using Confluent.Kafka;
44
using LantanaGroup.Link.Automation.Link.Configuration;
5+
using LantanaGroup.Link.Shared.Application.Models.Configs;
56
using Newtonsoft.Json.Linq;
67
using RestSharp;
78

@@ -19,8 +20,7 @@ public class KafkaErrorMonitor : IAsyncDisposable
1920
{
2021
private readonly string _kafkaBootstrapServers;
2122
private readonly string _kafkaRestProxyBase;
22-
private readonly string _kafkaUser;
23-
private readonly string _kafkaPassword;
23+
private readonly KafkaConnection _kafkaConnection;
2424

2525
private readonly IAutomationOutput _output;
2626
private IConsumer<string, string>? _consumer;
@@ -76,13 +76,12 @@ private sealed record CapturedKafkaError(string? Key, string Message);
7676
private const int ResourceNormalizedValuePreviewLength = 4000;
7777
private const int ResourceNormalizedHeaderPreviewLength = 2000;
7878

79-
public KafkaErrorMonitor(IAutomationOutput output, AutomationConfig config)
79+
public KafkaErrorMonitor(IAutomationOutput output, AutomationConfig config, KafkaConnection kafkaConnection)
8080
{
8181
_output = output;
82-
_kafkaBootstrapServers = config.Kafka.BootstrapServers;
82+
_kafkaConnection = kafkaConnection;
83+
_kafkaBootstrapServers = string.Join(", ", kafkaConnection.BootstrapServers);
8384
_kafkaRestProxyBase = config.Kafka.RestProxyBaseUrl;
84-
_kafkaUser = config.Kafka.User;
85-
_kafkaPassword = config.Kafka.Password;
8685
}
8786

8887
/// <summary>
@@ -136,17 +135,12 @@ public async Task InitializeAsync()
136135
SocketTimeoutMs = 5000,
137136
};
138137

139-
// Only enable SASL when credentials are actually configured. The Link services
140-
// gate SASL behind KafkaConnection.SaslProtocolEnabled (default false) and the
141-
// local/dev/docker brokers use PLAINTEXT. Forcing SaslPlaintext/Plain here with
142-
// empty credentials makes librdkafka throw "sasl.username and sasl.password must
143-
// be set", which silently disabled dead-letter monitoring for the whole run.
144-
if (!string.IsNullOrWhiteSpace(_kafkaUser) && !string.IsNullOrWhiteSpace(_kafkaPassword))
138+
if (_kafkaConnection.SaslProtocolEnabled)
145139
{
146-
config.SecurityProtocol = SecurityProtocol.SaslPlaintext;
147-
config.SaslMechanism = SaslMechanism.Plain;
148-
config.SaslUsername = _kafkaUser;
149-
config.SaslPassword = _kafkaPassword;
140+
config.SecurityProtocol = _kafkaConnection.Protocol;
141+
config.SaslMechanism = _kafkaConnection.Mechanism;
142+
config.SaslUsername = _kafkaConnection.SaslUsername;
143+
config.SaslPassword = _kafkaConnection.SaslPassword;
150144
}
151145

152146
_consumer = new ConsumerBuilder<string, string>(config)

DotNet/Automation.Link/Helpers/LokiScraper.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,16 @@ public LokiScraper(HttpClient lokiClient, IAutomationOutput output, AutomationCo
1515
{
1616
if (lokiClient.BaseAddress == null)
1717
{
18-
var configuredBaseUrl = string.IsNullOrWhiteSpace(config.LokiBaseUrl)
19-
? "http://localhost:3100"
20-
: config.LokiBaseUrl;
18+
if (!Uri.TryCreate(config.LokiBaseUrl, UriKind.Absolute, out var lokiBaseUri))
19+
throw new InvalidOperationException("LokiBaseUrl must be an absolute URI.");
2120

22-
if (Uri.TryCreate(configuredBaseUrl, UriKind.Absolute, out var lokiBaseUri))
23-
lokiClient.BaseAddress = lokiBaseUri;
21+
lokiClient.BaseAddress = lokiBaseUri;
2422
}
2523

2624
_output = output;
2725
_lokiClient = lokiClient;
2826
_lokiAppLabel = string.IsNullOrWhiteSpace(config.LokiAppLabel)
29-
? "link-cloud"
27+
? throw new InvalidOperationException("LokiAppLabel is required.")
3028
: config.LokiAppLabel.Trim();
3129
}
3230

DotNet/Automation.Link/Helpers/PipelineSummarySnapshotBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public async Task<PipelineSummarySnapshot> BuildAsync(
201201
? null
202202
: new ReportScheduleSnapshot
203203
{
204-
ReportName = schedule.FacilityId,
204+
ReportName = reportId,
205205
StartDate = schedule.ReportStartDate?.ToString("u"),
206206
EndDate = schedule.ReportEndDate?.ToString("u"),
207207
AdHocType = schedule.AdHocType,

0 commit comments

Comments
 (0)