Skip to content
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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ resharper_redundant_argument_default_value_highlighting=do_not_show
resharper_redundant_type_arguments_of_method_highlighting=do_not_show
resharper_switch_expression_handles_some_known_enum_values_with_exception_in_default_highlighting=error

resharper_arrange_type_member_modifiers_highlighting=none;

[src/api/Elastic.Transport/Components/Serialization/**.cs]
dotnet_diagnostic.IL3050.severity = none
dotnet_diagnostic.IL2026.severity = none

[Jenkinsfile]
indent_style = space
indent_size = 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: dotnet publish examples/transport-aot-example

- name: Invoke AOT
run: ./examples/transport-aot-example/bin/Release/net8.0/${{ matrix.os.folder }}/${{ matrix.os.binary }}
run: .artifacts/publish/transport-aot-example/release/${{ matrix.os.binary }}

build:
runs-on: ubuntu-latest
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 1

Expand All @@ -55,22 +55,12 @@ jobs:
${{ runner.os }}-nuget

- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
global-json-file: ./global.json

- run: ./build.bat build -s true
name: Build

- run: ./build.bat test -s true
name: Test

- name: Test Results
if: success() || failure()
uses: mikepenz/action-junit-report@v4
with:
report_paths: 'build/output/junit-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_failure: true
require_tests: true
check_name: Test Results
name: Test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ src/packages/
BenchmarkDotNet.Artifacts
*.received.*

/.ionide/symbolCache.db
/.ionide/symbolCache.db
.artifacts
9 changes: 6 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@

<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>

<MinVerDefaultPreReleasePhase>canary</MinVerDefaultPreReleasePhase>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
<MinVerDefaultPreReleaseIdentifiers>canary.0</MinVerDefaultPreReleaseIdentifiers>
<MinVerMinimumMajorMinor>0.2</MinVerMinimumMajorMinor>

<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>False</IsPackable>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionRoot)\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
<UseArtifactsOutput>true</UseArtifactsOutput>
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.sh))</SolutionRoot>
<ArtifactsPath>$(MSBuildThisFileDirectory).artifacts</ArtifactsPath>
</PropertyGroup>
<PropertyGroup Condition="">
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Condition="'$(TargetFramework)' != 'net462'" Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
123 changes: 0 additions & 123 deletions Elastic.Transport.sln

This file was deleted.

35 changes: 35 additions & 0 deletions Elastic.Transport.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks/Elastic.Transport.Benchmarks/Elastic.Transport.Benchmarks.csproj" />
<Project Path="benchmarks/Elastic.Transport.Profiling/Elastic.Transport.Profiling.csproj" />
</Folder>
<Folder Name="/build/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".github/workflows/ci.yml" />
<File Path=".github/workflows/test-windows.yml" />
<File Path=".gitignore" />
<File Path="build.bat" />
<File Path="build.sh" />
<File Path="Directory.Build.props" />
<File Path="global.json" />
<File Path="license.txt" />
<File Path="README.md" />
<Project Path="build/scripts/scripts.fsproj" />
</Folder>
<Folder Name="/examples/">
<Project Path="examples/transport-aot-example/transport-aot-example.csproj" />
</Folder>
<Folder Name="/src/">
<File Path="src/Directory.Build.props" />
<Project Path="Playground/Playground.csproj" />
<Project Path="src/Elastic.Transport.VirtualizedCluster/Elastic.Transport.VirtualizedCluster.csproj" />
<Project Path="src/Elastic.Transport/Elastic.Transport.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/Elastic.Elasticsearch.IntegrationTests/Elastic.Elasticsearch.IntegrationTests.csproj" />
<Project Path="tests/Elastic.Transport.IntegrationTests/Elastic.Transport.IntegrationTests.csproj" />
<Project Path="tests/Elastic.Transport.Tests.Shared/Elastic.Transport.Tests.Shared.csproj" />
<Project Path="tests/Elastic.Transport.Tests/Elastic.Transport.Tests.csproj" />
</Folder>
</Solution>
2 changes: 1 addition & 1 deletion Playground/Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Elastic.Transport.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using Perfolizer.Metrology;

namespace Elastic.Transport.Benchmarks
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Profiler.Api" Version="1.4.2" />
<PackageReference Include="JetBrains.Profiler.Api" Version="1.4.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/Paths.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let GenerateApiChanges = false

let Root =
let mutable dir = DirectoryInfo(".")
while dir.GetFiles("*.sln").Length = 0 do dir <- dir.Parent
while dir.GetFiles("*.slnx").Length = 0 do dir <- dir.Parent
Environment.CurrentDirectory <- dir.FullName
dir

Expand Down
5 changes: 3 additions & 2 deletions build/scripts/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ let main argv =
Targets.Setup parsed arguments
let swallowTypes = [typeof<ProcExecException>; typeof<ExceptionExiter>]

Targets.RunTargetsAndExit
([target], (fun e -> swallowTypes |> List.contains (e.GetType()) ), ":")
task {
return! Targets.RunTargetsAndExitAsync([ target ], (fun e -> swallowTypes |> List.contains (e.GetType())), (fun _ -> ":"), null, null)
} |> Async.AwaitTask |> Async.RunSynchronously
0

28 changes: 13 additions & 15 deletions build/scripts/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,20 @@ let getOS =
| _ -> Windows

let execWithTimeout binary args timeout =
let opts =
ExecArguments(binary, args |> List.map (sprintf "\"%s\"") |> List.toArray)
let opts = ExecArguments(binary, args |> List.toArray, Timeout=timeout)
let options = args |> String.concat " "
printfn ":: Running command: %s %s" binary options
let r = Proc.Exec(opts, timeout)

match r.HasValue with
| true -> r.Value
| false -> failwithf "invocation of `%s` timed out" binary
Proc.Exec(opts)

let exec binary args =
execWithTimeout binary args (TimeSpan.FromMinutes 10)
execWithTimeout binary args (Nullable(TimeSpan.FromMinutes 10.))

let private restoreTools = lazy(exec "dotnet" ["tool"; "restore"])
let private currentVersion =
lazy(
restoreTools.Value |> ignore
let r = Proc.Start("dotnet", "minver", "--default-pre-release-phase", "canary", "-m", "0.1")
let o = r.ConsoleOut |> Seq.find (fun l -> not(l.Line.StartsWith("MinVer:")))
let r = Proc.Start("dotnet", "minver", "-p", "canary.0", "-m", "0.1")
let o = r.ConsoleOut |> Seq.find (fun l -> not(l.Line.StartsWith "MinVer:"))
o.Line
)
let private currentVersionInformational =
Expand All @@ -67,11 +62,9 @@ let private pristineCheck (arguments:ParseResults<Arguments>) =
| _ -> failwithf "The checkout folder has pending changes, aborting"

let private test (arguments:ParseResults<Arguments>) =
let junitOutput = Path.Combine(Paths.Output.FullName, "junit-{assembly}-{framework}-test-results.xml")
let loggerPathArgs = sprintf "LogFilePath=%s" junitOutput
let loggerArg = sprintf "--logger:\"junit;%s\"" loggerPathArgs
let loggerArg = "--logger:GithubActions"
let tfmArgs =
if getOS = OS.Windows then [] else ["-f"; "net8.0"]
if getOS = OS.Windows then [] else ["-f"; "net10.0"]
exec "dotnet" (["test"; "-c"; "Release"; loggerArg] @ tfmArgs) |> ignore

let private generatePackages (arguments:ParseResults<Arguments>) =
Expand Down Expand Up @@ -101,11 +94,16 @@ let private generateApiChanges (arguments:ParseResults<Arguments>) =
let outputFile =
let f = sprintf "breaking-changes-%s.md" p
Path.Combine(output, f)
let directory =
match p with
| "Elastic.Transport.VirtualizedCluster" -> $".artifacts/bin/%s{p}/release"
| _ -> $".artifacts/bin/%s{p}/release_%s{Paths.MainTFM}"

let args =
[
"assembly-differ"
(sprintf "previous-nuget|%s|%s|%s" p currentVersion Paths.MainTFM);
(sprintf "directory|src/%s/bin/Release/%s" p Paths.MainTFM);
(sprintf "directory|%s" directory);
"-a"; "true"; "--target"; p; "-f"; "github-comment"; "--output"; outputFile
]

Expand Down
Loading