Skip to content

Commit 061104f

Browse files
Merge branch 'main' into 1104_add-option-to-ignore-response-types
2 parents 75194bb + 8e2b86e commit 061104f

File tree

87 files changed

+3164
-69
lines changed

Some content is hidden

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

87 files changed

+3164
-69
lines changed

DevProxy.Abstractions/DevProxy.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<RootNamespace>DevProxy.Abstractions</RootNamespace>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
<Version>0.29.0</Version>
8+
<Version>0.29.2</Version>
99
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
1010
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1111
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

DevProxy.Abstractions/LanguageModel/BaseLanguageModelClient.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public abstract class BaseLanguageModelClient(ILogger logger) : ILanguageModelCl
2424
_logger.LogDebug("Prompt file name '{PromptFileName}' does not end with '.prompty'. Appending the extension.", promptFileName);
2525
promptFileName += ".prompty";
2626
}
27-
var (messages, options) = _promptCache.GetOrAdd(promptFileName, _ =>
27+
28+
var cacheKey = GetPromptCacheKey(promptFileName, parameters);
29+
var (messages, options) = _promptCache.GetOrAdd(cacheKey, _ =>
2830
LoadPrompt(promptFileName, parameters));
2931

3032
if (messages is null || !messages.Any())
@@ -81,4 +83,10 @@ public abstract class BaseLanguageModelClient(ILogger logger) : ILanguageModelCl
8183

8284
return (messages, options);
8385
}
86+
87+
private static string GetPromptCacheKey(string promptFileName, Dictionary<string, object> parameters)
88+
{
89+
var parametersString = string.Join(";", parameters.Select(kvp => $"{kvp.Key}={kvp.Value}"));
90+
return $"{promptFileName}:{parametersString}";
91+
}
8492
}

DevProxy.Plugins/DevProxy.Plugins.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
<EnableDynamicLoading>true</EnableDynamicLoading>
88
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
9-
<Version>0.29.0</Version>
9+
<Version>0.29.2</Version>
1010
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
1111
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1212
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

DevProxy.Plugins/Inspection/DevToolsPlugin.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@ public override async Task AfterRequestLogAsync(RequestLogArgs e)
213213
return;
214214
}
215215

216-
var methodAndUrl = e.RequestLog.Message.Split(' ');
217-
if (!ProxyUtils.MatchesUrlToWatch(UrlsToWatch, methodAndUrl[1]))
218-
{
219-
Logger.LogRequest("URL not matched", MessageType.Skipped);
220-
return;
221-
}
222-
223216
var message = new EntryAddedMessage
224217
{
225218
Params = new()

DevProxy.Plugins/Mocking/MockResponsePlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public sealed class MockResponseConfiguration
3535
[JsonIgnore]
3636
public bool NoMocks { get; set; }
3737
[JsonPropertyName("$schema")]
38-
public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/mockresponseplugin.mocksfile.schema.json";
38+
public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/mockresponseplugin.mocksfile.schema.json";
3939
}
4040

4141
public class MockResponsePlugin(

DevProxy/DevProxy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Nullable>enable</Nullable>
99
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1010
<Title>Dev Proxy</Title>
11-
<Version>0.29.0</Version>
11+
<Version>0.29.2</Version>
1212
<Company>.NET Foundation</Company>
1313
<Product>Dev Proxy</Product>
1414
<AssemblyName>devproxy</AssemblyName>

DevProxy/Plugins/PluginServiceExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public static IServiceCollection AddPlugins(
5454
pluginReferences.Add(new()
5555
{
5656
Name = "UrlDiscoveryPlugin",
57-
PluginPath = "~appFolder/plugins/dev-proxy-plugins.dll"
57+
PluginPath = "~appFolder/plugins/DevProxy.Plugins.dll"
5858
});
5959
pluginReferences.Add(new()
6060
{
6161
Name = "PlainTextReporter",
62-
PluginPath = "~appFolder/plugins/dev-proxy-plugins.dll"
62+
PluginPath = "~appFolder/plugins/DevProxy.Plugins.dll"
6363
});
6464

6565
globallyWatchedUrls.Clear();

DevProxy/config/m365-mocks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/mockresponseplugin.mocksfile.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/mockresponseplugin.mocksfile.schema.json",
33
"mocks": [
44
{
55
"request": {

DevProxy/config/m365.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/rc.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/rc.schema.json",
33
"plugins": [
44
{
55
"name": "DevToolsPlugin",
66
"enabled": false,
7-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
7+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
88
"configSection": "devTools"
99
},
1010
{
1111
"name": "LatencyPlugin",
1212
"enabled": false,
13-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
13+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
1414
"configSection": "latencyPlugin"
1515
},
1616
{
1717
"name": "RetryAfterPlugin",
1818
"enabled": true,
19-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
19+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
2020
},
2121
{
2222
"name": "GraphSelectGuidancePlugin",
2323
"enabled": true,
24-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
24+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
2525
"urlsToWatch": [
2626
"https://graph.microsoft.com/v1.0/*",
2727
"https://graph.microsoft.com/beta/*",
@@ -36,7 +36,7 @@
3636
{
3737
"name": "ODSPSearchGuidancePlugin",
3838
"enabled": true,
39-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
39+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
4040
"urlsToWatch": [
4141
"https://graph.microsoft.com/v1.0/*",
4242
"https://graph.microsoft.com/beta/*",
@@ -51,7 +51,7 @@
5151
{
5252
"name": "GraphBetaSupportGuidancePlugin",
5353
"enabled": true,
54-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
54+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
5555
"urlsToWatch": [
5656
"https://graph.microsoft.com/beta/*",
5757
"https://graph.microsoft.us/beta/*",
@@ -62,7 +62,7 @@
6262
{
6363
"name": "GraphConnectorGuidancePlugin",
6464
"enabled": true,
65-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
65+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
6666
"urlsToWatch": [
6767
"https://graph.microsoft.com/*/external/connections/*/schema",
6868
"https://graph.microsoft.us/*/external/connections/*/schema",
@@ -73,7 +73,7 @@
7373
{
7474
"name": "GraphSdkGuidancePlugin",
7575
"enabled": true,
76-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
76+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
7777
"urlsToWatch": [
7878
"https://graph.microsoft.com/v1.0/*",
7979
"https://graph.microsoft.com/beta/*",
@@ -88,12 +88,12 @@
8888
{
8989
"name": "ODataPagingGuidancePlugin",
9090
"enabled": true,
91-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
91+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
9292
},
9393
{
9494
"name": "GraphClientRequestIdGuidancePlugin",
9595
"enabled": true,
96-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
96+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
9797
"urlsToWatch": [
9898
"https://graph.microsoft.com/v1.0/*",
9999
"https://graph.microsoft.com/beta/*",
@@ -108,54 +108,54 @@
108108
{
109109
"name": "CachingGuidancePlugin",
110110
"enabled": true,
111-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
111+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
112112
"configSection": "cachingGuidance"
113113
},
114114
{
115115
"name": "RateLimitingPlugin",
116116
"enabled": false,
117-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
117+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
118118
"configSection": "rateLimiting"
119119
},
120120
{
121121
"name": "MockResponsePlugin",
122122
"enabled": false,
123-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
123+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
124124
"configSection": "mocksPlugin"
125125
},
126126
{
127127
"name": "GraphMockResponsePlugin",
128128
"enabled": true,
129-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
129+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
130130
"configSection": "mocksPlugin"
131131
},
132132
{
133133
"name": "GraphRandomErrorPlugin",
134134
"enabled": true,
135-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
135+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
136136
"configSection": "graphRandomErrorsPlugin"
137137
},
138138
{
139139
"name": "ExecutionSummaryPlugin",
140140
"enabled": false,
141-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
141+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
142142
"configSection": "executionSummaryPlugin"
143143
},
144144
{
145145
"name": "GraphMinimalPermissionsPlugin",
146146
"enabled": true,
147-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
147+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
148148
"configSection": "graphMinimalPermissionsPlugin"
149149
},
150150
{
151151
"name": "GraphMinimalPermissionsGuidancePlugin",
152152
"enabled": false,
153-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
153+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
154154
},
155155
{
156156
"name": "MockGeneratorPlugin",
157157
"enabled": false,
158-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
158+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
159159
}
160160
],
161161
"urlsToWatch": [
@@ -173,11 +173,11 @@
173173
"https://*.sharepoint-df.*/*_vti_bin/*"
174174
],
175175
"mocksPlugin": {
176-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/mockresponseplugin.schema.json",
176+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/mockresponseplugin.schema.json",
177177
"mocksFile": "m365-mocks.json"
178178
},
179179
"graphRandomErrorsPlugin": {
180-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/graphrandomerrorplugin.schema.json",
180+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/graphrandomerrorplugin.schema.json",
181181
"allowedErrors": [
182182
429,
183183
500,
@@ -189,28 +189,28 @@
189189
"rate": 50
190190
},
191191
"executionSummaryPlugin": {
192-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/executionsummaryplugin.schema.json",
192+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/executionsummaryplugin.schema.json",
193193
"groupBy": "url"
194194
},
195195
"graphMinimalPermissionsPlugin": {
196-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/graphminimalpermissionsplugin.schema.json",
196+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/graphminimalpermissionsplugin.schema.json",
197197
"type": "delegated"
198198
},
199199
"cachingGuidance": {
200-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/cachingguidanceplugin.schema.json",
200+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/cachingguidanceplugin.schema.json",
201201
"cacheThresholdSeconds": 5
202202
},
203203
"latencyPlugin": {
204-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/latencyplugin.schema.json",
204+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/latencyplugin.schema.json",
205205
"minMs": 200,
206206
"maxMs": 10000
207207
},
208208
"devTools": {
209-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/devtoolsplugin.schema.json",
209+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/devtoolsplugin.schema.json",
210210
"preferredBrowser": "Edge"
211211
},
212212
"rateLimiting": {
213-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/ratelimitingplugin.schema.json",
213+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/ratelimitingplugin.schema.json",
214214
"costPerRequest": 2,
215215
"rateLimit": 120,
216216
"retryAfterSeconds": 5

DevProxy/config/microsoft-graph-rate-limiting.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/rc.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/rc.schema.json",
33
"plugins": [
44
{
55
"name": "RateLimitingPlugin",
66
"enabled": true,
7-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
7+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
88
}
99
],
1010
"urlsToWatch": [

DevProxy/config/microsoft-graph.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/rc.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/rc.schema.json",
33
"plugins": [
44
{
55
"name": "GraphSelectGuidancePlugin",
66
"enabled": true,
7-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
7+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
88
},
99
{
1010
"name": "GraphBetaSupportGuidancePlugin",
1111
"enabled": true,
12-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
12+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
1313
"urlsToWatch": [
1414
"https://graph.microsoft.com/beta/*",
1515
"https://graph.microsoft.us/beta/*",
@@ -20,7 +20,7 @@
2020
{
2121
"name": "GraphConnectorGuidancePlugin",
2222
"enabled": true,
23-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
23+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
2424
"urlsToWatch": [
2525
"https://graph.microsoft.com/*/external/connections/*/schema",
2626
"https://graph.microsoft.us/*/external/connections/*/schema",
@@ -31,28 +31,28 @@
3131
{
3232
"name": "GraphSdkGuidancePlugin",
3333
"enabled": true,
34-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
34+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
3535
},
3636
{
3737
"name": "ODataPagingGuidancePlugin",
3838
"enabled": true,
39-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
39+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
4040
},
4141
{
4242
"name": "GraphClientRequestIdGuidancePlugin",
4343
"enabled": true,
44-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
44+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
4545
},
4646
{
4747
"name": "GraphRandomErrorPlugin",
4848
"enabled": true,
49-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
49+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
5050
"configSection": "graphRandomErrorsPlugin"
5151
},
5252
{
5353
"name": "ExecutionSummaryPlugin",
5454
"enabled": true,
55-
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
55+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
5656
"configSection": "executionSummaryPlugin"
5757
}
5858
],
@@ -67,7 +67,7 @@
6767
"https://microsoftgraph.chinacloudapi.cn/beta/*"
6868
],
6969
"graphRandomErrorsPlugin": {
70-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/graphrandomerrorplugin.schema.json",
70+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/graphrandomerrorplugin.schema.json",
7171
"allowedErrors": [
7272
429,
7373
500,
@@ -79,7 +79,7 @@
7979
"rate": 50
8080
},
8181
"executionSummaryPlugin": {
82-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/executionsummaryplugin.schema.json",
82+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/executionsummaryplugin.schema.json",
8383
"groupBy": "url"
8484
},
8585
"labelMode": "text",

DevProxy/config/spo-csom-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/minimalcsompermissions.types.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/minimalcsompermissions.types.schema.json",
33
"types": {
44
"268004ae-ef6b-4e9b-8425-127220d84719": "Microsoft.Online.SharePoint.TenantAdministration.Tenant",
55
"3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a": "Microsoft.SharePoint.Client.RequestContext"

DevProxy/devproxy-errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/genericrandomerrorplugin.errorsfile.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/genericrandomerrorplugin.errorsfile.schema.json",
33
"errors": [
44
{
55
"request": {

0 commit comments

Comments
 (0)