Skip to content

Fix FBA restore mismatch issue - #85204

Merged
jjonescz merged 3 commits into
dotnet:mainfrom
jjonescz:sprint-reuse-artifacts-net10-2
Sep 9, 2026
Merged

Fix FBA restore mismatch issue#85204
jjonescz merged 3 commits into
dotnet:mainfrom
jjonescz:sprint-reuse-artifacts-net10-2

Conversation

@jjonescz

@jjonescz jjonescz commented Sep 8, 2026

Copy link
Copy Markdown
Member

Adds a test for the issue discovered in dotnet/vscode-csharp#9734 (comment).
And brings in dotnet/sdk#56160 to fix it.

The previous attempt to support legacy artifacts path didn't work when the user sets ArtifactsPath explicitly. This better fix should work in all cases, except in preview versions between dotnet/sdk#55697 and dotnet/sdk#56160 (everything should mostly work fine, it's just that artifacts might end up in wrong places, or IDE might not detect FBA restore correctly - but it's really limited to just .NET 11.rc1, I think).

Microsoft Reviewers: Open in CodeFlow

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🔵 Needs a closer look

The implementation depends on a draft SDK change with failing CI, while Roslyn validation remains incomplete.

Pull request overview

Fixes file-based app package restore mismatches when ArtifactsPath is explicitly configured.

Changes:

  • Detects SDK support using _SupportsFileBasedAppArtifactsPath.
  • Adds an LSP restore/reload regression test.
  • Updates the synchronized SDK commit.

Assessment: The approach is sound, but one stale compatibility comment remains. The paired SDK PR is draft with failing CI, and Roslyn CI is incomplete.

File summaries
File Description
VirtualProjectBuilder.cs Uses the SDK capability flag for artifact-path compatibility.
commitid.txt Updates the synchronized SDK revision.
FileBasedProgramsWorkspaceTests.cs Tests restore with an explicit artifacts path.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@jjonescz
jjonescz force-pushed the sprint-reuse-artifacts-net10-2 branch from 9c2bd4b to 46d68a7 Compare September 8, 2026 15:00
@jjonescz
jjonescz marked this pull request as ready for review September 8, 2026 15:00
@jjonescz
jjonescz requested a review from a team as a code owner September 8, 2026 15:00
Copilot AI review requested due to automatic review settings September 8, 2026 15:00
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🔵 Needs a closer look

The cross-repository SDK contract and Roslyn/SDK validation pipelines are still pending.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

},
],
});
await Task.Delay(100);

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.

this seems like it could cause flakiness - we should likely have an explicit condition we're expecting

@RikkiGibson RikkiGibson Sep 9, 2026

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.

There are other tests in this file which explicitly create a watcher and await the watch event. We should use that.

We might have some lingering usage of await Task.Delay(100) which ideally should be replaced with this also.

If possible, it would be great to extract a test helper, which takes a file path and returns a task that awaits a watch event for the file.

@RikkiGibson RikkiGibson left a comment

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.

LGTM modulo the test feedback

Copilot AI review requested due to automatic review settings September 9, 2026 11:02

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.

🔵 Needs a closer look

The new SDK-dependent regression test currently resolves an ambient SDK instead of the repository-pinned SDK.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer.UnitTests/MiscellaneousFiles/FileBasedProgramsWorkspaceTests.cs:114

  • This is the only file-based-program test in this class that bypasses CreateTempDirectoryWithGlobalJson; the other FBA tests pin the repository SDK (for example, line 36). Because this regression specifically depends on SDK artifact-path capabilities, resolving an ambient installed SDK can exercise a different compatibility branch or fail on machines with a different SDK set. Use the existing helper so the test is deterministic.
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@jjonescz
jjonescz merged commit 221af6c into dotnet:main Sep 9, 2026
23 checks passed
@jjonescz
jjonescz deleted the sprint-reuse-artifacts-net10-2 branch September 9, 2026 18:17
@dotnet-policy-service dotnet-policy-service Bot added this to the Next milestone Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Feature - Run File #: and #! directives and file-based C# programs VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants