PowerShell / DSC

This repo is for the DSC v3 project
MIT License
195 stars 24 forks source link

Group and Provider naming conventions #243

Closed michaeltlombardi closed 5 months ago

michaeltlombardi commented 10 months ago

Summary of the new feature / enhancement

As a user, I want to be able to tell at a glance whether an instance of a resource in a configuration manages a single instance, a group of instances, or is a provider for other instances.

Right now, there is an informal convention of appending Group to the type name, but this is used for both resource groups and resource providers.

We should have some standard guidance and follow it for the first-party resources.

[!NOTE] This may not be as necessary if #139 is implemented, as we could surface this information more easily in the editor extension and in the CLI output. I think the naming convention would still have some value, but less.

Proposed technical implementation details (optional)

The current documentation for fully qualified type names says:

The name segment of the type name is mandatory. It identifies the component that the resource manages. This segment should be a singular noun unless the resource always manages a list of components in a single resource instance. In that case, the resource name should be the plural form of the noun it manages or the singular form of the noun followed by the word List, like JeaRoleCapabilities or JeaRoleCapabilityList.

We could add additional guidance here for resource groups and providers, like:

If the resource is a resource group, add the Group suffix to the name. If it's a resource provider, add the Provider suffix to the name.

michaeltlombardi commented 10 months ago

Another alternative naming convention would be to have the last segment of the type name before the / be Group for group resources and Provider for provider resources.

Then the naming syntax would be:

<owner>[.<group>][.<area>][.(Group|Provider)]/<name>

Either convention could be extended to help indicate other resource types, like assertion resources.

SteveL-MSFT commented 9 months ago

We may want to consider different naming conventions for DSC groups resources that are part of dsc.exe (basically built-in) vs DSC resources that may ship with DSC (PowerShellGroup, WMIGroup, for example). Seems like built-in should use DSC/<resourceName, but the others we may want as Microsoft/WindowsPowerShellGroup, Microsoft/PowerShell7Group, and Microsoft.Windows/WMIGroup.

SteveL-MSFT commented 6 months ago

WG discussed and closing this in favor of Kind and new naming conventions discussed.

SteveL-MSFT commented 5 months ago

This was fixed as part of https://github.com/PowerShell/DSC/pull/341