Skip to content

Commit bcf6ecf

Browse files
authored
Merge branch 'main' into philliphoff-orchestration-tracing
2 parents ae9a2fd + 1d3dac5 commit bcf6ecf

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

src/Analyzers/AnalyzerReleases.Shipped.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77

88
Rule ID | Category | Severity | Notes
99
--------|----------|----------|-------
10-
DURABLE0001 | Orchestration | Warning | DateTimeOrchestrationAnalyzer
11-
DURABLE0002 | Orchestration | Warning | GuidOrchestrationAnalyzer
12-
DURABLE0003 | Orchestration | Warning | DelayOrchestrationAnalyzer
13-
DURABLE0004 | Orchestration | Warning | ThreadTaskOrchestrationAnalyzer
14-
DURABLE0005 | Orchestration | Warning | IOOrchestrationAnalyzer
15-
DURABLE0006 | Orchestration | Warning | EnvironmentOrchestrationAnalyzer
16-
DURABLE0007 | Orchestration | Warning | CancellationTokenOrchestrationAnalyzer
17-
DURABLE0008 | Orchestration | Warning | OtherBindingsOrchestrationAnalyzer
18-
DURABLE1001 | Attribute Binding | Error | OrchestrationTriggerBindingAnalyzer
19-
DURABLE1002 | Attribute Binding | Error | DurableClientBindingAnalyzer
20-
DURABLE1003 | Attribute Binding | Error | EntityTriggerBindingAnalyzer
21-
DURABLE2001 | Activity | Warning | MatchingInputOutputTypeActivityAnalyzer
22-
DURABLE2002 | Activity | Warning | MatchingInputOutputTypeActivityAnalyzer
10+
DURABLE0001 | Orchestration | Warning | **DateTimeOrchestrationAnalyzer**: Warns when non-deterministic DateTime properties like DateTime.Now, DateTime.UtcNow, or DateTime.Today are used in orchestration methods. Use context.CurrentUtcDateTime instead to ensure deterministic replay and to follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp).
11+
DURABLE0002 | Orchestration | Warning | **GuidOrchestrationAnalyzer**: Warns when Guid.NewGuid() is used in an orchestration method. This can break determinism. Please use context.NewGuid() for orchestration-safe GUID generation to follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp).
12+
DURABLE0003 | Orchestration | Warning | **DelayOrchestrationAnalyzer**: Warns when Task.Delay or Thread.Sleep are used in orchestrations. These APIs are non-deterministic. Please use context.CreateTimer for delays instead to follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp).
13+
DURABLE0004 | Orchestration | Warning | **ThreadTaskOrchestrationAnalyzer**: Warns on usage of non-deterministic thread and task APIs like Thread.Start, Task.Run, Task.ContinueWith, TaskFactory.StartNew in orchestrations. Orchestrations must not use parallelism APIs as these break replay and don't follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp).
14+
DURABLE0005 | Orchestration | Warning | **IOOrchestrationAnalyzer**: Warns when I/O APIs (e.g., HttpClient, Azure Storage clients) are used directly in orchestrations. I/O calls are not replay-safe and should be invoked via activities to follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp)
15+
DURABLE0006 | Orchestration | Warning | **EnvironmentOrchestrationAnalyzer**: Warns on usage of System.Environment APIs (e.g., GetEnvironmentVariable) in orchestrations. Reading environment variables can introduce non-determinism. Please follow [orchestrator code constraints](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp)
16+
DURABLE0007 | Orchestration | Warning | **CancellationTokenOrchestrationAnalyzer**: Warns when CancellationToken parameters are used in orchestration function signatures. Orchestration methods should not accept cancellation tokens directly.
17+
DURABLE0008 | Orchestration | Warning | **OtherBindingsOrchestrationAnalyzer**: Warns when orchestration methods have input parameters with bindings other than [OrchestrationTrigger] (e.g., [EntityTrigger], [DurableClient]). Orchestrations must only use [OrchestrationTrigger] bindings.
18+
DURABLE1001 | Attribute Binding | Error | **OrchestrationTriggerBindingAnalyzer**: Ensures [OrchestrationTrigger] is only applied to parameters of type TaskOrchestrationContext.
19+
DURABLE1002 | Attribute Binding | Error | **DurableClientBindingAnalyzer**: Ensures [DurableClient] is only applied to parameters of type DurableTaskClient.
20+
DURABLE1003 | Attribute Binding | Error | **EntityTriggerBindingAnalyzer**: Ensures [EntityTrigger] is only applied to parameters of type TaskEntityDispatcher.
21+
DURABLE2001 | Activity | Warning | **MatchingInputOutputTypeActivityAnalyzer**: Warns when the input type passed to an activity invocation does not match the activity's definition.
22+
DURABLE2002 | Activity | Warning | **MatchingInputOutputTypeActivityAnalyzer**: Warns when the output type expected from an activity invocation does not match the activity's definition.

src/Client/AzureManaged/DurableTaskSchedulerClientOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ this.Credential is not null
173173
switch (authType.ToLowerInvariant())
174174
{
175175
case "defaultazure":
176-
return new DefaultAzureCredential();
176+
return new DefaultAzureCredential(); // CodeQL [SM05137] Use DefaultAzureCredential explicitly for local development and is decided by the user
177177
case "managedidentity":
178178
return new ManagedIdentityCredential(connectionString.ClientId);
179179
case "workloadidentity":

src/Worker/AzureManaged/DurableTaskSchedulerWorkerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ this.Credential is not null
135135
switch (authType.ToLowerInvariant())
136136
{
137137
case "defaultazure":
138-
return new DefaultAzureCredential();
138+
return new DefaultAzureCredential(); // CodeQL [SM05137] Use DefaultAzureCredential explicitly for local development and is decided by the user
139139
case "managedidentity":
140140
return new ManagedIdentityCredential(connectionString.ClientId);
141141
case "workloadidentity":

src/Worker/Core/Shims/TaskOrchestrationContextWrapper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ static void SwapByteArrayElements(byte[] byteArray, int left, int right)
379379

380380
byte[] hashByteArray;
381381
#pragma warning disable CA5350 // Do Not Use Weak Cryptographic Algorithms -- not for cryptography
382-
using (HashAlgorithm hashAlgorithm = SHA1.Create())
382+
using (HashAlgorithm hashAlgorithm = SHA1.Create()) /* CodeQL [SM02196] Suppressed: SHA1 is not used for cryptographic purposes here. The information being hashed is not sensitive,
383+
and the goal is to generate a deterministic Guid. We cannot update to SHA2-based algorithms without breaking
384+
customers' inflight orchestrations. */
383385
{
384386
hashAlgorithm.TransformBlock(namespaceValueByteArray, 0, namespaceValueByteArray.Length, null, 0);
385387
hashAlgorithm.TransformFinalBlock(nameByteArray, 0, nameByteArray.Length);

0 commit comments

Comments
 (0)