Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential breaking changes in Graph PowerShell SDK due to change/rename of tags #605

Open
timayabi2020 opened this issue Nov 13, 2024 · 2 comments

Comments

@timayabi2020
Copy link
Contributor

The following tags are missing from the latest metadata for PowerShell.
users.Actions
users.Functions
deviceManagement.Functions
deviceManagement.Actions.

This means that if you try to slice the metadata using the above tags, the service will respond with a 404. e.g. https://devxapi-func-prod-eastus.azurewebsites.net/$openapi?tags=^users.Functions$&title=Users.Functions&openapiversion=3&style=Powershell&fileName=powershell_v2&graphVersion=v1.0&singularizeOperationIds=true.

Therefore, some paths that were assigned those tags, currently have new tags and this would potentially introduce breaking changes in the SDK.
Below is an example of before and after for one of the paths.
Before
Image

After
Image

The change will occur in terms of grouping of paths. e.g. Paths that used to appear under Users. Actions module are now appearing under Calendar module.

@irvinesunday
Copy link
Collaborator

irvinesunday commented Nov 15, 2024

@timayabi2020 this change was occasioned by this PR:#586 necessitated by this PowerShell issue: microsoftgraph/msgraph-sdk-powershell#2957 and duplicated OData issue: #585 as per your request.

You gave the example of the below tag:
Image
...that needed to be updated to solutions.backupRestoreRoot

If this isn't what is anticipated, shall we revert the change and resume the old naming convention of {navigationSource}.Functions and {navigationSource}.Actions ?

@andrueastman
Copy link
Member

@timayabi2020 @irvinesunday @Ndiritu

To recap our earlier discussion,

Context
At the moment, Powershell has two modules Bookings and BackupRestore that are separate but would ideally reference paths that are both under the root path segment /solutions. Before the PR at #586, all function/actions under a root path would have the same tag (i.esolutions.Actions) so the slicing for paths using tags did not allow for the Action/Function paths for Bookings and BackupRestore separated(so that they can exist in separate modules). What ended up happening is all the functions/actions are placed in the Bookings module.

Current State
The change in #586 solved this problem, but created another problem in that Powershell still needs the functions/actions separated for some other modules according to the mappings here.
https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dceff1f4232c7bab6e579d2c5db0257ab9626f3b/config/ModulesMapping.jsonc#L42

This also creates another problem in that paths that existed in Users.Actions and Users.Functions are now moving into other documents as their tags are now matching other modules. A good example is the odata Action like CreateUploadSession now moves to the Calendar/Drive module due to the updated tagging. (Generating cmdlet with this would obviously be a breaking change). Furthermore, trying to contain the paths manually or with workarounds would still bring more work down the road with reviewing new paths added to the metadata.
On top of this this surfaced another bug with duplicate operation ids showing up due to the slicing logic which is outlined at microsoftgraph/microsoft-graph-devx-api#2255

Option 1
We can update the changes made in #586 to also include a suffix in the Tag(i.e. .Actions or .Functions) so that the actions/function for Bookings would look like solutions.Bookings.*.Actions and for BackupRestore would look like solutions.BackupRestore*.Actions(note the wild card characters).
This would

  • enable the powershell mappings to be updated to target the paths more precisely to fix the incorrect mappings.
  • enable the user functions/actions to still remain in their current modules by targeting operationIds like user.*.Actions (note the wildcard character)
  • enable omission/exclusion of actions/functions using a negated match of the tags like user.*.Actions

Option 2 (I just realized this later, so I'm putting this here so that you may share thoughts on this too)
Given that tags are a collection/array in openApi, we could potentially add both tags to the operation(previous state of tags plus current state of tags).
This means an action/function in Bookings would have both the solutions.Actions and solutions.Bookings and by applying set theory, you could either include/exclude paths matching specific tags. This would however need testing and validation with the current slicing implementation in devX api.

I believe the way forward from the discussion is for

Lemme know if anything is missed from this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants