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

Decommission dead features & accommodate Robot,Studio,UpdateSrv #101

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
4 changes: 2 additions & 2 deletions src/CI/azp-dotnet-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ steps:

- task: DotNetCoreCLI@2
displayName: 'dotnet push to UiPath-Internal'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: succeeded()
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
publishVstsFeed: 'Public.Feeds/UiPath-Internal'

- task: PublishSymbols@2
displayName: 'Publish Symbols to UiPath Azure Artifacts Symbol Server'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: succeeded()
inputs:
symbolsFolder: $(Build.SourcesDirectory)
searchPattern: '**/UiPath.CoreIpc/bin/**/UiPath.CoreIpc.pdb'
Expand Down
6 changes: 6 additions & 0 deletions src/CI/azp-dotnet.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
steps:
- task: DotNetCoreCLI@2
displayName: '$(Label_DotNet) Restore, build and pack'
inputs:
projects: '$(DotNet_SessionSolution)'
arguments: '--configuration $(DotNet_BuildConfiguration) -p:Version="$(FullVersion)" -p:DefineConstantsEx="CI"'

- task: DotNetCoreCLI@2
displayName: '$(Label_DotNet) Run unit tests'
inputs:
Expand Down
16 changes: 16 additions & 0 deletions src/CI/azp-initialization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
steps:
- powershell: |
Write-Host "##vso[task.setvariable variable=DotnetRuntimeVersion;]8.0.0"
Write-Host "##vso[task.setvariable variable=DOTNET_NOLOGO;]true"
displayName: 'Use .NET Runtime 8.0.0'

- task: UseDotNet@2
displayName: 'Use .NET SDK 6.0.317'
inputs:
packageType: 'sdk'
version: '6.0.317'

- task: UseDotNet@2
displayName: 'Use .NET SDK 8.x'
inputs:
packageType: 'sdk'
version: 8.x

# Read $(Version) from the UiPath.CoreIpc.csproj file
- powershell: |
Expand Down
2 changes: 1 addition & 1 deletion src/CI/azp-nodejs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
inputs:
workingDirectory: $(NodeJS_ProjectPath)
script: 'npm test'

- task: PublishTestResults@2
displayName: 'Publish Web Test Results'
condition: succeededOrFailed()
Expand Down
50 changes: 25 additions & 25 deletions src/CI/azp-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variables:
DotNet_MainProjectName: 'UiPath.CoreIpc'
DotNet_MainProjectPath: './src/UiPath.CoreIpc/UiPath.CoreIpc.csproj'
DotNet_ArtifactName: 'NuGet package'

NodeJS_DotNet_BuildConfiguration: 'Debug'
NodeJS_ProjectPath: './src/Clients/js'
NodeJS_ArchivePath: './src/Clients/js/dist/pack/nodejs.zip'
Expand All @@ -23,32 +23,32 @@ stages:
- stage: Build
displayName: '🏭 Build'
jobs:
# The following 3 jobs will run in parallel:
- job:
displayName: '.NET on Windows'
pool:
# The following 3 jobs will run in parallel:
- job:
displayName: '.NET on Windows'
pool:
vmImage: 'windows-2022'
steps:
- template: azp-initialization.yaml
- template: azp-dotnet.yaml
- template: azp-dotnet-dist.yaml
- job:
displayName: 'node.js on Windows'
pool:
steps:
- template: azp-initialization.yaml
- template: azp-dotnet.yaml
- template: azp-dotnet-dist.yaml

- job:
displayName: 'node.js on Windows'
pool:
vmImage: 'windows-2022'
steps:
- template: azp-initialization.yaml
- template: azp-nodejs.yaml
- template: azp-nodejs-dist.yaml
- job:
displayName: 'node.js on Ubuntu'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: azp-initialization.yaml
- template: azp-nodejs.yaml
steps:
- template: azp-initialization.yaml
- template: azp-nodejs.yaml
- template: azp-nodejs-dist.yaml

- job:
displayName: 'node.js on Ubuntu'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: azp-initialization.yaml
- template: azp-nodejs.yaml

- stage: Publish
displayName: 🚚 Publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace UiPath.CoreIpc.NodeInterop;
namespace UiPath.Ipc.NodeInterop;

internal static class Contracts
{
Expand Down
6 changes: 3 additions & 3 deletions src/Clients/js/dotnet/UiPath.CoreIpc.NodeInterop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
using UiPath.CoreIpc.NamedPipe;
using UiPath.CoreIpc.WebSockets;
using UiPath.Ipc.NamedPipe;
using UiPath.Ipc.WebSockets;

namespace UiPath.CoreIpc.NodeInterop;
namespace UiPath.Ipc.NodeInterop;

using static Contracts;
using static ServiceImpls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace UiPath.CoreIpc.NodeInterop;
namespace UiPath.Ipc.NodeInterop;

using static Contracts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Newtonsoft.Json.Converters;
using System;

namespace UiPath.CoreIpc.NodeInterop;
namespace UiPath.Ipc.NodeInterop;

internal static class Signalling
{
Expand Down
1 change: 1 addition & 0 deletions src/CoreIpc.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.CoreIpc.Tests", "UiP
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{676A208A-2F08-4749-A833-F8D2BCB1B147}"
ProjectSection(SolutionItems) = preProject
Directory.Build.targets = Directory.Build.targets
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Expand Down
5 changes: 5 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<PackageReference Update="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
</ItemGroup>
</Project>
9 changes: 4 additions & 5 deletions src/IpcSample.ConsoleClient/Client.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Text;
using System.Diagnostics;
using UiPath.CoreIpc.NamedPipe;
using UiPath.Ipc.NamedPipe;
using Microsoft.Extensions.DependencyInjection;

namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;

class Client
{
Expand Down Expand Up @@ -32,15 +32,14 @@ private static async Task RunTestsAsync(CancellationToken cancellationToken)
var serviceProvider = ConfigureServices();
var callback = new ComputingCallback { Id = "custom made" };
var computingClientBuilder = new NamedPipeClientBuilder<IComputingService, IComputingCallback>("test", serviceProvider)
.SerializeParametersAsObjects().CallbackInstance(callback).AllowImpersonation().RequestTimeout(TimeSpan.FromSeconds(2));
.CallbackInstance(callback).AllowImpersonation().RequestTimeout(TimeSpan.FromSeconds(2));
var stopwatch = Stopwatch.StartNew();
int count = 0;
try
{
var computingClient = computingClientBuilder.ValidateAndBuild();
var systemClient =
new NamedPipeClientBuilder<ISystemService>("test")
.SerializeParametersAsObjects()
.RequestTimeout(TimeSpan.FromSeconds(2))
.Logger(serviceProvider)
.AllowImpersonation()
Expand All @@ -67,7 +66,7 @@ private static async Task RunTestsAsync(CancellationToken cancellationToken)
Console.WriteLine($"[TEST 3] sum of 3 complexe number is: {result3.A}+{result3.B}i", cancellationToken);

// test 4: call IPC service method without parameter or return
await systemClient.DoNothing(cancellationToken);
await systemClient.FireAndForget(cancellationToken);
Console.WriteLine($"[TEST 4] invoked DoNothing()");
//((IDisposable)systemClient).Dispose();

Expand Down
8 changes: 4 additions & 4 deletions src/IpcSample.ConsoleClient/IpcSample.ConsoleClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
</ItemGroup>
</Project>
30 changes: 30 additions & 0 deletions src/IpcSample.ConsoleClient/Polyfills.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#if NETFRAMEWORK

namespace System.Diagnostics.CodeAnalysis;

using static AttributeTargets;

[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(Parameter | Property | ReturnValue, AllowMultiple = true)]
internal sealed class NotNullIfNotNullAttribute : Attribute
{
/// <summary>
/// Gets the associated parameter name.
/// The output will be non-<see langword="null"/> if the argument to the
/// parameter specified is non-<see langword="null"/>.
/// </summary>
public string ParameterName { get; }

/// <summary>
/// Initializes the attribute with the associated parameter name.
/// </summary>
/// <param name="parameterName">
/// The associated parameter name.
/// The output will be non-<see langword="null"/> if the argument to the
/// parameter specified is non-<see langword="null"/>.
/// </param>
public NotNullIfNotNullAttribute(string parameterName) =>
ParameterName = parameterName;
}
#endif
7 changes: 3 additions & 4 deletions src/IpcSample.ConsoleClient/TcpClient.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Text;
using System.Diagnostics;
using UiPath.CoreIpc.Tcp;
using UiPath.Ipc.Tcp;
using Microsoft.Extensions.DependencyInjection;
using System.Net;

namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;

class TcpClient
{
Expand Down Expand Up @@ -35,15 +35,14 @@ private static async Task RunTestsAsync(CancellationToken cancellationToken)
var serviceProvider = ConfigureServices();
var callback = new ComputingCallback { Id = "custom made" };
var computingClientBuilder = new TcpClientBuilder<IComputingService, IComputingCallback>(SystemEndPoint, serviceProvider)
.SerializeParametersAsObjects().CallbackInstance(callback)/*.EncryptAndSign("localhost")*/.RequestTimeout(TimeSpan.FromSeconds(2));
.CallbackInstance(callback)/*.EncryptAndSign("localhost")*/.RequestTimeout(TimeSpan.FromSeconds(2));
var stopwatch = Stopwatch.StartNew();
int count = 0;
try
{
var computingClient = computingClientBuilder.ValidateAndBuild();
var systemClient =
new TcpClientBuilder<ISystemService>(SystemEndPoint)
.SerializeParametersAsObjects()
//.EncryptAndSign("localhost")
.RequestTimeout(TimeSpan.FromSeconds(2))
.Logger(serviceProvider)
Expand Down
8 changes: 4 additions & 4 deletions src/IpcSample.ConsoleClient/WebSocketClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Text;
using System.Diagnostics;
using UiPath.CoreIpc.WebSockets;
using UiPath.Ipc.WebSockets;
using Microsoft.Extensions.DependencyInjection;
namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;
class WebSocketClient
{
static async Task _Main(string[] args)
Expand Down Expand Up @@ -32,15 +32,15 @@ private static async Task RunTestsAsync(CancellationToken cancellationToken)
Uri uri = new("ws://localhost:1212/wsDemo/");
var serviceProvider = ConfigureServices();
var callback = new ComputingCallback { Id = "custom made" };
var computingClientBuilder = new WebSocketClientBuilder<IComputingService, IComputingCallback>(uri, serviceProvider).SerializeParametersAsObjects()
var computingClientBuilder = new WebSocketClientBuilder<IComputingService, IComputingCallback>(uri, serviceProvider)
.CallbackInstance(callback)/*.EncryptAndSign("localhost")*/.RequestTimeout(TimeSpan.FromSeconds(2));
var stopwatch = Stopwatch.StartNew();
int count = 0;
try
{
var computingClient = computingClientBuilder.ValidateAndBuild();
var systemClient =
new WebSocketClientBuilder<ISystemService>(uri).SerializeParametersAsObjects()
new WebSocketClientBuilder<ISystemService>(uri)
//.EncryptAndSign("localhost")
.RequestTimeout(TimeSpan.FromSeconds(2))
.Logger(serviceProvider)
Expand Down
8 changes: 4 additions & 4 deletions src/IpcSample.ConsoleServer/IpcSample.ConsoleServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/IpcSample.ConsoleServer/Server.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics;
using UiPath.CoreIpc.NamedPipe;
using UiPath.Ipc.NamedPipe;

namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;

class Server
{
Expand Down
4 changes: 2 additions & 2 deletions src/IpcSample.ConsoleServer/TcpServer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics;
using System.Net;
using UiPath.CoreIpc.Tcp;
using UiPath.Ipc.Tcp;

namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;

class TcpServer
{
Expand Down
4 changes: 2 additions & 2 deletions src/IpcSample.ConsoleServer/WebSocketServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Diagnostics;
using System.Net;
using System.Net.WebSockets;
using UiPath.CoreIpc.WebSockets;
namespace UiPath.CoreIpc.Tests;
using UiPath.Ipc.WebSockets;
namespace UiPath.Ipc.Tests;
class WebSocketServer
{
//private static readonly Timer _timer = new Timer(_ =>
Expand Down
6 changes: 3 additions & 3 deletions src/UiPath.CoreIpc.Tests/ComputingTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace UiPath.CoreIpc.Tests;
namespace UiPath.Ipc.Tests;

public abstract class ComputingTests<TBuilder> : TestBase where TBuilder : ServiceClientBuilder<TBuilder, IComputingService>
{
Expand All @@ -14,7 +14,7 @@ public ComputingTests()
.AddEndpoint<IComputingService, IComputingCallback>()
.ValidateAndBuild();
_computingHost.RunAsync(GuiScheduler);
_computingClient = ComputingClientBuilder(GuiScheduler).SerializeParametersAsObjects().ValidateAndBuild();
_computingClient = ComputingClientBuilder(GuiScheduler).ValidateAndBuild();
}
protected abstract TBuilder ComputingClientBuilder(TaskScheduler taskScheduler = null);
[Fact]
Expand Down Expand Up @@ -58,7 +58,7 @@ public async Task ClientCancellation()
[Fact]
public async Task ClientTimeout()
{
var proxy = ComputingClientBuilder().SerializeParametersAsObjects().RequestTimeout(TimeSpan.FromMilliseconds(10)).ValidateAndBuild();
var proxy = ComputingClientBuilder().RequestTimeout(TimeSpan.FromMilliseconds(10)).ValidateAndBuild();
proxy.Infinite().ShouldThrow<TimeoutException>().Message.ShouldBe($"{nameof(_computingClient.Infinite)} timed out.");
await proxy.GetCallbackThreadName(new Message { RequestTimeout = RequestTimeout });
((IDisposable)proxy).Dispose();
Expand Down
Loading