-
Notifications
You must be signed in to change notification settings - Fork 308
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
Bug-fix: spo site remove
#5955
Bug-fix: spo site remove
#5955
Conversation
Thanks @MathijsVerbeeck, we'll have a look at it ASAP! |
Please keep in mind to create a new issue to remove the wait option in v8. |
Thanks for the reminder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @MathijsVerbeeck, command looks a whole lot better already. Could you have a look at the comments I made before we continue?
Thanks for the thorough review. Could you have another look? |
75cf2aa
to
594a2a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command is getting a nice shape. Unfortunately, I encountered some issues which we should definitely have a look at. Could you have a look at the comments I made before I do another test run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did another review. Command is working almost perfectly, few more changes are needed.
1ad309a
to
86c439a
Compare
86c439a
to
62ff25b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, made a few last changes while merging.
if (this.verbose) { | ||
await logger.logToStderr(`Site group doesn't exist. Searching in the Microsoft 365 deleted groups.`); | ||
await logger.logToStderr(`Checking if group '${siteDetails.GroupId}' is already permanently deleted from recycle bin.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we added another verbose log in the function itself, we can remove this one.
|
||
await this.deleteOrphanedSite(logger, args.options.url); | ||
while (!isGroupInRecycleBin && amountOfPolls < 23) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
23 looks like an arbitrary number, no?
|
||
if (options.fromRecycleBin) { | ||
if (!siteDetails.TimeDeleted) { | ||
throw `Site is currently not in the recycle bin. Do not specify --fromRecycleBin if you want to try to remove it from the active sites.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's sound a bit more confident :)
throw `Site is currently not in the recycle bin. Do not specify --fromRecycleBin if you want to try to remove it from the active sites.`; | |
throw `Site is currently not in the recycle bin. Remove --fromRecycleBin if you want to remove it as active site.`; |
|
||
} | ||
} | ||
it('deletes a group site, deletes the m365 group from entra id and immediately deletes the site from the recycle bin, but skips deletion of the m365 group when it does not exist in Entra', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the title, we should check if delete was not called instead of amountOfPolls
.
|
||
throw 'Invalid request'; | ||
}); | ||
it('aborts removing the site when prompt not confirmed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also check for the remove request.
]); | ||
} | ||
} | ||
it('fails validation if siteUrl is a valid url', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid*
assert.notStrictEqual(actual, true); | ||
}); | ||
|
||
it('fails validation if both fromRecycleBin and skipRecycleBin is specified is a valid url', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('fails validation if both fromRecycleBin and skipRecycleBin is specified is a valid url', async () => { | |
it('fails validation if both fromRecycleBin and skipRecycleBin are specified', async () => { |
* @param url The URL to process. | ||
* @returns The URL without trailing slash. | ||
*/ | ||
removeTrailingSlash(url: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename to removeTrailingSlashes
since it removes multiple slashes.
Merged manually, thanks for fixing this issue! |
Closes #5218