Skip to content
Closed
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 .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2.3.4

- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config

- name: Build Code
run: dotnet build EstateManagementUI.sln --configuration Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config

- name: Build Code
run: dotnet build EstateManagementUI.sln --configuration Release --no-restore
Expand All @@ -45,7 +45,7 @@ jobs:

- name: Publish UI
if: ${{ github.event.release.prerelease == false }}
run: dotnet publish "EstateManagementUI.BlazorServer\EstateManagementUI.BlazorServer.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained
run: dotnet publish "EstateManagementUI.BlazorServer\EstateManagementUI.BlazorServer.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained --no-restore
-p:Version=${{ steps.get_version.outputs.VERSION }}
-p:AssemblyVersion=${{ steps.get_version.outputs.VERSION }}
-p:FileVersion=${{ steps.get_version.outputs.VERSION }}
Expand Down Expand Up @@ -126,4 +126,4 @@ jobs:
$servicePath = "C:\txnproc\transactionprocessing\estatemanagementui\EstateManagementUI.BlazorServer.exe"

New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
Start-Service -Name $serviceName
2 changes: 1 addition & 1 deletion .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2.3.4

- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config

- name: Build Code
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
dotnet-version: '10.0.x'

- name: Restore NuGet packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config

- name: Build solution
run: dotnet build EstateManagementUI.sln --configuration Release --no-restore
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
run: docker build . --file EstateManagementUI.BlazorServer/Dockerfile --tag estatemanagementuiblazorserver:latest

- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config

- name: Build Integration Tests
run: dotnet build EstateManagementUI.IntegrationTests/EstateManagementUI.IntegrationTests.csproj --configuration Debug --no-restore
Expand Down
4 changes: 2 additions & 2 deletions EstateManagementUI.BlazorServer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ WORKDIR /src
RUN curl -fsSL --insecure https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs

COPY ["EstateManagementUI.BlazorServer/NuGet.Config", "."]
COPY ["NuGet.Config", "."]
COPY ["EstateManagementUI.BlazorServer/Certificates/*.*", "Certificates/"]
COPY ["EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj", "EstateManagementUI.BlazorServer/"]
COPY ["Directory.Packages.props", "."]
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj"
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj" --configfile NuGet.Config

COPY . .
WORKDIR "/src/EstateManagementUI.BlazorServer"
Expand Down
4 changes: 2 additions & 2 deletions EstateManagementUI.BlazorServer/Dockerfile.original
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ WORKDIR /src
RUN curl -fsSL --insecure https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs

COPY ["EstateManagementUI.BlazorServer/NuGet.Config", "."]
COPY ["NuGet.Config", "."]
COPY ["EstateManagementUI.BlazorServer/Certificates/*.*", "Certificates/"]
COPY ["EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj", "EstateManagementUI.BlazorServer/"]
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj"
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj" --configfile NuGet.Config

COPY . .
WORKDIR "/src/EstateManagementUI.BlazorServer"
Expand Down
24 changes: 0 additions & 24 deletions EstateManagementUI.BlazorServer/NuGet.Config

This file was deleted.

68 changes: 68 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Feedz" value="https://f.feedz.io/transactionprocessing/nugets/nuget/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceMapping>
<packageSource key="Feedz">
<package pattern="ClientProxyBase" />
<package pattern="FileProcessor.Client" />
<package pattern="MessagingService.IntegrationTesting.Helpers" />
<package pattern="SecurityService.Client" />
<package pattern="SecurityService.IntegrationTesting.Helpers" />
<package pattern="Shared" />
<package pattern="Shared.Results" />
<package pattern="Shared.IntegrationTesting" />
<package pattern="TransactionProcessor.Client" />
<package pattern="TransactionProcessor.IntegrationTesting.Helpers" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="AspNetCore.HealthChecks.UI.Client" />
<package pattern="AspNetCore.HealthChecks.Uris" />
<package pattern="bunit.web" />
<package pattern="coverlet.collector" />
<package pattern="coverlet.msbuild" />
<package pattern="IdentityModel" />
<package pattern="Lamar" />
<package pattern="Lamar.Microsoft.DependencyInjection" />
<package pattern="MediatR" />
<package pattern="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<package pattern="Microsoft.CodeAnalysis.NetAnalyzers" />
<package pattern="Microsoft.EntityFrameworkCore.Sqlite" />
<package pattern="Microsoft.Extensions.Hosting.WindowsServices" />
<package pattern="Microsoft.NET.Test.Sdk" />
<package pattern="Microsoft.Playwright" />
<package pattern="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
<package pattern="Moq" />
<package pattern="NUnit" />
<package pattern="NUnit3TestAdapter" />
<package pattern="Reqnroll" />
<package pattern="Reqnroll.NUnit" />
<package pattern="Reqnroll.Tools.MsBuild.Generation" />
<package pattern="Roslynator.Analyzers" />
<package pattern="Sentry.AspNetCore" />
<package pattern="Shouldly" />
<package pattern="SimpleResults" />
<package pattern="xunit.v3" />
<package pattern="xunit.runner.visualstudio" />
</packageSource>
</packageSourceMapping>
<packageSourceCredentials>
<Feedz>
<add key="Username" value="TestUser" />
<add key="ClearTextPassword" value="T-jXeJSPLLjOdZvRZOQ5O2e1vrQwRI7uxC1U" />
</Feedz>
</packageSourceCredentials>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
149 changes: 149 additions & 0 deletions docs/superpowers/plans/2026-06-25-nuget-source-mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# NuGet Source Mapping Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Make package restore work consistently with central package management by using one root NuGet configuration with package source mapping in local builds, Docker builds, and GitHub Actions workflows.

**Architecture:** Keep a single `NuGet.Config` at the repository root so every restore path can discover the same package sources, credentials, and source mapping. Update Docker and workflow restore commands to use that file explicitly, then remove the project-local config so there is no competing restore policy.

**Tech Stack:** .NET SDK restore/publish, NuGet package source mapping, GitHub Actions, Docker

---

### Task 1: Add root NuGet policy

**Files:**
- Create: `NuGet.Config`
- Delete: `EstateManagementUI.BlazorServer/NuGet.Config`

- [ ] **Step 1: Add the root NuGet config**

```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Feedz" value="https://f.feedz.io/transactionprocessing/nugets/nuget/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceMapping>
<packageSource key="Feedz">
<package pattern="ClientProxyBase" />
<package pattern="FileProcessor.Client" />
<package pattern="MessagingService.IntegrationTesting.Helpers" />
<package pattern="SecurityService.Client" />
<package pattern="SecurityService.IntegrationTesting.Helpers" />
<package pattern="Shared" />
<package pattern="Shared.Results" />
<package pattern="Shared.IntegrationTesting" />
<package pattern="TransactionProcessor.Client" />
<package pattern="TransactionProcessor.IntegrationTesting.Helpers" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="AspNetCore.HealthChecks.UI.Client" />
<package pattern="AspNetCore.HealthChecks.Uris" />
<package pattern="bunit.web" />
<package pattern="coverlet.collector" />
<package pattern="coverlet.msbuild" />
<package pattern="IdentityModel" />
<package pattern="Lamar" />
<package pattern="Lamar.Microsoft.DependencyInjection" />
<package pattern="MediatR" />
<package pattern="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<package pattern="Microsoft.CodeAnalysis.NetAnalyzers" />
<package pattern="Microsoft.EntityFrameworkCore.Sqlite" />
<package pattern="Microsoft.Extensions.Hosting.WindowsServices" />
<package pattern="Microsoft.NET.Test.Sdk" />
<package pattern="Microsoft.Playwright" />
<package pattern="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
<package pattern="Moq" />
<package pattern="NUnit" />
<package pattern="NUnit3TestAdapter" />
<package pattern="Reqnroll" />
<package pattern="Reqnroll.NUnit" />
<package pattern="Reqnroll.Tools.MsBuild.Generation" />
<package pattern="Roslynator.Analyzers" />
<package pattern="Sentry.AspNetCore" />
<package pattern="Shouldly" />
<package pattern="SimpleResults" />
<package pattern="xunit.v3" />
<package pattern="xunit.runner.visualstudio" />
</packageSource>
</packageSourceMapping>
<packageSourceCredentials>
<Feedz>
<add key="Username" value="TestUser" />
<add key="ClearTextPassword" value="T-jXeJSPLLjOdZvRZOQ5O2e1vrQwRI7uxC1U" />
</Feedz>
</packageSourceCredentials>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
```

- [ ] **Step 2: Remove the project-local config**

Delete `EstateManagementUI.BlazorServer/NuGet.Config` so the root config becomes the only active NuGet policy in the repo.

- [ ] **Step 3: Verify the root config is discoverable**

Run:

```powershell
dotnet restore EstateManagementUI.sln --configfile NuGet.Config
```

Expected: restore uses the root config and no longer warns about multiple sources without mapping.

### Task 2: Point Docker and CI at the root config

**Files:**
- Modify: `EstateManagementUI.BlazorServer/Dockerfile`
- Modify: `EstateManagementUI.BlazorServer/Dockerfile.original`
- Modify: `.github/workflows/pullrequest.yml`
- Modify: `.github/workflows/codecoverage.yml`
- Modify: `.github/workflows/nightlybuild.yml`
- Modify: `.github/workflows/createrelease.yml`

- [ ] **Step 1: Make Docker restore use the root config**

```dockerfile
COPY ["NuGet.Config", "."]
COPY ["EstateManagementUI.BlazorServer/Certificates/*.*", "Certificates/"]
COPY ["EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj", "EstateManagementUI.BlazorServer/"]
COPY ["Directory.Packages.props", "."]
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj" --configfile NuGet.Config
```

- [ ] **Step 2: Make CI restore use the same config**

Use the repository root config explicitly in every restore step:

```yaml
run: dotnet restore EstateManagementUI.sln --configfile NuGet.Config
```

Remove any `--source ...` arguments from those restore steps so they do not bypass the mapped source policy.

- [ ] **Step 3: Re-run publish/build commands with no extra restore**

Keep the existing `--no-restore` build steps, and add `--no-restore` to any `dotnet publish` step that follows a restore in the same job.

- [ ] **Step 4: Verify in CI syntax and locally**

Run:

```powershell
dotnet restore EstateManagementUI.sln --configfile NuGet.Config
dotnet build EstateManagementUI.sln --configuration Release --no-restore
```

Expected: restore completes with the mapped config, and build reuses the restored assets.
Loading