Skip to content

Commit

Permalink
refactor: remove unused mermaid graph generation for state machines a…
Browse files Browse the repository at this point in the history
…nd update stateless (#655)
  • Loading branch information
aneojgurhem authored Mar 1, 2024
2 parents 40696ce + 5ea8ce7 commit 605de08
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 194 deletions.
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));
}
}

0 comments on commit 605de08

Please sign in to comment.