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

Adds command pa app permission remove, Closes #4655 #5169

Closed
wants to merge 3 commits into from

Conversation

nicodecleyre
Copy link
Contributor

Closes #4655

@milanholemans
Copy link
Contributor

Thank you @nicodecleyre! Will try to review it ASAP!

@milanholemans milanholemans self-assigned this Jun 26, 2023
Copy link
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

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

I've reviewed your PR and found some areas that need attention before we can proceed. Could you have a look at it, please?

src/m365/pa/commands/app/app-permission-remove.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
@milanholemans milanholemans marked this pull request as draft July 4, 2023 21:48
@nicodecleyre nicodecleyre marked this pull request as ready for review July 7, 2023 10:06
Copy link
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

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

Good work on this PR! Before we continue, I think a few changes are needed.
Could you have a look at them, please?

docs/docs/cmd/pa/app/app-permission-remove.mdx Outdated Show resolved Hide resolved
docs/docs/cmd/pa/app/app-permission-remove.mdx Outdated Show resolved Hide resolved
docs/docs/cmd/pa/app/app-permission-remove.mdx Outdated Show resolved Hide resolved
docs/docs/cmd/pa/app/app-permission-remove.mdx Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
src/m365/pa/commands/app/app-permission-remove.spec.ts Outdated Show resolved Hide resolved
@milanholemans milanholemans marked this pull request as draft July 13, 2023 22:03
@nicodecleyre nicodecleyre marked this pull request as ready for review July 31, 2023 10:34
Copy link
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

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

Ready to go! Made a few changes while merging.

}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
if (this.verbose) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this verbose log to the method that is fired after the prompt is confirmed.

sinon.stub(pid, 'getProcessName').returns('');
sinon.stub(session, 'getId').returns('');
auth.service.connected = true;
if (!auth.service.accessTokens[auth.defaultResource]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should always clear this value when the testing has been done, so let's remove the if and clear it after running the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's sufficient to just have 1 test where we mock the prompt confirmation to true. If it works for one option, we can assume it works for all.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing a test where we test if the prompt is actually fired.

@milanholemans
Copy link
Contributor

Merged manually, great work adding this command!

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

Successfully merging this pull request may close these issues.

New command: pa app permission remove
2 participants