Files
Dan Moseley 042a9d2b2c Reorganize plugins into domain-specific groupings (#274)
* Reorganize plugins per agreed structure (#271)

Split the dotnet plugin into domain-specific plugins per discussion
in #271:

- dotnet: narrowed to common everyday C#/.NET coding tasks
- dotnet-diag: perf investigations, debugging, incident analysis
- dotnet-data: data access and Entity Framework
- dotnet-aspnet, dotnet-wpf, dotnet-winforms, dotnet-maui: scaffolded
  empty to convey intent for future framework-specific skills

Moved skills, tests, and CODEOWNERS entries accordingly.
No file content was changed; all skill/test moves are pure renames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve dotnet-diag and dotnet-winforms descriptions

- dotnet-diag: add '.NET' qualifier to clarify scope
- dotnet-winforms: use official 'Windows Forms (WinForms)' name

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add .NET qualifier to dotnet-data description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove empty plugins; list them in CONTRIBUTING.md as future options

Remove the four empty placeholder plugins (dotnet-aspnet, dotnet-wpf,
dotnet-winforms, dotnet-maui) that had only plugin.json and no skills.

Add a 'Plugin organization' section to CONTRIBUTING.md that describes the
domain-specific plugin groupings introduced in this PR and lists the four
removed plugin names as reserved candidates for future contributions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Create dotnet-upgrade plugin with migration/upgrade skills

Move migrate-nullable-references, thread-abort-migration, and
dotnet-aot-compat from dotnet to the new dotnet-upgrade plugin.

Update CODEOWNERS paths (same owners), CONTRIBUTING.md plugin table,
and fix the thread-abort-migration SKILL.md link in CONTRIBUTING.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:01:52 -08:00

82 lines
3.7 KiB
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager;
namespace Azure.ResourceManager
{
/// <summary>
/// A class representing Azure resource manager client options.
/// </summary>
#pragma warning disable AZC0008 // ClientOptions should have a nested enum called ServiceVersion
public sealed class ArmClientOptions : ClientOptions
#pragma warning restore AZC0008 // ClientOptions should have a nested enum called ServiceVersion
{
internal IDictionary<ResourceType, string> ResourceApiVersionOverrides { get; } = new Dictionary<ResourceType, string>();
/// <summary>
/// Gets or sets Azure cloud environment.
/// </summary>
public ArmEnvironment? Environment { get; set; }
/// <summary>
/// Sets the api version to use for a given resource type.
/// To find which API Versions are available in your environment you can use the <see cref="ResourceProviderResource.Get"/> method
/// for the provider namespace you are interested in.
/// </summary>
/// <param name="resourceType"> The resource type to set the version for. To determine the appropriate value, you can refer to the corresponding documentation or XML documentation comments of the API. Then, get its resource type from the Resource's ResourceType field.</param>
/// <param name="apiVersion"> The api version to use. </param>
public void SetApiVersion(ResourceType resourceType, string apiVersion)
{
Argument.AssertNotNullOrEmpty(apiVersion, nameof(apiVersion));
ResourceApiVersionOverrides[resourceType] = apiVersion;
}
/// <summary>
/// Sets the api versions from an Azure Stack profile.
/// </summary>
public void SetApiVersionsFromProfile(AzureStackProfile profile)
{
var assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(profile.GetManifestName()))
{
var span = BinaryData.FromStream(stream).ToMemory().Span;
var allProfile = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, JsonElement>>>(span);
var armProfile = allProfile["resource-manager"];
foreach (var keyValuePair in armProfile)
{
var namespaceName = keyValuePair.Key;
var element = keyValuePair.Value;
foreach (var apiVersionProperty in element.EnumerateObject())
{
var apiVersion = apiVersionProperty.Name;
foreach (var resourceTypeItem in apiVersionProperty.Value.EnumerateArray())
{
string resourceTypeName = default;
foreach (var property in resourceTypeItem.EnumerateObject())
{
if (property.NameEquals("resourceType"))
{
resourceTypeName = property.Value.GetString();
break;
}
}
var resourceType = $"{namespaceName}/{resourceTypeName}";
ResourceApiVersionOverrides[resourceType] = apiVersion;
}
}
}
}
}
}
}