Skip to content

Commit 09bec45

Browse files
committed
Merge branch 'dev' into 14390-fbp-2
2 parents 68fc9e7 + d2887cd commit 09bec45

87 files changed

Lines changed: 2344 additions & 3680 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gdn/.gdnsuppress

Lines changed: 0 additions & 35 deletions
This file was deleted.

.vsconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"Microsoft.VisualStudio.Component.IntelliCode",
2323
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
2424
"Microsoft.VisualStudio.Workload.ManagedDesktop",
25-
"Microsoft.Net.Component.4.6.TargetingPack",
2625
"Microsoft.VisualStudio.Component.VSSDK",
2726
"Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites",
2827
"Microsoft.VisualStudio.Workload.VisualStudioExtension",

build/config.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525
<IsEscrowMode Condition="'$(IsEscrowMode)' == ''">false</IsEscrowMode>
2626

2727
<!-- Visual Studio Insertion Logic -->
28-
<VsTargetMajorVersion Condition="'$(VsTargetMajorVersion)' == ''">$([MSBuild]::Add(11, $(MajorNuGetVersion)))</VsTargetMajorVersion>
2928
<VsTargetBranch Condition="'$(VsTargetBranch)' == '' And '$(IsEscrowMode)' != 'true'">main</VsTargetBranch>
30-
<VsTargetChannel Condition="'$(VsTargetChannel)' == '' And '$(IsEscrowMode)' != 'true'">int.$(VsTargetBranch)</VsTargetChannel>
31-
<VsTargetChannelForTests Condition="'$(VsTargetChannelForTests)' == '' And '$(IsEscrowMode)' != 'true'">int.$(VsTargetBranch)</VsTargetChannelForTests>
29+
<VsTargetChannel Condition="'$(VsTargetChannel)' == '' And '$(IsEscrowMode)' != 'true'">int.main</VsTargetChannel>
3230

3331
<!-- NuGet SDK VS package Semantic Version -->
32+
<VsTargetMajorVersion Condition="'$(VsTargetMajorVersion)' == ''">$([MSBuild]::Add(11, $(MajorNuGetVersion)))</VsTargetMajorVersion>
3433
<NuGetSdkVsSemanticVersion>$(VsTargetMajorVersion).$(MinorNuGetVersion).$(PatchNuGetVersion)</NuGetSdkVsSemanticVersion>
3534

36-
<!-- This branches are used for creating insertion PRs -->
37-
<VsTargetBranch Condition="'$(VsTargetBranch)' == '' And '$(IsEscrowMode)' == 'true'">rel/d$(VsTargetMajorVersion).$(MinorNuGetVersion)</VsTargetBranch>
38-
<VsTargetChannel Condition="'$(VsTargetChannel)' == '' And '$(IsEscrowMode)' == 'true'">int.d$(VsTargetMajorVersion).$(MinorNuGetVersion)</VsTargetChannel>
39-
<!-- Run Apex/E2E tests on the target release branch -->
40-
<VsTargetChannelForTests Condition="'$(VsTargetChannelForTests)' == '' And '$(IsEscrowMode)' == 'true'">$(VsTargetChannel)</VsTargetChannelForTests>
35+
<!-- These branches are used for creating insertion PRs -->
36+
<VsTargetBranch Condition="'$(VsTargetBranch)' == '' And '$(IsEscrowMode)' == 'true'">rel/insiders</VsTargetBranch>
37+
<VsTargetChannel Condition="'$(VsTargetChannel)' == '' And '$(IsEscrowMode)' == 'true'">insiders</VsTargetChannel>
38+
39+
<!-- Run Apex/E2E tests on the target branch -->
40+
<VsTargetChannelForTests Condition="'$(VsTargetChannelForTests)' == ''">$(VsTargetChannel)</VsTargetChannelForTests>
4141
</PropertyGroup>
4242

4343
<PropertyGroup Condition=" '$(PreReleaseVersion)' == '' ">

eng/pipelines/official.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ extends:
3939
enabled: true
4040
credscan:
4141
enabled: false
42-
suppression:
43-
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
4442
pool:
4543
name: AzurePipelines-EO
4644
image: 1ESPT-Windows2022
@@ -53,7 +51,6 @@ extends:
5351
- template: /eng/pipelines/templates/pipeline.yml@self
5452
parameters:
5553
isOfficialBuild: true
56-
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], format('refs/heads/{0}', variables['OneLocReleaseBranch']))) }}:
57-
RunOneLocBuild: true
5854
RunBuildForPublishing: ${{parameters.RunBuildForPublishing}}
5955
SigningType: ${{ parameters.SigningType }}
56+
TryRunOneLocBuild: true

eng/pipelines/optprof.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ resources:
1010
branches:
1111
include:
1212
- dev
13-
- release-*
14-
- release/*
15-
exclude:
16-
- release-6.0.x
17-
- release-6.3.x
18-
- release-6.2.x
13+
- release-6.14.x
14+
- release-6.12.x
15+
- release-5.11.x
1916
- pipeline: DartLab
2017
source: DartLab
2118
branch: main
@@ -111,11 +108,11 @@ stages:
111108
112109
Write-Host "Target Visual Studio branch (full name): $VSBranch"
113110
114-
# The value will be something like 'main' or 'rel/d16.4';
111+
# The value will be something like 'main' or 'rel/insiders';
115112
# however, the subsequent task which gets bootstrapper details has a parameter (VSBranch)
116113
# which (as of writing this) requires the branch "short" name.
117114
# For the 'main' branch, the short name is still 'main'.
118-
# For the 'rel/d16.4' branch, the short name is 'd16.4'.
115+
# For the 'rel/insiders' branch, the short name is 'insiders'.
119116
# Ideally, we would not need to figure out the branch short name ourselves,
120117
# but short-term we will to unblock ourselves.
121118
$branchParts = $VSBranch.Split('/')

eng/pipelines/pull_request.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ extends:
3636
enabled: true
3737
credscan:
3838
enabled: false
39-
suppression:
40-
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
4139
pool:
4240
name: AzurePipelines-EO
4341
image: 1ESPT-Windows2022

eng/pipelines/templates/pipeline.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ parameters:
22
- name: isOfficialBuild
33
type: boolean
44
default: false
5-
- name: RunOneLocBuild
6-
displayName: Run OneLocBuild
5+
- name: TryRunOneLocBuild
6+
displayName: Run OneLocBuild if on dev or a OneLoc release branch
77
type: boolean
88
default: false
99
- name: RunBuildForPublishing
@@ -43,9 +43,19 @@ stages:
4343
steps:
4444
- template: /eng/pipelines/templates/Initialize_Build.yml@self
4545

46-
- ${{ if eq(parameters.RunOneLocBuild, true) }}:
46+
- ${{ if eq(parameters.TryRunOneLocBuild, true) }}:
4747
- stage: RunOneLocBuild
4848
displayName: Run OneLocBuild
49+
condition: |
50+
and(
51+
succeeded(),
52+
eq(variables['IsOfficialBuild'], 'true'),
53+
or(
54+
eq(variables['Build.SourceBranch'], 'refs/heads/dev'),
55+
eq(variables['Build.SourceBranch'], variables['OneLocReleaseBranch']),
56+
eq(variables['Build.SourceBranch'], format('refs/heads/{0}', variables['OneLocReleaseBranch']))
57+
)
58+
)
4959
jobs:
5060
- template: /eng/common/templates-official/job/onelocbuild.yml
5161
parameters:

src/NuGet.Clients/NuGet.CommandLine/ExtensionLocator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private static IEnumerable<string> FindAll(
112112
// and among other things breaks our build.
113113
// Consequently, we'll use a convention - only binaries ending in the name Extensions would be loaded.
114114
var nugetDirectory = Path.GetDirectoryName(typeof(Program).Assembly.Location);
115-
if (nugetDirectory == null)
115+
if (string.IsNullOrEmpty(nugetDirectory))
116116
{
117117
return paths;
118118
}

src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/Telemetry/FixVulnerabilitiesWithCopilotErrorType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public enum FixVulnerabilitiesWithCopilotErrorType
1010
ServiceBrokerNotAvailable,
1111
CopilotServiceNotAvailable,
1212
McpToolServiceNotAvailable,
13-
CopilotAccessDenied
13+
CopilotAccessDenied,
14+
NuGetSolverNotAvailable,
1415
}
1516
}

src/NuGet.Clients/NuGet.Tools/FixVulnerablitiesService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.ComponentModel.Composition;
9+
using System.Linq;
910
using System.Threading;
1011
using System.Threading.Tasks;
1112
using Microsoft.ServiceHub.Framework;
@@ -26,6 +27,8 @@ internal class FixVulnerablitiesService : IFixVulnerabilitiesService
2627
private const string AgentModeResponderServiceMoniker = "Microsoft.VisualStudio.Copilot.AgentModeResponder";
2728
private const string AuthStatusDetermined = "c936efcc-6baa-4ad3-9c2b-7ba750acf18f";
2829
private const string ServiceName = "Microsoft.VisualStudio.Copilot.SolutionContextProvider";
30+
private const string NuGetMCPServerName = "nuget";
31+
private const string NuGetSolverToolName = "get-nuget-solver";
2932

3033
private static readonly Guid CopilotReadyUIContext = new(AuthStatusDetermined);
3134
private static readonly ServiceRpcDescriptor ProviderDescriptor = CopilotDescriptors.CreateContextProviderDescriptor(ServiceName);
@@ -99,6 +102,13 @@ public async Task LaunchFixVulnerabilitiesAsync(CancellationToken cancellationTo
99102
string solutionPathContext = $"The current solution file path is: {GetSolutionPath()}.";
100103
CopilotContext context = new CopilotContext(ProviderDescriptor.Moniker, ContextDescriptor, request.CorrelationId, solutionPathContext);
101104
IReadOnlyList<CopilotFunctionDescriptor> functions = await cfp.GetFunctionsAsync(request.CorrelationId, cancellationToken);
105+
if (functions is null || !functions.Any(f => string.Equals(f.Name, $"{NuGetMCPServerName}_{NuGetSolverToolName}", StringComparison.OrdinalIgnoreCase)))
106+
{
107+
SendTelemetryEvent(FixVulnerabilitiesWithCopilotErrorType.NuGetSolverNotAvailable);
108+
ShowWarningMessage(Resources.Error_NuGetSolverNotAvailable);
109+
return;
110+
}
111+
102112
CopilotRequest requestWithFunctionsAndContext = request.WithFunctions(functions).WithContext(context);
103113

104114
try

0 commit comments

Comments
 (0)