Skip to content

[WIP] Add table views #46

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 4 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $durableEnginePath = "$PSScriptRoot/src/DurableEngine"
$durableAppPath = "$PSScriptRoot/test/E2E/durableApp/Modules/$packageName"
$powerShellModulePath = "$PSScriptRoot/src/$packageName.psm1"
$manifestPath = "$PSScriptRoot/src/$packageName.psd1"
$viewPath = "$PSScriptRoot/src/task.format.ps1xml"

$outputPath = "$PSScriptRoot/src/out/"
if ($Configuration -eq "Debug")
Expand Down Expand Up @@ -99,8 +100,9 @@ Get-ChildItem -Path "$shimPath/$publishPathSuffix" |
Where-Object { $_.Extension -in '.dll','.pdb' -and -not $commonFiles.Contains($_.Name) } |
ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $outputPath }

# Move Durable SDK manifest into the output directory
Write-Log "Copying PowerShell module and manifest from the Durable SDK source code into $outputPath" "Gray"
# Move Durable SDK manifest and ps1xml into the output directory
Write-Log "Copying PowerShell module, manifest, and ps1xml from the Durable SDK source code into $outputPath" "Gray"
Copy-Item -Path $powerShellModulePath -Destination $outputPath
Copy-Item -Path $manifestPath -Destination $outputPath
Copy-Item -Path $viewPath -Destination $outputPath
Write-Log "Build succeeded!"
2 changes: 1 addition & 1 deletion src/AzureFunctions.PowerShell.Durable.SDK.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
FormatsToProcess = @(".\task.format.ps1xml")

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('.\AzureFunctions.PowerShell.Durable.SDK.dll', '.\AzureFunctions.PowerShell.Durable.SDK.psm1')
Expand Down
6 changes: 3 additions & 3 deletions src/DurableEngine/Tasks/ActivityInvocationTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ namespace DurableEngine.Tasks

public class ActivityInvocationTask : DurableTask
{
internal string FunctionName { get; }
public string FunctionName { get; internal set;}

internal object Input { get; }
public object Input { get; internal set; }

private RetryOptions RetryOptions { get; }
public RetryOptions RetryOptions { get; internal set;}

public ActivityInvocationTask(
string functionName,
Expand Down
4 changes: 2 additions & 2 deletions src/DurableEngine/Tasks/DurableTimerTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace DurableEngine.Tasks
// All DurableTimerTasks must be complete or canceled for the orchestration to complete
public class DurableTimerTask : DurableTask
{
internal TimeSpan Duration { get; }
private DateTime FireAt { get; }
public TimeSpan Duration { get; internal set; }
public DateTime FireAt { get; private set; }
private CreateDurableTimerAction Action { get; set; }
private readonly CancellationTokenSource _cancelationTokenSource = new CancellationTokenSource();

Expand Down
2 changes: 1 addition & 1 deletion src/DurableEngine/Tasks/ExternalEventTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace DurableEngine.Tasks

public class ExternalEventTask : DurableTask
{
internal string ExternalEventName { get; }
public string ExternalEventName { get; internal set; }

public ExternalEventTask(
string externalEventName,
Expand Down
8 changes: 4 additions & 4 deletions src/DurableEngine/Tasks/SubOrchestratorTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace DurableEngine.Tasks
{
public class SubOrchestratorTask : DurableTask
{
internal string FunctionName { get; }
internal string InstanceId { get; }
public string FunctionName { get; internal set; }
public string InstanceId { get; internal set;}

internal object Input { get; }
public object Input { get; internal set; }

private RetryOptions RetryOptions { get; }
public RetryOptions RetryOptions { get; internal set; }

public SubOrchestratorTask(
string functionName,
Expand Down
159 changes: 159 additions & 0 deletions src/task.format.ps1xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>ActivityTaskView</Name>
<ViewSelectedBy>
<TypeName>DurableEngine.Tasks.ActivityInvocationTask</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TaskType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>FunctionName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Input</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>RetryOptions</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>NoWait</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>"Activity"</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>FunctionName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Input</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>RetryOptions</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>NoWait</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>DurableTimerTaskView</Name>
<ViewSelectedBy>
<TypeName>DurableEngine.Tasks.DurableTimerTask</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TaskType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Duration</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>FireAt</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>"DurableTimer"</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Duration</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>FireAt</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>ExternalEventTaskView</Name>
<ViewSelectedBy>
<TypeName>DurableEngine.Tasks.ExternalEventTask</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TaskType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>EventName</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>"ExternalEvent"</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ExternalEventName</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>SubOrchestratorTask</Name>
<ViewSelectedBy>
<TypeName>DurableEngine.Tasks.SubOrchestratorTask</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TaskType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>FunctionName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>InstanceId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Input</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>RetryOptions</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>"SubOrchestrator"</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>FunctionName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>InstanceId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Input</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>RetryOptions</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
2 changes: 1 addition & 1 deletion test/E2E/durableApp/DurableClient/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $Response = New-DurableOrchestrationCheckStatusResponse -Request $Request -Insta
Push-OutputBinding -Name Response -Value $Response

$Status = Get-DurableStatus -InstanceId $InstanceId
Write-Host "Orchestration $InstanceId status: $($Status | ConvertTo-Json)"
#Write-Host "Orchestration $InstanceId status: $($Status | ConvertTo-Json)"
if ($Status.RuntimeStatus -notin 'Pending', 'Running', 'Failed', 'Completed') {
throw "Unexpected orchestration $InstanceId runtime status: $($Status.RuntimeStatus)"
}
Expand Down
8 changes: 6 additions & 2 deletions test/E2E/durableApp/SimpleOrchestrator/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ param($Context)

$ErrorActionPreference = 'Stop'

$output = Invoke-DurableActivity -FunctionName "Hello" -Input "Tokyo"
$output = Invoke-DurableActivity -FunctionName "Hello" -Input "Tokyo" -NoWait
$output = Start-DurableTimer -Duration (New-TimeSpan -Seconds 5) -NoWait
$output = Start-DurableExternalEventListener -EventName "TESTEVENTNAME" -NoWait
$output = Invoke-DurableSubOrchestrator -FunctionName "SimpleOrchestrator" -NoWait
Write-Output $output

return $output
#return "bye!"