Fix Copilot setup workflow tool ordering#1032
Conversation
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/d6590875-922c-45ea-9f77-48dbe7ac66c5 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/d6590875-922c-45ea-9f77-48dbe7ac66c5 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/d6590875-922c-45ea-9f77-48dbe7ac66c5 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/d6590875-922c-45ea-9f77-48dbe7ac66c5 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/d6590875-922c-45ea-9f77-48dbe7ac66c5 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Reorders the Copilot agent environment setup workflow so prerequisite tooling (Node.js, Docker Buildx, EF tools) is available before restore/build/test, preventing builds that implicitly run npm ci from failing due to missing Node.
Changes:
- Move
actions/setup-nodeahead of restore/build/test to satisfy the frontend Node engine requirement duringdotnet build. - Move
docker/setup-buildx-actionearlier in the workflow. - Make EF tooling setup idempotent (install vs update) and run it explicitly under
bash.
| echo "Installing additional tools for Copilot agent environment..." | ||
| if dotnet tool list --global | grep -q 'dotnet-ef'; then | ||
| dotnet tool update --global dotnet-ef | ||
| else | ||
| dotnet tool install --global dotnet-ef | ||
| fi |
There was a problem hiding this comment.
The workflow already pins dotnet-ef via the local tool manifest (.config/dotnet-tools.json), but this step installs/updates a global dotnet-ef to whatever the latest version is at runtime. That can introduce non-deterministic builds and version mismatches vs the repo’s pinned EF tooling (e.g., 10.0.7). Prefer running dotnet tool restore and using the restored tool (or install/update the global tool to the manifest’s pinned version) instead of updating to latest.
| echo "Installing additional tools for Copilot agent environment..." | |
| if dotnet tool list --global | grep -q 'dotnet-ef'; then | |
| dotnet tool update --global dotnet-ef | |
| else | |
| dotnet tool install --global dotnet-ef | |
| fi | |
| echo "Restoring local .NET tools for Copilot agent environment..." | |
| dotnet tool restore |
Summary
dotnet buildtriggersnpm ciWhy
The failing Copilot agent run showed the setup workflow running
dotnet buildbeforeactions/setup-node, and the Copilot setup docs state that if a setup step fails, the remaining setup steps are skipped. Because the web project runsnpm ciduring build and requires Node >=22, the agent could reach its task with Node setup skipped.Validation
dotnet restore /p:AccessToNugetFeed=falsedotnet build --configuration Release --no-restore /p:AccessToNugetFeed=falsedotnet test --no-build --configuration Release(still has the pre-existing failures inCaptchaService_Verify_SuccessandKnownBreachedPassword_IsDetected)pythonYAML parse of.github/workflows/copilot-setup-steps.ymldotnet build /home/runner/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.csproj --configuration Release --no-restore /p:AccessToNugetFeed=falseafter removingEssentialCSharp.Web/node_modulesparallel_validation(Code Review + CodeQL security scan)