Skip to content

Enhance copilot-instructions.md with comprehensive repository onboarding and standard dotnet command usage - #11191

Merged
Ankit Jain (radical) merged 9 commits into
mainfrom
copilot/fix-7378e2df-39db-493f-9fae-f2145d18c821
Sep 3, 2025
Merged

Enhance copilot-instructions.md with comprehensive repository onboarding and standard dotnet command usage#11191
Ankit Jain (radical) merged 9 commits into
mainfrom
copilot/fix-7378e2df-39db-493f-9fae-f2145d18c821

Conversation

Copilot AI commented Aug 30, 2025

Copy link
Copy Markdown
Contributor

This PR significantly expands the .github/copilot-instructions.md file to provide comprehensive onboarding information for coding agents working on the Aspire repository for the first time, with updated guidance to use standard dotnet commands that leverage the global.json paths configuration.

Key Changes

Repository Overview

  • Added detailed description of the .NET Aspire framework and its purpose
  • Documented key components (Hosting, Dashboard, Service Discovery, 40+ Integrations, CLI Tools, Templates)
  • Outlined technology stack (.NET 10.0 RC, C# 13, xUnit SDK v3, Microsoft.Testing.Platform, Arcade SDK)

Updated Build and Test Instructions

  • Standard dotnet Usage: Updated all examples to use standard dotnet commands that automatically use the local SDK after restore due to global.json paths configuration
  • Build Workflow: Complete build process with timing estimates and optimization options
  • Warning Management: Added requirement to address all warnings before final commits
  • Prerequisites: Streamlined to focus on restore process, removed container runtime requirement as tests only run on Linux where Docker is pre-installed

Testing Infrastructure

  • Critical requirement: Always exclude quarantined tests with --filter-not-trait "quarantined=true"
  • Simplified Commands: All test examples now use standard dotnet commands for consistency
  • Validation: Sample app verification and targeted testing approaches

Project Architecture

  • Directory structure: Detailed layout of /src, /tests, /playground, /docs, /eng
  • Configuration files: Key files like global.json, .editorconfig, Directory.Build.props
  • CI/CD workflows: Description of test and build automation

The updated instructions leverage the global.json paths configuration that automatically uses the local SDK after restore, eliminating the need for wrapper scripts while maintaining SDK version consistency. All documented commands have been tested and verified to work with the current repository configuration.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…rding information

Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title [WIP] Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently. You wi... Enhance copilot-instructions.md with comprehensive repository onboarding information Aug 30, 2025
@radical

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@radical
Ankit Jain (radical) marked this pull request as ready for review August 30, 2025 08:51
Copilot AI review requested due to automatic review settings August 30, 2025 08:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 significantly enhances the .github/copilot-instructions.md file to provide comprehensive onboarding information for coding agents working on the Aspire repository. The enhancement transforms basic coding guidelines into a complete repository guide that includes repository overview, build prerequisites, testing infrastructure, and project architecture.

Key Changes

  • Added comprehensive repository overview covering Aspire framework components and technology stack
  • Enhanced build instructions with prerequisites, timing estimates, and troubleshooting guidance
  • Expanded testing section with critical quarantined test exclusion requirements and validation commands
  • Added detailed project architecture section covering directory structure, configuration files, and CI/CD workflows

Comment thread .github/copilot-instructions.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated

* Follow the instructions in the repo to build.
* If temporarily introducing warnings during a refactoring, you can add the flag `/p:TreatWarningsAsErrors=false` to your build command to prevent the build from failing. However before you finish your work, you must strive to fix any warnings as well.
**CRITICAL: Always use the local dotnet installation.** In building and testing, never use the global `dotnet` CLI. Use `./dotnet.sh` on Unix, `.\dotnet.cmd` on Windows.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In fact is it possible that we can get rid of dotnet.sh/dotnet.cmd? I find that it confuses the agents more than helps them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the instructions to reflect the current global.json configuration. Removed the strict requirement for dotnet.sh/dotnet.cmd and updated all examples to use standard dotnet commands, which will automatically use the local SDK when available after restore. This should reduce confusion for agents while maintaining the local SDK preference. (commit: updated)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot revert this change. We need to use the dotnet scripts to ensure that we are always using the expected versions, and they are installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted the changes as requested. The instructions now emphasize using ./dotnet.sh/./dotnet.cmd scripts instead of standard dotnet commands to ensure expected SDK versions are used. All test command examples have been updated accordingly. (commit: 4849130)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now that we have

aspire/global.json

Lines 6 to 9 in 7ef1702

"paths": [
".dotnet",
"$host$"
],
this isn't quite true.

Oh, I misunderstood this!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now that we have

aspire/global.json

Lines 6 to 9 in 7ef1702

"paths": [
".dotnet",
"$host$"
],
this isn't quite true.

Copilot Add back the change to the instructions to always use dotnet instead of the scripts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the instructions to use standard dotnet commands instead of the wrapper scripts. With the paths configuration in global.json, the standard dotnet command will automatically use the local SDK after restore. All test examples have been updated accordingly. (commit: 7f57f36)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there is still a scenario were this doesn't work, which is when the user already has the require SDK globally installed. In that case, our build scripts won't restore the sdk and instead just use the globally defined one, so paths in global.json won't work. These instructions I believe also get used for folks pulling the repo locally when using Copilot, so there could be cases where folks run into this. For this reason, I'd still suggest to continue having our dotnet.sh/cmd scripts which account for this case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree that we shouldn't drop the scripts as it would still be useful to have the it restore the necessary bits.

These instructions I believe also get used for folks pulling the repo locally when using Copilot, so there could be cases where folks run into this.

Can you elaborate on this one? Would you be able to try this out and see if it breaks because the copilot instructions here?

Comment thread .github/copilot-instructions.md
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title Enhance copilot-instructions.md with comprehensive repository onboarding information Enhance copilot-instructions.md with comprehensive repository onboarding and updated build guidance Sep 2, 2025
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title Enhance copilot-instructions.md with comprehensive repository onboarding and updated build guidance Enhance copilot-instructions.md with comprehensive repository onboarding and dotnet script usage guidance Sep 2, 2025
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title Enhance copilot-instructions.md with comprehensive repository onboarding and dotnet script usage guidance Enhance copilot-instructions.md with comprehensive repository onboarding and standard dotnet command usage Sep 2, 2025
Comment thread .github/copilot-instructions.md Outdated
**Always run restore first to set up the local SDK.** Run `./restore.sh` (Linux/macOS) or `./restore.cmd` (Windows) first to install the local SDK. After restore, you can use standard `dotnet` commands, which will automatically use the local SDK when available due to the paths configuration in global.json.

#### Prerequisites
1. **Container Runtime Required**: Install Docker Desktop or Podman before building/testing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Drop this. We only run the container based tests on Linux where Docker is already installed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot Drop this. We only run the container based tests on Linux where Docker is already installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the container runtime prerequisite and related references since container-based tests only run on Linux where Docker is already installed. (commit: 3dbdb00)

…on Linux where Docker is pre-installed

Co-authored-by: radical <1472+radical@users.noreply.github.com>
dotnet.sh test tests/Aspire.Hosting.Testing.Tests/Aspire.Hosting.Testing.Tests.csproj --logger "console;verbosity=detailed" -- --filter-method "TestingBuilderHasAllPropertiesFromRealBuilder"
(4) To run specific tests, include the filter after `--`:
```bash
dotnet test tests/Aspire.Hosting.Testing.Tests/Aspire.Hosting.Testing.Tests.csproj -- --filter-method "TestingBuilderHasAllPropertiesFromRealBuilder" --filter-not-trait "quarantined=true"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it clear enough that they should be using dotnet.sh from the root? there is a global dotnet installed on these machines (for MCP servers) -- they should not use that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIUC the assumption here is that we have at least dotnet 10.x installed which supports the paths in global.json, which should then pick up $repo/.dotnet/dotnet, and thus still be using the restored dotnet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does paths have a fallback for the globally installed dotnet in case it is already present? In that case, our build won't have it under the .dotnet folder so we should make sure that works.

@danmoseley Dan Moseley (danmoseley) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, philosophically it's funny that this is all applicable to human contributors (albeit Linux only). I wonder whether our contributing doc should mostly point to this. conversely, this doc could point to that. fine for now but I bet we'll end up doing one or the other.

@mitchdenny

Copy link
Copy Markdown
Member
// human-instructions.md
see: copilot-instructions.md :)

@radical
Ankit Jain (radical) merged commit 951d3fb into main Sep 3, 2025
584 of 589 checks passed
@radical
Ankit Jain (radical) deleted the copilot/fix-7378e2df-39db-493f-9fae-f2145d18c821 branch September 3, 2025 23:03
@dotnet-policy-service dotnet-policy-service Bot added this to the 9.5 milestone Sep 3, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants