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

refactor: remove unused mermaid graph generation for state machines and update stateless #655

Merged
merged 1 commit into from
Mar 1, 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
2 changes: 1 addition & 1 deletion Common/src/ArmoniK.Core.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="Grpc.HealthCheck" Version="2.60.0" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="stateless" Version="5.13.0" />
<PackageReference Include="stateless" Version="5.15.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Linq;
using System.Text;

using ArmoniK.Api.gRPC.V1;
using ArmoniK.Api.gRPC.V1.Submitter;
Expand Down Expand Up @@ -199,35 +197,6 @@ public bool IsComplete()
public string GenerateGraph()
=> UmlDotGraph.Format(machine_.GetInfo());

/// <summary>
/// Generate a Mermaid graph representing the Final State Machine
/// </summary>
/// <returns>
/// A string containing the graph in Mermaid format
/// </returns>
public string GenerateMermaidGraph()
{
var str = UmlMermaidGraph.Format(machine_.GetInfo());

// Manually fix the footer; the last
// 3 lines should be disposed
var lines = str.Split(new[]
{
Environment.NewLine,
},
StringSplitOptions.None);
str = string.Join(Environment.NewLine,
lines.Take(lines.Length - 3));

// Enclose in markers for markdown
var bld = new StringBuilder(str);
bld.Insert(0,
"```mermaid\n");
bld.Append("\n```\n");

return bld.ToString();
}

/// <summary>
/// Get the current state of the Final State Machine
/// </summary>
Expand Down
45 changes: 0 additions & 45 deletions Common/src/StateMachines/UmlMermaidGraph.cs

This file was deleted.

109 changes: 0 additions & 109 deletions Common/src/StateMachines/UmlMermaidGraphStyle.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,4 @@ public void GenerateGraphShouldSucceed()
Console.WriteLine(str);
Assert.IsFalse(string.IsNullOrEmpty(str));
}

[Test]
public void GenerateMermaidGraphShouldSucceed()
{
var str = sm_!.GenerateMermaidGraph();
Console.WriteLine(str);
Assert.IsFalse(string.IsNullOrEmpty(str));
}
}