Skip to content

Add local dotnet tool manifest for EF and trx-to-vsplaylist and validate EF migrations in CI#1017

Merged
BenjaminMichaelis merged 2 commits intomainfrom
copilot/add-local-tool-manifests
Apr 25, 2026
Merged

Add local dotnet tool manifest for EF and trx-to-vsplaylist and validate EF migrations in CI#1017
BenjaminMichaelis merged 2 commits intomainfrom
copilot/add-local-tool-manifests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

Summary

  • add .config/dotnet-tools.json to pin repository-local versions of dotnet-ef and trx-to-vsplaylist
  • use the latest non-prerelease versions available on NuGet at update time
  • make the tools restorable via dotnet tool restore without requiring global installs
  • update the PR build workflow to run dotnet tool restore before EF tooling is used
  • add dotnet ef migrations has-pending-model-changes to the PR CI pipeline so migration drift fails validation

Validation

  • dotnet tool restore
  • dotnet tool run dotnet-ef --version
  • dotnet tool run trx-to-vsplaylist --help
  • dotnet build EssentialCSharp.Web.slnx --configuration Release
  • ASPNETCORE_ENVIRONMENT=Development dotnet ef migrations has-pending-model-changes --project EssentialCSharp.Web --configuration Release --no-build
  • dotnet test --solution EssentialCSharp.Web.slnx --configuration Release --no-build (fails with the same pre-existing integration test failures: CaptchaService_Verify_Success and KnownBreachedPassword_IsDetected)

Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/9b04f6f3-5e68-4c08-af16-34313a9169d1

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
@BenjaminMichaelis
Copy link
Copy Markdown
Member

@copilot can we add dotnet ef migrations has-pending-model-changes to our ci pipeline and a dotnet tool restore before then to get the ef tooling in?

Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/3732bf6c-e6ba-4e30-a7e4-83933137a7fc

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 25, 2026

@copilot can we add dotnet ef migrations has-pending-model-changes to our ci pipeline and a dotnet tool restore before then to get the ef tooling in?

Implemented in 3886338. The PR workflow now runs dotnet tool restore after package restore, then executes dotnet ef migrations has-pending-model-changes --project EssentialCSharp.Web --configuration Release --no-build with ASPNETCORE_ENVIRONMENT=Development so migration drift is checked in CI.

Copilot AI changed the title Add local dotnet tool manifest for EF and trx-to-vsplaylist Add local dotnet tool manifest for EF and trx-to-vsplaylist and validate EF migrations in CI Apr 25, 2026
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review April 25, 2026 17:39
Copilot AI review requested due to automatic review settings April 25, 2026 17:39
@BenjaminMichaelis BenjaminMichaelis merged commit 0f260fd into main Apr 25, 2026
7 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/add-local-tool-manifests branch April 25, 2026 17:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-local .NET tool manifest and updates PR CI to restore those tools and enforce EF Core migration drift checks.

Changes:

  • Add .config/dotnet-tools.json to pin local versions of dotnet-ef and trx-to-vsplaylist.
  • Update PR workflow to dotnet tool restore before build steps that rely on tooling.
  • Add dotnet ef migrations has-pending-model-changes to fail CI when migrations drift from the current model.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/PR-Build-And-Test.yml Restores local tools and adds an EF Core pending-model-changes validation step in PR CI.
.config/dotnet-tools.json Introduces a local tool manifest pinning dotnet-ef and trx-to-vsplaylist.

run: dotnet build --configuration Release --no-restore /p:AccessToNugetFeed=false

- name: Check for pending EF Core model changes
run: dotnet ef migrations has-pending-model-changes --project EssentialCSharp.Web --configuration Release --no-build
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

dotnet tool restore installs dotnet-ef as a local tool, but this step calls dotnet ef ..., which typically relies on dotnet-ef being discoverable as a CLI extension on PATH (often via a global tool install). To ensure CI uses the restored local tool and doesn’t depend on runner/global state, invoke it via dotnet tool run dotnet-ef -- migrations has-pending-model-changes ... (or otherwise ensure the local tool is on PATH).

Suggested change
run: dotnet ef migrations has-pending-model-changes --project EssentialCSharp.Web --configuration Release --no-build
run: dotnet tool run dotnet-ef -- migrations has-pending-model-changes --project EssentialCSharp.Web --configuration Release --no-build

Copilot uses AI. Check for mistakes.
Comment thread .config/dotnet-tools.json
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.7",
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

The manifest pins dotnet-ef to 10.0.7, but the web project references Microsoft.EntityFrameworkCore.Tools 10.0.6 (see Directory.Packages.props). EF tooling is sensitive to version mismatches; consider aligning these versions (either bump the package to 10.0.7 or pin the tool to 10.0.6) to avoid CLI/runtime incompatibilities.

Suggested change
"version": "10.0.7",
"version": "10.0.6",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants