Skip to content

Commit

Permalink
Merge branch 'issue-5823' of https://github.com/nanddeepn/cli-microso…
Browse files Browse the repository at this point in the history
…ft365 into issue-5823
  • Loading branch information
nanddeepn committed Aug 26, 2024
2 parents da3a7a6 + 3001086 commit 9e08538
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 130 deletions.
26 changes: 12 additions & 14 deletions docs/docs/about/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ sidebar_position: 3

## v9.0.0 (beta)

### ⚠️ Breaking changes
### Changes

- updated option names of [app permission add](../cmd/app/permission/permission-add.mdx) to plural [#5719](https://github.com/pnp/cli-microsoft365/issues/5975)
- removed deprecated guest filtering for [entra m365group user list](../cmd/entra/m365group/m365group-user-list.mdx) command [#5558](https://github.com/pnp/cli-microsoft365/issues/5558)
- added `--force` option to [spo site appcatalog remove](../cmd/spo/site/site-appcatalog-remove.mdx) command [#6091](https://github.com/pnp/cli-microsoft365/issues/6091)
- updated option names of 'app permission add' to plural [#5719](https://github.com/pnp/cli-microsoft365/issues/5975)
- removed deprecated Guest value from 'aad m365group user list' command [#5558](https://github.com/pnp/cli-microsoft365/issues/5558)
- added `--force` option to 'spo site appcatalog remove' command [#6091](https://github.com/pnp/cli-microsoft365/issues/6091)
- aligned options with naming convention [#5616](https://github.com/pnp/cli-microsoft365/issues/5616)
- removed duplicate property from [spo list list](../cmd/spo/list/list-list.mdx) command [#6042](https://github.com/pnp/cli-microsoft365/issues/6042)
- updated [spo tenant recyclebinitem restore](../cmd/spo/tenant/tenant-recyclebinitem-restore.mdx) command output [#6063](https://github.com/pnp/cli-microsoft365/issues/6063)
- removed deprecated option `wait` from [spo site remove](../cmd/spo/site/site-remove.mdx) command [#5956](https://github.com/pnp/cli-microsoft365/issues/5956)
- reworked command [spo file copy](../cmd/spo/file/file-copy.mdx) to new API endpoint [#6152](https://github.com/pnp/cli-microsoft365/issues/6152)
- removed duplicate property from 'spo list list' command [#6042](https://github.com/pnp/cli-microsoft365/issues/6042)
- updated 'spo tenant recyclebinitem restore' command [#6063](https://github.com/pnp/cli-microsoft365/issues/6063)
- removed deprecated option '--wait' from 'spo site remove' command [#5956](https://github.com/pnp/cli-microsoft365/issues/5956)
- reworked command 'spo file copy' to new API endpoint [#6152](https://github.com/pnp/cli-microsoft365/issues/6152)
- removed deprecated CLI environment variables [#5918](https://github.com/pnp/cli-microsoft365/issues/5918)
- updated options of `entra enterpriseapp` commands [#6155](https://github.com/pnp/cli-microsoft365/issues/6155)
- removed `overwrite` option from [spfx project github workflow add](../cmd/spfx/project/project-github-workflow-add.mdx) command [#5765](https://github.com/pnp/cli-microsoft365/issues/5765)
- updated [status](../cmd/status.mdx) command output [#5849](https://github.com/pnp/cli-microsoft365/issues/5849)
- removed [spo folder rename](../cmd/spo/folder/folder-set.mdx) alias [#5911](https://github.com/pnp/cli-microsoft365/issues/5911)
- removed stringified property from [spo applicationcustomizer get](../cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx) command [#6052](https://github.com/pnp/cli-microsoft365/issues/6052)
- removed all `yammer` command aliases [#5764](https://github.com/pnp/cli-microsoft365/issues/5764)
- updated options of 'entra enterpriseapp' commands [#6155](https://github.com/pnp/cli-microsoft365/issues/6155)
- removed 'overwrite' option from 'spfx project github workflow add' command [#5765](https://github.com/pnp/cli-microsoft365/issues/5765)
- updated 'm365 status' command output [#5849](https://github.com/pnp/cli-microsoft365/issues/5849)
- removed 'spo folder rename' alias [#5911](https://github.com/pnp/cli-microsoft365/issues/5911)

## v8.1.0 (beta)

Expand Down
47 changes: 2 additions & 45 deletions docs/docs/v9-upgrade-guidance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ In the past versions of CLI for Microsoft 365, the command had no output. When u

When using the [spo file copy](./cmd/spo/file/file-copy.mdx) command, please use the new command input. This means that you'll have to remove option `--resetAuthorAndCreated` from your scripts and automation tools.

### Removed `spo folder rename` alias
### Removed 'spo folder rename' alias

The `spo folder rename` command was removed and replaced by the [spo folder set](./cmd/spo/folder/folder-set.mdx) command.

Expand All @@ -168,14 +168,6 @@ For this new major version, we've Removed `aad` options in below spo commands:

Please, check the documentation of the [spo group member add](./cmd/spo/group/group-member-add.mdx), [spo group member remove](./cmd/spo/group/group-member-remove.mdx), and [spo user ensure](./cmd/spo/user/user-ensure.mdx) command to see the updated options and adjust your scripts accordingly.

### Updated output of `spo applicationcustomizer get` command

In the previous version of CLI, the command output had a `Rights` property that was a stringified JSON object. In this release, this has been changed to a JSON object.

#### What action do I need to take?

Please, check the documentation of the [spo applicationcustomizer get](./cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx) command to see the updated output and adjust your scripts accordingly.

## SharePoint Framework

### Removed overwrite option from `spfx project github workflow add` command
Expand All @@ -184,41 +176,6 @@ Overwriting the SPFx package should be the default behavior of the continuous de

#### What action do I need to take?

Please update your scripts not to use the `overwrite` option.

## Yammer (Viva Engage)

### Removal of deprecated Yammer aliases

We have removed all deprecated `Yammer` command aliases. These aliases were introduced in the previous version to prevent the introduction of breaking changes. Since Yammer has been renamed to Viva Engage a while ago, the following aliases were removed:

Alias | Command
--|--
`yammer search` | [viva engage search](./cmd/viva/engage/engage-search.mdx)
`yammer group list` | [viva engage group list](./cmd/viva/engage/engage-group-list.mdx)
`yammer group user add` | [viva engage group user add](./cmd/viva/engage/engage-group-user-add.mdx)
`yammer group user remove` | [viva engage group user remove](./cmd/viva/engage/engage-group-user-remove.mdx)
`yammer message add` | [viva engage message add](./cmd/viva/engage/engage-message-add.mdx)
`yammer message get` | [viva engage message get](./cmd/viva/engage/engage-message-get.mdx)
`yammer message list` | [viva engage message list](./cmd/viva/engage/engage-message-list.mdx)
`yammer message remove` | [viva engage message remove](./cmd/viva/engage/engage-message-remove.mdx)
`yammer message like set` | [viva engage message like set](./cmd/viva/engage/engage-message-like-set.mdx)
`yammer network list` | [viva engage network list](./cmd/viva/engage/engage-network-list.mdx)
`yammer report activitycounts` | [viva engage report activitycounts](./cmd/viva/engage/engage-report-activitycounts.mdx)
`yammer report activityusercounts` | [viva engage report activityusercounts](./cmd/viva/engage/engage-report-activityusercounts.mdx)
`yammer report activityuserdetail` | [viva engage report activityuserdetail](./cmd/viva/engage/engage-report-activityuserdetail.mdx)
`yammer report deviceusagedistributionusercounts` | [viva engage report deviceusagedistributionusercounts](./cmd/viva/engage/engage-report-deviceusagedistributionusercounts.mdx)
`yammer report deviceusageusercounts` | [viva engage report deviceusageusercounts](./cmd/viva/engage/engage-report-deviceusageusercounts.mdx)
`yammer report deviceusageuserdetail` | [viva engage report deviceusageuserdetail](./cmd/viva/engage/engage-report-deviceusageuserdetail.mdx)
`yammer report groupsactivitycounts` | [viva engage report groupsactivitycounts](./cmd/viva/engage/engage-report-groupsactivitycounts.mdx)
`yammer report groupsactivitydetail` | [viva engage report groupsactivitydetail](./cmd/viva/engage/engage-report-groupsactivitydetail.mdx)
`yammer report groupsactivitygroupcounts` | [viva engage report groupsactivitygroupcounts](./cmd/viva/engage/engage-report-groupsactivitygroupcounts.mdx)
`yammer user get` | [viva engage user get](./cmd/viva/engage/engage-user-get.mdx)
`yammer user list` | [viva engage user list](./cmd/viva/engage/engage-user-list.mdx)

#### What action do I need to take?

Replace any of the aliases mentioned above with the corresponding command name. The functionality of the command hasn't changed.
# v9 Upgrade Guidance
Please update your scripts not to use the `overwrite` option.# v9 Upgrade Guidance

The v9 of CLI for Microsoft 365 introduces several breaking changes. To help you upgrade to the latest version of CLI for Microsoft 365, we've listed those changes along with any actions you may need to take.
4 changes: 2 additions & 2 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const config: Config = {
'client-redirects',
{
createRedirects(routePath) {
if (routePath.includes('/entra')) {
return [routePath.replace('/entra', '/aad')];
if (routePath.includes('/viva/engage')) {
return [routePath.replace('/viva/engage', '/yammer')];
}

return [];
Expand Down
2 changes: 0 additions & 2 deletions src/m365/entra/commands/m365group/m365group-user-add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import commands from '../../commands.js';
import command from './m365group-user-add.js';
import { settingsNames } from '../../../../settingsNames.js';
import { entraGroup } from '../../../../utils/entraGroup.js';
import { entraUser } from '../../../../utils/entraUser.js';
import aadCommands from '../../aadCommands.js';

describe(commands.M365GROUP_USER_ADD, () => {
const groupId = '3f04e370-cbc6-4091-80fe-1d038be2ad06';
Expand Down
9 changes: 0 additions & 9 deletions src/m365/entra/commands/m365group/m365group-user-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js';
import { validation } from '../../../../utils/validation.js';
import { formatting } from '../../../../utils/formatting.js';
import GraphCommand from '../../../base/GraphCommand.js';
import teamsCommands from '../../../teams/commands.js';
import aadCommands from '../../aadCommands.js';
import { entraUser } from '../../../../utils/entraUser.js';
import commands from '../../commands.js';

interface CommandArgs {
Expand Down Expand Up @@ -135,12 +132,6 @@ class EntraM365GroupUserAddCommand extends GraphCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_ADD, commands.M365GROUP_USER_ADD);

if (args.options.userName) {
await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`);
}

try {
const userNames = args.options.userNames || args.options.userName;
const providedGroupId: string = await this.getGroupId(logger, args);
Expand Down
22 changes: 8 additions & 14 deletions src/m365/entra/commands/m365group/m365group-user-set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js';
import commands from '../../commands.js';
import command from './m365group-user-set.js';
import { entraGroup } from '../../../../utils/entraGroup.js';
import { entraUser } from '../../../../utils/entraUser.js';
import aadCommands from '../../aadCommands.js';

describe(commands.M365GROUP_USER_SET, () => {
const groupId = '630dfae3-6904-4154-acc2-812e11205351';
Expand Down Expand Up @@ -72,18 +70,14 @@ describe(commands.M365GROUP_USER_SET, () => {
assert.notStrictEqual(command.description, null);
});

it('defines alias', () => {
const alias = command.alias();
assert.notStrictEqual(typeof alias, 'undefined');
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [teamsCommands.USER_SET, aadCommands.M365GROUP_USER_SET]);
});

it('fails validation if groupId is not a valid GUID', async () => {
const actual = await command.validate({ options: { groupId: 'foo', ids: userIds[0], role: 'Member' } }, commandInfo);
it('fails validation if the groupId is not a valid guid.', async () => {
const actual = await command.validate({
options: {
role: 'Member',
groupId: 'not-c49b-4fd4-8223-28f0ac3a6402',
userName: 'anne.matthews@contoso.onmicrosoft.com'
}
}, commandInfo);
assert.notStrictEqual(actual, true);
});

Expand Down
8 changes: 0 additions & 8 deletions src/m365/entra/commands/m365group/m365group-user-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { formatting } from '../../../../utils/formatting.js';
import GraphCommand from '../../../base/GraphCommand.js';
import commands from '../../commands.js';
import { entraGroup } from '../../../../utils/entraGroup.js';
import { entraUser } from '../../../../utils/entraUser.js';
import aadCommands from '../../aadCommands.js';

interface CommandArgs {
options: Options;
Expand Down Expand Up @@ -132,12 +130,6 @@ class EntraM365GroupUserSetCommand extends GraphCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_SET, commands.M365GROUP_USER_SET);

if (args.options.userName) {
await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`);
}

try {
const userNames = args.options.userNames || args.options.userName;
const groupId: string = await this.getGroupId(logger, args);
Expand Down
36 changes: 0 additions & 36 deletions src/utils/spo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2555,42 +2555,6 @@ describe('utils/spo', () => {
assert.strictEqual(amountOfCalls, 4);
});

it('throws error when folder not found by id', async () => {
sinon.stub(request, 'get').callsFake(async opts => {
if (opts.url === `${webUrl}/_api/web/GetFolderById('invalidFolderId')?$select=ServerRelativeUrl`) {
throw `File Not Found`;
}

throw 'Invalid request';
});

try {
await spo.getFolderServerRelativeUrl(webUrl, undefined, 'invalidFolderId', logger, true);
assert.fail('No error message thrown.');
}
catch (ex) {
assert.deepStrictEqual(ex, `File Not Found`);
}
});

it('throws error when folder not found by url', async () => {
sinon.stub(request, 'get').callsFake(async opts => {
if (opts.url === `${webUrl}/_api/web/GetFolderByServerRelativePath(decodedUrl='%2Fsites%2Fsales%2FinvalidFolderUrl')?$select=ServerRelativeUrl`) {
throw `File Not Found`;
}

throw 'Invalid request';
});

try {
await spo.getFolderServerRelativeUrl(webUrl, 'invalidFolderUrl', undefined, logger, true);
assert.fail('No error message thrown.');
}
catch (ex) {
assert.deepStrictEqual(ex, `File Not Found`);
}
});

it('correctly outputs result when calling createCopyJob', async () => {
sinon.stub(request, 'post').callsFake(async (opts) => {
if (opts.url === 'https://contoso.sharepoint.com/sites/sales/_api/Site/CreateCopyJobs') {
Expand Down

0 comments on commit 9e08538

Please sign in to comment.