-
Notifications
You must be signed in to change notification settings - Fork 69
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
Wr/unset alias config #874
Conversation
QA: core PR branch yarn-linked into plugin-org, plugins-linked into sf create scratch org w/ alias, assign it another alias. -- I think you're going to need to either use ConfigAggregator for these OR handle there not being a local (project) config same test as above, but in a project ❌ doesn't delete global configs (probably another thing solved by config=>configAggregator) |
QA: core PR branch yarn-linked into plugin-org, plugins-linked into sf create scratch org w/ alias WR3 and set-defualt, assign it 2nd alias WR4. same test as above, but in a project. Delete using -o username same test, Delete using -o alias (alias is the second alias, not the one used for org create) create and delete org with no alias and no config |
src/config/configAggregator.ts
Outdated
@@ -334,6 +334,13 @@ export class ConfigAggregator extends AsyncOptionalCreatable<ConfigAggregator.Op | |||
return this.config; | |||
} | |||
|
|||
public async unsetByValue(key: string): Promise<void> { | |||
this.localConfig?.getKeysByValue(key).map((k) => this.localConfig?.unset(k)); |
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.
My only concern about this is that parallel org deletes (think org list --clean
) could possibly muck up the config files because of the well-known concurrency bug.
it would be nice if we only did write()
if we knew that config had been modified.
config.unset
return true if it does unset the thing, so you could do something like
const globalIsModified = this.globalConfig?.getKeysByValue(key).map((k) => this.globalConfig?.unset(k)).some(Boolean)
QA: retested using tests from above, all still good in project and not in project ✅ |
What does this PR do?
when
Org.delete
is called, it will now unset any config values that reference the org (username or alias) and will unset an alias keys that are set to the org's usernameWhat issues does this PR fix or reference?
forcedotcom/cli#2237inv @W-13644800@bug @W-13700499@