Skip to content

Adds viva engage role member add command. Closes #6819#7219

Open
nanddeepn wants to merge 1 commit intopnp:mainfrom
nanddeepn:issue-6819
Open

Adds viva engage role member add command. Closes #6819#7219
nanddeepn wants to merge 1 commit intopnp:mainfrom
nanddeepn:issue-6819

Conversation

@nanddeepn
Copy link
Copy Markdown
Contributor

Adds viva engage role member add command. Closes #6819

Copilot AI review requested due to automatic review settings April 16, 2026 06:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Viva Engage command to assign (add) a role member via Microsoft Graph, including tests and documentation, aligning the Viva Engage role management feature set.

Changes:

  • Introduces viva engage role member add Graph command supporting role/user resolution by name or id.
  • Adds Mocha test coverage for validation, successful POST behavior, and error handling.
  • Adds Docusaurus documentation page and sidebar entry for the new command.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/m365/viva/commands/engage/engage-role-member-add.ts Implements the new command and Graph POST to add a member to a role.
src/m365/viva/commands/engage/engage-role-member-add.spec.ts Adds unit tests for validation, success paths, and error handling.
src/m365/viva/commands.ts Registers the new command name constant.
docs/src/config/sidebars.ts Adds the new command doc to the Viva Engage sidebar.
docs/docs/cmd/viva/engage/engage-role-member-add.mdx Adds command reference docs, including preview warning and permissions.

Comment on lines +13 to +14
roleId: z.uuid().optional(),
roleName: z.string().optional(),
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs advertise short options -i/-n for --roleId/--roleName (consistent with engage-role-member-list), but the command schema doesn't define these aliases. Add .alias('i') and .alias('n') (or update docs to remove the short options) so the documented CLI usage works.

Suggested change
roleId: z.uuid().optional(),
roleName: z.string().optional(),
roleId: z.uuid().alias('i').optional(),
roleName: z.string().alias('n').optional(),

Copilot uses AI. Check for mistakes.

:::warning

This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reached general availability.
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning text has a grammatical error and is inconsistent with the existing engage role member docs. Consider changing "once the API reached general availability" to "once the API reaches general availability".

Suggested change
This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reached general availability.
This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reaches general availability.

Copilot uses AI. Check for mistakes.
@milanholemans
Copy link
Copy Markdown
Contributor

milanholemans commented Apr 16, 2026

Thanks, we'll try to review it ASAP.

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

Successfully merging this pull request may close these issues.

New command: viva engage role member add

3 participants