Skip to content

Fix Copilot setup workflow tool ordering#1032

Merged
BenjaminMichaelis merged 5 commits intomainfrom
copilot/fix-node-setup-for-agent
Apr 26, 2026
Merged

Fix Copilot setup workflow tool ordering#1032
BenjaminMichaelis merged 5 commits intomainfrom
copilot/fix-node-setup-for-agent

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

Summary

  • move Copilot environment setup steps ahead of restore/build/test so Node.js, Docker Buildx, and dotnet-ef are available before validation runs
  • keep Node 24 aligned with the frontend engine requirement before dotnet build triggers npm ci
  • make the dotnet-ef installation step idempotent and explicitly run under bash

Why

The failing Copilot agent run showed the setup workflow running dotnet build before actions/setup-node, and the Copilot setup docs state that if a setup step fails, the remaining setup steps are skipped. Because the web project runs npm ci during build and requires Node >=22, the agent could reach its task with Node setup skipped.

Validation

  • dotnet restore /p:AccessToNugetFeed=false
  • dotnet build --configuration Release --no-restore /p:AccessToNugetFeed=false
  • dotnet test --no-build --configuration Release (still has the pre-existing failures in CaptchaService_Verify_Success and KnownBreachedPassword_IsDetected)
  • python YAML parse of .github/workflows/copilot-setup-steps.yml
  • dotnet build /home/runner/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.csproj --configuration Release --no-restore /p:AccessToNugetFeed=false after removing EssentialCSharp.Web/node_modules
  • parallel_validation (Code Review + CodeQL security scan)

Copilot AI and others added 5 commits April 26, 2026 02:23
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>
Copilot AI requested a review from BenjaminMichaelis April 26, 2026 02:27
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review April 26, 2026 02:48
Copilot AI review requested due to automatic review settings April 26, 2026 02:48
@BenjaminMichaelis BenjaminMichaelis merged commit 7fe61d5 into main Apr 26, 2026
2 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/fix-node-setup-for-agent branch April 26, 2026 02:48
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

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-node ahead of restore/build/test to satisfy the frontend Node engine requirement during dotnet build.
  • Move docker/setup-buildx-action earlier in the workflow.
  • Make EF tooling setup idempotent (install vs update) and run it explicitly under bash.

Comment on lines +54 to +59
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
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

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