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鈥檒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

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

randi274
Copy link
Contributor

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. 馃Ч

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.
@randi274 randi274 requested a review from a team as a code owner December 22, 2021 21:42
@@ -172,6 +173,11 @@ export class OrgList implements vscode.Disposable {
vscode.commands.executeCommand('sfdx.force.auth.accessToken');
return { type: 'CONTINUE', data: {} };
}
case '$(plus) ' +
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

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.

@randi274 randi274 merged commit 607edff into develop Jan 3, 2022
@randi274 randi274 deleted the randi/make-removing-dead-orgs-easier branch January 3, 2022 21:15
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.

None yet

2 participants