From c618c19e5a2dd8ceb3d98db1240c2b269bb0c7e4 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Thu, 25 Jun 2026 18:40:49 +0100 Subject: [PATCH 1/2] package mapping :| --- EstateManagementUI.BlazorServer/Dockerfile | 2 +- .../Dockerfile.original | 2 +- EstateManagementUI.BlazorServer/NuGet.Config | 24 ------- NuGet.Config | 68 +++++++++++++++++++ 4 files changed, 70 insertions(+), 26 deletions(-) delete mode 100644 EstateManagementUI.BlazorServer/NuGet.Config create mode 100644 NuGet.Config diff --git a/EstateManagementUI.BlazorServer/Dockerfile b/EstateManagementUI.BlazorServer/Dockerfile index 4b6de0eb..00f57546 100644 --- a/EstateManagementUI.BlazorServer/Dockerfile +++ b/EstateManagementUI.BlazorServer/Dockerfile @@ -10,7 +10,7 @@ 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", "."] diff --git a/EstateManagementUI.BlazorServer/Dockerfile.original b/EstateManagementUI.BlazorServer/Dockerfile.original index 993d3bb2..79c3804d 100644 --- a/EstateManagementUI.BlazorServer/Dockerfile.original +++ b/EstateManagementUI.BlazorServer/Dockerfile.original @@ -10,7 +10,7 @@ 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" diff --git a/EstateManagementUI.BlazorServer/NuGet.Config b/EstateManagementUI.BlazorServer/NuGet.Config deleted file mode 100644 index 3086e202..00000000 --- a/EstateManagementUI.BlazorServer/NuGet.Config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 00000000..922d776c --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f4bcdb6b86ed25805a63ddf9626ffc4a12c396ab Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Thu, 25 Jun 2026 18:57:13 +0100 Subject: [PATCH 2/2] :| --- .github/workflows/codecoverage.yml | 2 +- .github/workflows/createrelease.yml | 6 +- .github/workflows/nightlybuild.yml | 2 +- .github/workflows/pullrequest.yml | 4 +- EstateManagementUI.BlazorServer/Dockerfile | 2 +- .../Dockerfile.original | 2 +- .../plans/2026-06-25-nuget-source-mapping.md | 149 ++++++++++++++++++ 7 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 docs/superpowers/plans/2026-06-25-nuget-source-mapping.md diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 736d7475..d0963441 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -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 diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml index 039e7f1a..2d44cfd1 100644 --- a/.github/workflows/createrelease.yml +++ b/.github/workflows/createrelease.yml @@ -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 @@ -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 }} @@ -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 \ No newline at end of file + Start-Service -Name $serviceName diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml index 82e2f37e..5e90274d 100644 --- a/.github/workflows/nightlybuild.yml +++ b/.github/workflows/nightlybuild.yml @@ -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: | diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 165dab88..71ccb3dc 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -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 @@ -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 diff --git a/EstateManagementUI.BlazorServer/Dockerfile b/EstateManagementUI.BlazorServer/Dockerfile index 00f57546..bf72f558 100644 --- a/EstateManagementUI.BlazorServer/Dockerfile +++ b/EstateManagementUI.BlazorServer/Dockerfile @@ -14,7 +14,7 @@ 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" diff --git a/EstateManagementUI.BlazorServer/Dockerfile.original b/EstateManagementUI.BlazorServer/Dockerfile.original index 79c3804d..33f9fc2d 100644 --- a/EstateManagementUI.BlazorServer/Dockerfile.original +++ b/EstateManagementUI.BlazorServer/Dockerfile.original @@ -13,7 +13,7 @@ RUN curl -fsSL --insecure https://deb.nodesource.com/setup_20.x | bash - && \ 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" diff --git a/docs/superpowers/plans/2026-06-25-nuget-source-mapping.md b/docs/superpowers/plans/2026-06-25-nuget-source-mapping.md new file mode 100644 index 00000000..2b429dc0 --- /dev/null +++ b/docs/superpowers/plans/2026-06-25-nuget-source-mapping.md @@ -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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +- [ ] **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.