Add SourceLink opt-out for sandbox builds - #820
Conversation
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
|
the msbuild should detect being in a sandbox. look for some env Variable that identify this env as a Sandbox. the PR as is it is useless as was already possible to pass EnableSourceLink=false in a -p: parameter on dotnet build. The task is to find a detection point. |
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Implemented automatic detection using the Copilot sandbox's |
There was a problem hiding this comment.
Pull request overview
Adds a build-time switch intended to disable SourceLink in Copilot sandbox environments where repository metadata is unavailable, to avoid build failures while keeping SourceLink enabled by default.
Changes:
- Introduces a
SourceLinkproperty group in repo and sampleDirectory.Build.propsfiles. - Disables
EnableSourceLinkandEnableSourceControlManagerQueriesunder a sandbox-detection condition.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Directory.Build.props | Adds conditional disabling of SourceLink/SCM queries for sandbox-like environments. |
| samples/Ark.ResourceWatcher/Directory.Build.props | Mirrors the conditional SourceLink/SCM query disabling in this sample. |
| samples/Ark.ReferenceProject/Directory.Build.props | Mirrors the conditional SourceLink/SCM query disabling in this sample. |
| samples/Ark.MediatorFramework.Sample/Directory.Build.props | Mirrors the conditional SourceLink/SCM query disabling in this sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Builds in Copilot sandboxes can fail when SourceLink cannot access repository metadata. This adds an opt-in environment switch for those environments while preserving default SourceLink behavior.
ARK_DISABLE_SOURCELINK=truehandling to repository and sampleDirectory.Build.propsfiles.EnableSourceLinkandEnableSourceControlManagerQuerieswhen enabled.