Investigate automatic singularization of function cmdlet nouns in the v3 generator

Aperta
#3,913 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
cli, tooling

Direzione di ricerca

Start with the function-segment branch in tools/WrapperGenerator/CmdletNaming.cs, which adds the operation noun without the singularization applied to resource segments, and compare it with the Reports overrides in src/Reports/wrapper/Reports_cmdletConfigurations.cs. Survey how the v1.0 and beta naming data (parity-renames.v1.0.json and its beta counterpart) treat function nouns across the corpus. Done means a written rule or a list of deliberate exceptions, plus naming regression tests, and no change to the wire API, HTTP routes or builders.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Status: Needs Investigation type:investigation
Is your feature request related to a problem? Please describe the problem.

The v3 WrapperGenerator automatically singularizes resource path segments, but its action/function-segment branch adds the parsed operation noun directly, bypassing resource singularization. As a result, function-derived PowerShell nouns can retain plural endings unless an oracle-derived rename or curated module configuration corrects them.

Example from the Reports directive migration (#3870):

GET /reports/managedDeviceEnrollmentTopFailures()
Structural command: Get-MgReportManagedDeviceEnrollmentTopFailures
Intended command:   Get-MgReportManagedDeviceEnrollmentTopFailure

The existing shared Reports.md directive specifies the singular ReportManagedDeviceEnrollmentTopFailure noun. Before this migration, v1.0 already received that name from an explicit entry in parity-renames.v1.0.json, while beta retained the structural plural because the committed derived naming data is v1.0-only. The shared Reports configuration now preserves the intended singular name in both profiles.

Describe the solution you'd like.

Investigate whether function-derived cmdlet nouns should be singularized automatically, consistently with resource-derived nouns, rather than requiring individual overrides for cases such as TopFailures → TopFailure.

Determine the correct rule before implementing it:

  • Evaluate singularizing the appropriate noun portion of a function name, without rewriting the actual API function, HTTP route, Kiota builder, or wire parameters.
  • Review corpus-wide effects in both v1.0 and beta, including meaningful plural names, irregular nouns, acronyms, parameterized overload suffixes, and possible command-name collisions.
  • Check compatibility with published command names, shared AutoRest directive intent, and existing curated/oracle-derived overrides. Do not remove needed overrides merely because one example is addressed.
  • Add naming regression coverage and document any deliberate exceptions if a general rule is adopted.

This issue is investigation only, not approval for a naming sweep. Whether action names need a similar rule should be assessed separately rather than assumed.

Additional context?

Raised during review of #3870. The user noted that function nouns should probably be singularized automatically and requested an issue marked as needing investigation.

Relevant source at the reviewed Reports PR head:

No generator behavior or Reports configuration is changed as part of filing this issue.

Lingua principale
C#
Stelle
911
Fork
236
Merge medio
9g 18h
PR unite (30g)
33

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoftgraph/msgraph-sdk-powershell

Tutte le issue di microsoftgraph/msgraph-sdk-powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.