Skip to content

Add dotnet to the path for copilot agent #115912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2025
Merged

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented May 22, 2025

Putting .dotnet folder on the path to give copilot agent better chance at having basic commands just work. Much of our product supports dotnet build on individual project thanks to @ViktorHofer's work, and these commands will always work for iterating on projects. I chatted with @CarnaViire and she'll cover other steps in the doc.

I'm not entirely sure if this is the right way to make a persistent env variable for the copilot agent to use. Couldn't find mention in the docs. Figure we can try it and see!

@ericstj ericstj requested review from jeffhandley and a team as code owners May 22, 2025 18:57
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 22, 2025
Copy link
Contributor

@Copilot 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

This PR aims to ensure the local .dotnet SDK folder is available on the PATH so Copilot agent commands like dotnet build work out of the box.

  • Introduce a new GitHub Actions step to prepend .dotnet to PATH.
  • Place this step right after restoring the solution.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ericstj ericstj added area-Infrastructure and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 22, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@ericstj
Copy link
Member Author

ericstj commented May 22, 2025

/ba-g build will not run on workflow yml

@ericstj
Copy link
Member Author

ericstj commented May 22, 2025

@ericstj
Copy link
Member Author

ericstj commented May 22, 2025

Ok, I had to make one other change, but that is working now: https://github.com/dotnet/runtime/actions/runs/15198557123/job/42748196524

@ericstj
Copy link
Member Author

ericstj commented May 22, 2025

Can I get a review here? I think this should be a notable improvement. We can iterate more as we decide what we want to put in this workflow vs allow copilot to figure out on its own.

@ericstj
Copy link
Member Author

ericstj commented May 22, 2025

/ba-g build analysis doesn't validate workflows

@@ -17,5 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v4.2.2

- name: Install dependencies
run: sudo ./eng/common/native/install-dependencies.sh
Copy link
Member

Choose a reason for hiding this comment

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

jfyi I'm not sure this script is enough; the helix docker images install a lot more https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/ubuntu/25.04/helix/Dockerfile

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO if we are missing anything we need for local dev we should improve the script that we tell contributors to run rather than duplicate a bunch of custom logic with dubious origin that's accumulated over time. I see a lot of things in that dockerfile that look specific to helix.

If we need steps that a specific to local testing of runtime, let's create a common script that we put in eng and update the contribution docs to mention it. Those can create single runtime script that invokes the common arcade provided one.

I think we should do that as problems arise so that we keep a minimal accurate set of contribution pre-requisites that's documented.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yet another place we describe these is here https://github.com/dotnet/runtime/tree/main/.devcontainer which I think drives the codespaces feature. @ellismg -- any idea if we can dedup these steps with copilot agent?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tracking improvements as part of #115946 will merge this so we can continue experimenting.

Copy link
Member

@CarnaViire CarnaViire left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ericstj ericstj merged commit 2f62903 into dotnet:main May 23, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants