-
Notifications
You must be signed in to change notification settings - Fork 393
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ability to remove expired orgs from the org list #3732
Conversation
We already had a command to remove dead scratch orgs (#2523), but that functionality isn't readily available to users, and it can be frustrating for new users to dig it up. Meanwhile the list of expired orgs only grows! This change surfaces that functionality in the org list directly, so users can view the commands that interact with their orgs from one spot.
@@ -172,6 +173,11 @@ export class OrgList implements vscode.Disposable { | |||
vscode.commands.executeCommand('sfdx.force.auth.accessToken'); | |||
return { type: 'CONTINUE', data: {} }; | |||
} | |||
case '$(plus) ' + |
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.
minor point (and nothing to do w/your PR), do you mind changing lines 156-159 to
return { type: 'CONTINUE', data: {} };
(this will match the other cases)
@@ -330,6 +330,18 @@ describe('Set Default Org', () => { | |||
).to.be.true; | |||
}); | |||
|
|||
it('should return Continue and call force:org:list:clean command if SFDX: Remove Deleted and Expired Orgs is selected', async () => { | |||
orgListStub.returns(orgsList); |
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.
I know this matches the other tests, but this doesn't appear to test the code. When it runs, the '$(plus) ' + nls.localize('force_auth_web_login_authorize_dev_hub_text')
case gets hit, not the nls.localize('force_org_list_clean_text') case.
I think this and the other tests should be audited, and verified that 1) they test the paths we are expecting, and 2) make sure we are validating the code, and not validating the mocking of the code.
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.
I spoke with Randi about this, and this isn't an issue. This case is supposed to hit the default case, so all is good.
What does this PR do?
We already had a command to remove dead scratch orgs (#2523), but that functionality isn't readily
available to users, and it can be frustrating for new users to dig it up. Meanwhile the list of
expired orgs only grows! This change surfaces that functionality in the org list directly, so users
can view the commands that interact with their orgs from one spot.
What issues does this PR fix or reference?
@W-10351429@
Functionality Before
The command
SFDX: Remove Deleted and Expired Orgs
was only available from the command palette.Functionality After
It's now easier to clean up stale orgs. 馃Ч