-
Notifications
You must be signed in to change notification settings - Fork 5k
Create copilot-setup-steps.yml #115834
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
Create copilot-setup-steps.yml #115834
Conversation
Based on https://github.com/dotnet/aspire/blob/5c4f9f5b9faac3748b939bfd96bc9a72ce0f9c1e/.github/workflows/copilot-setup-steps.yml and https://github.com/dotnet/aspnetcore/blob/aebd07af9854541970d0c05d99dc2e6e8bd2fdd4/.github/workflows/copilot-setup-steps.yml Script args based on https://github.com/dotnet/runtime/blob/28e603e0a100dc83e3efc8a772e7798d712984f4/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml#L18
There was a problem hiding this 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 creates a new GitHub Actions workflow file for running Copilot setup steps. It defines a new job named "copilot-setup-steps" which checks out the repository code and then runs a build script to restore the solution.
- Added a new workflow file (.github/workflows/copilot-setup-steps.yml)
- Configured the job to run on ubuntu-latest with proper permissions and setup steps
Should we also add the relevant endpoints to the firewall allow list? |
We can, but if this makes that unnecessary, its nice to keep the network isolation? |
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Does it? I very frequently see builds trying to do partial restores even after I've done full builds. |
Then it will be necessary as well yeah. |
# You can define any steps you want, and they will run before the agent starts. | ||
# If you do not check out your code, Copilot will do this for you. | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this get updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we have other usages https://github.com/search?q=repo%3Adotnet%2Fruntime%20actions%2Fcheckout%40&type=code. Consider using a tag if that's better.
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Restore solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking aloud here - would it also help to set some things in the environment so that it would use the dotnet that it pulled down on the path? I'm not sure what sort of resources the agent will be using, but we should try to set it up for local-development as close as possible. How do we see / measure how good these steps are working for the agent? Can we see it try them and then see how successful it is at doing things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems to successfully know to go to the root of the repo and run 'build.sh' or whatever the onboarding instructions say.
But, if you add a .github\copilot-instructions.md you can be explicit about how it should do incremental subtree builds and how to run tests too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think putting dotnet
on the path and including some instructions for building individual projects, testing individual projects might be a good idea since I expect the agent is actually doing these things so giving it the quicker inner-loops like real devs use should make it more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's a good idea to add some specific instructions. I'll try it out in a separate PR.
@ericstj not sure whether you're aware based on this comment but by default the agent itself is completely firewalled. The idea is that this build step will pull things down so that subsequent builds succeed. They're talking about things like caching the built tree, etc eventually. Of course, you can also open the firewall selectively. |
Not that I know of. I don't think it's possible to include the default subsets and also include the libs tests and other test subsets without listing them explicitly. The subset infrastructure in runtime isn't great. It also became extremely complex over the years. FWIW I would probably add |
I see, that makes sense. I see that here https://docs.github.com/en/copilot/customizing-copilot/customizing-or-disabling-the-firewall-for-copilot-coding-agent. Seems like that should be mentioned in the main article since that seems to be the motivating factor behind adding these. |
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
/ba-g copilot infra-only change |
Good news: this setup actually helped with restore (at least for the libs). Bad news: it is insistent on using Maybe |
Yeah that should help. We might also want to put dotnet on the path so that it can directly build projects like that. I think that should make it more effective rather than doing a full build from the root every time. |
We should use the new global.json paths feature: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#paths. So that the resolution of the desired .NET SDK is handled by the host. It still needs to be acquired of course which is handled by the eng/common scripts and a globally installed one would need to be available. |
Based on https://github.com/dotnet/aspire/blob/5c4f9f5b9faac3748b939bfd96bc9a72ce0f9c1e/.github/workflows/copilot-setup-steps.yml and https://github.com/dotnet/aspnetcore/blob/aebd07af9854541970d0c05d99dc2e6e8bd2fdd4/.github/workflows/copilot-setup-steps.yml Script args based on https://github.com/dotnet/runtime/blob/28e603e0a100dc83e3efc8a772e7798d712984f4/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml#L18
Based on
copilot-setup-steps.yml
from dotnet/aspire and dotnet/aspnetcore.Script args based on
runtime/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
Line 18 in 28e603e
Expected to help with the Firewall warnings over
pkgs.dev.azure.com
on Copilot PRs (e.g. #115826)