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
1 change: 1 addition & 0 deletions .github/workflows/build-container-debian-lts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
container-runtime: bookworm-slim
runtime: linux-x64
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/build-container-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
build-args: |
CONTAINER_RUNTIME=${{ inputs.container-runtime }}
RUNTIME=${{ inputs.runtime }}
secrets: |
nuget_auth_token=${{ secrets.GITHUB_TOKEN }}
- name: Verify Build
run: |
docker run --rm eventstore --insecure --what-if
Expand All @@ -57,6 +59,8 @@ jobs:
build-args: |
CONTAINER_RUNTIME=${{ inputs.container-runtime }}
RUNTIME=${{ inputs.runtime }}
secrets: |
nuget_auth_token=${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
run: |
docker run \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-container-ubuntu-lts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
container-runtime: noble
runtime: linux-x64
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ on:
required: true
type: string

permissions:
contents: read
packages: read

jobs:
nuget-source:
name: Auth with GitHub Packages
uses: ./.github/workflows/nuget-auth.yml
with:
working-directory: src
build:
strategy:
fail-fast: false
Expand All @@ -33,6 +42,8 @@ jobs:
dotnet-version: 8.0.x
- name: Compile
shell: bash
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet build --configuration ${{ matrix.configuration }} -p:Platform=${{ inputs.arch }} src/EventStore.sln
- name: Verify Build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-ubuntu-lts-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
os: ubuntu-24.04-arm
arch: arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/build-ubuntu-lts-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
os: ubuntu-24.04
arch: x64
secrets: inherit
18 changes: 15 additions & 3 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
- "samples/**"
- "**.md"

permissions:
contents: read
packages: read

jobs:
vulnerability-scan:
runs-on: ubuntu-latest
Expand All @@ -29,12 +33,20 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set up .NET NuGet authentication
run: |
dotnet nuget add source "https://nuget.pkg.github.com/TrogonStack/index.json" \
--name "github" \
--username ${{ github.actor }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text
- name: Scan for Vulnerabilities
run: |
cd src
dotnet restore
dotnet list package --vulnerable --include-transitive | tee vulnerabilities.txt
! cat vulnerabilities.txt | grep -q "has the following vulnerable packages"

protolock:
runs-on: ubuntu-latest
name: Protolock Status
Expand All @@ -48,9 +60,6 @@ jobs:
docker-compose:
runs-on: ubuntu-latest
name: Docker Compose Smoke Test
permissions:
contents: read
packages: read
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -61,6 +70,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Compose Smoke Test
env:
DOCKER_BUILDKIT: 1
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker compose build
docker compose up --detach
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/nuget-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: NuGet Auth + Restore

on:
workflow_call:
inputs:
working-directory:
required: true
type: string

permissions:
contents: read
packages: write

jobs:
restore:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Authenticate NuGet GitHub Packages
run: |
dotnet nuget add source https://nuget.pkg.github.com/TrogonStack/index.json \
--name github \
--username "${{ github.actor }}" \
--password "${{ secrets.GITHUB_TOKEN }}" \
--store-password-in-clear-text

- name: Verify NuGet Source Configuration
run: |
echo "Listing configured NuGet sources:"
dotnet nuget list source
echo ""
echo "Verifying GitHub Packages authentication:"
dotnet nuget verify --source github || echo "Verification failed, but continuing..."

- name: Test Package Restore
working-directory: ${{ inputs.working-directory }}
run: |
echo "Testing package restore with authenticated source:"
dotnet restore --verbosity normal
21 changes: 0 additions & 21 deletions .github/workflows/pull-request-check.yml

This file was deleted.

13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ WORKDIR /build/ci
COPY ./ci ./

WORKDIR /build/src
COPY ./src/EventStore.sln ./src/*/*.csproj ./src/Directory.Build.* ./src/Directory.Packages.* ./
COPY ./src/EventStore.sln ./src/*/*.csproj ./src/Directory.Build.* ./src/Directory.Packages.* ./src/NuGet.Config ./
RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done

# Configure NuGet authentication for GitHub Packages using Docker secrets
RUN --mount=type=secret,id=nuget_auth_token \
if [ -f /run/secrets/nuget_auth_token ]; then \
NUGET_AUTH_TOKEN=$(cat /run/secrets/nuget_auth_token) && \
dotnet nuget update source github \
--username docker \
--password "$NUGET_AUTH_TOKEN" \
--store-password-in-clear-text; \
fi

RUN dotnet restore --runtime=${RUNTIME}
COPY ./src .

Expand Down
19 changes: 16 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ services:
- volumes-provisioner

esdb-node1:
build: ./
build:
context: ./
secrets:
- nuget_auth_token
env_file:
- shared.env
environment:
Expand All @@ -46,7 +49,10 @@ services:
- cert-gen

esdb-node2:
build: ./
build:
context: ./
secrets:
- nuget_auth_token
env_file:
- shared.env
environment:
Expand All @@ -68,7 +74,10 @@ services:
- cert-gen

esdb-node3:
build: ./
build:
context: ./
secrets:
- nuget_auth_token
env_file:
- shared.env
environment:
Expand Down Expand Up @@ -97,3 +106,7 @@ networks:
driver: default
config:
- subnet: 172.30.240.0/24

secrets:
nuget_auth_token:
environment: NUGET_AUTH_TOKEN
8 changes: 6 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageVersion Include="DotNext.Unsafe" Version="5.22.0" />
<PackageVersion Include="EventStore.Client" Version="21.2.0" />
<PackageVersion Include="EventStore.Client.Grpc.Streams" Version="23.3.3" />
<PackageVersion Include="EventStore.Plugins" Version="24.10.3" />
<!--Version 8 and beyond are free for open-source projects and non-commercial use, but commercial use requires a paid license-->
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
<PackageVersion Include="FluentStorage.AWS" Version="5.5.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down Expand Up @@ -49,6 +49,7 @@
<PackageVersion Include="Microsoft.Extensions.FileProviders.Composite" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.18" />
<PackageVersion Include="Microsoft.FASTER.Core" Version="1.9.16" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.18" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.24" />
Expand All @@ -62,7 +63,7 @@
<PackageVersion Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.4.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.4.0" />
<PackageVersion Include="Quickenshtein" Version="1.5.1" />
<PackageVersion Include="Scrutor" Version="4.2.2" />
<PackageVersion Include="Scrutor" Version="5.1.2" />
<PackageVersion Include="Serilog" Version="4.3.0" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="3.0.0" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" />
Expand All @@ -83,11 +84,14 @@
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="8.0.2" />
<PackageVersion Include="System.ServiceModel.Http" Version="6.2.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="System.Threading.Channels" Version="9.0.8" />
<PackageVersion Include="TrogonEventStore.Plugins" Version="24.10.9" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 1 addition & 0 deletions src/EventStore.Common/EventStore.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<PackageReference Include="Serilog.Sinks.Async" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="System.Private.Uri" />

<PackageReference Include="System.Security.Cryptography.Pkcs" />
<PackageReference Include="System.Text.RegularExpressions" />
Expand Down
13 changes: 12 additions & 1 deletion src/EventStore.Common/Utils/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace EventStore.Common.Utils;

public static class Helper
{
public static readonly UTF8Encoding UTF8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
public static readonly UTF8Encoding UTF8NoBom = new(encoderShouldEmitUTF8Identifier: false);

public static void EatException(Action action)
{
Expand All @@ -20,6 +20,17 @@ public static void EatException(Action action)
}
}

public static void EatException<TArg>(TArg arg, Action<TArg> action)
{
try
{
action(arg);
}
catch (Exception)
{
Comment on lines +29 to +30
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poor error handling: empty catch block.

Suggested change
catch (Exception)
{
catch (Exception ex)
{
System.Diagnostics.Trace.TraceError("Exception swallowed in EatException<TArg>: " + ex);

Copilot uses AI. Check for mistakes.
}
Comment on lines +29 to +31
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic catch clause.

Copilot uses AI. Check for mistakes.
}

public static T EatException<T>(Func<T> action, T defaultValue = default(T))
{
try
Expand Down
Loading
Loading