Skip to content

Commit 5e39fa9

Browse files
sellakumaranclaude
andcommitted
Merge remote main into users/sellak/customBPPermissions
Resolved merge conflict in Agent365ConfigTests.cs by retaining both the CustomBlueprintPermissions validation tests from this branch and the BotName derived property tests that were added in main. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f88fbaf commit 5e39fa9

14 files changed

Lines changed: 768 additions & 83 deletions

File tree

.claude/agents/pr-code-reviewer.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,49 @@ Create a **blocking** architectural finding if:
350350
- ✅ Be BALANCED: Praise good work alongside constructive criticism
351351
- ✅ Be ACCURATE: Only report real issues you can verify in the diff
352352

353+
### Verification Rules (MANDATORY — prevent false positives)
354+
355+
#### Rule 1: Mismatch Claims Require Quoted Evidence from Both Sides
356+
Before reporting ANY claim of the form "X doesn't match Y", "property name mismatch",
357+
"test uses different value than production code", or similar:
358+
1. Quote the **exact line from the diff** for side A (e.g. production code)
359+
2. Quote the **exact line from the diff** for side B (e.g. test code)
360+
3. Only then state whether they match or not
361+
362+
If you cannot quote both sides verbatim from the diff, do NOT make the claim.
363+
364+
#### Rule 2: Replacement Suggestions Must Acknowledge Behavioral Differences
365+
When suggesting "replace X with Y", always state explicitly whether X and Y are
366+
behaviorally equivalent. If they are NOT equivalent, describe the difference.
367+
368+
Example of what NOT to do:
369+
"Replace Console.WriteLine() with logger.LogInformation("")"
370+
← Wrong: these are not equivalent (logging pipeline vs. direct stdout)
371+
372+
Example of correct form:
373+
"Replace Console.WriteLine() with logger.LogInformation("") for consistency.
374+
Note: these differ — Console.WriteLine always writes to stdout; LogInformation
375+
is filtered by log level and can be suppressed or redirected by the logging provider."
376+
377+
#### Rule 3: Code Suggestions Must Use Idiomatic .NET Patterns
378+
When suggesting a refactor to replace weak-typed constructs (e.g. string-keyed
379+
dictionaries, magic strings, parallel arrays), prefer the most idiomatic C# solution:
380+
- A small `record` or `sealed class` over two separate typed lists
381+
- Constants as a minimal alternative when structure change is not warranted
382+
- Never suggest two parallel variables/lists when a single typed container is cleaner
383+
384+
Example:
385+
❌ Weak suggestion: "Use two typed lists: var orphanedUsers = ...; var orphanedSps = ...;"
386+
✅ Better suggestion: "Use a typed record: private sealed record OrphanedResources(...)"
387+
388+
#### Rule 4: Blocking/High Severity Requires Verifiable Concrete Evidence
389+
Before marking an issue as `blocking` or `high`:
390+
1. You must be able to point to a specific line in the diff that demonstrates the problem
391+
2. For logic bugs: trace the execution path in the code to confirm the bug occurs
392+
3. For test failures: quote both the assertion AND the value it will actually receive
393+
4. If any step requires assumption or inference, lower severity to `medium` or add
394+
a qualifier like "if X is true, then..." to the description
395+
353396
### Context Awareness
354397

355398
Differentiate between:

src/Directory.Packages.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<PackageVersion Include="Azure.ResourceManager.AppService" Version="1.2.0" />
3535
<!-- Microsoft Graph -->
3636
<PackageVersion Include="Microsoft.Graph" Version="5.36.0" />
37+
<!-- Transitive pin: resolves NU1107 conflict between Microsoft.Extensions.Http 9.x (needs >= 9.0.8)
38+
and Microsoft.Kiota.Abstractions 1.7.2 (needs < 9.0.0). CentralPackageTransitivePinningEnabled
39+
allows this pin to override the Kiota upper bound. -->
40+
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.8" />
3741
<!-- Testing packages -->
3842
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
3943
<PackageVersion Include="xunit" Version="2.9.2" />

src/Microsoft.Agents.A365.DevTools.Cli/Commands/CleanupCommand.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ private static async Task<bool> DeleteMessagingEndpointAsync(
741741
}
742742

743743
logger.LogInformation("Deleting messaging endpoint registration...");
744-
var endpointName = EndpointHelper.GetEndpointName(config.BotName);
744+
var endpointName = ResolveEndpointName(config);
745745

746746
var endpointDeleted = await botConfigurator.DeleteEndpointWithAgentBlueprintAsync(
747747
endpointName,
@@ -787,8 +787,8 @@ private static async Task ExecuteEndpointOnlyCleanupAsync(
787787
return;
788788
}
789789

790-
// Get the actual endpoint name that will be used for deletion (truncated to 42 chars)
791-
var endpointName = EndpointHelper.GetEndpointName(config.BotName);
790+
// Get the actual endpoint name that will be used for deletion (truncated to 42 chars).
791+
var endpointName = ResolveEndpointName(config);
792792

793793
logger.LogInformation("");
794794
logger.LogInformation("Endpoint Cleanup Preview:");
@@ -842,4 +842,23 @@ private static async Task ExecuteEndpointOnlyCleanupAsync(
842842
return null;
843843
}
844844
}
845+
846+
/// <summary>
847+
/// Resolves the Azure Bot Service endpoint name from config.
848+
/// For needsDeployment=false, prefers BotMessagingEndpoint (updated after each registration)
849+
/// over MessagingEndpoint (static) so that delete targets the currently registered endpoint.
850+
/// </summary>
851+
private static string ResolveEndpointName(Agent365Config config)
852+
{
853+
if (!config.NeedDeployment)
854+
{
855+
// Use BotMessagingEndpoint (updated by registration) over MessagingEndpoint (static).
856+
var urlForName = !string.IsNullOrWhiteSpace(config.BotMessagingEndpoint)
857+
? config.BotMessagingEndpoint
858+
: config.MessagingEndpoint;
859+
if (!string.IsNullOrWhiteSpace(urlForName))
860+
return EndpointHelper.GetEndpointNameFromUrl(urlForName, config.AgentBlueprintId);
861+
}
862+
return EndpointHelper.GetEndpointName(config.BotName);
863+
}
845864
}

src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,21 @@ public static Command CreateCommand(
235235
logger.LogInformation(" - Replace 'color.png' and 'outline.png' with your custom branding");
236236
logger.LogInformation("");
237237

238-
// Ask if user wants to open the file now
239-
Console.Write("Open manifest in your default editor now? (Y/n): ");
240-
var openResponse = Console.ReadLine()?.Trim().ToLowerInvariant();
241-
242-
if (openResponse != "n" && openResponse != "no")
238+
// Ask if user wants to open the file now (skip when stdin is not a terminal)
239+
if (!Console.IsInputRedirected)
243240
{
244-
FileHelper.TryOpenFileInDefaultEditor(manifestPath, logger);
241+
Console.Write("Open manifest in your default editor now? (Y/n): ");
242+
var openResponse = Console.ReadLine()?.Trim().ToLowerInvariant();
243+
244+
if (openResponse != "n" && openResponse != "no")
245+
{
246+
FileHelper.TryOpenFileInDefaultEditor(manifestPath, logger);
247+
}
248+
249+
Console.Write("Press Enter when you have finished editing the manifest to continue with publish: ");
250+
Console.Out.Flush();
251+
Console.ReadLine();
245252
}
246-
247-
Console.Write("Press Enter when you have finished editing the manifest to continue with publish: ");
248-
Console.Out.Flush();
249-
Console.ReadLine();
250253

251254
logger.LogInformation("Continuing with publish process...");
252255
logger.LogInformation("");

0 commit comments

Comments
 (0)