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

fix: org create command to sf style #5295

Merged
merged 11 commits into from
Jan 4, 2024

Conversation

CristiCanizales
Copy link
Contributor

@CristiCanizales CristiCanizales commented Dec 26, 2023

What does this PR do?

  • Updates org create commands and flags to SF style in order to get rid of cli warnings

What issues does this PR fix or reference?

@W-14700670@

Functionality Before

  • org create commands in sfdx style

Functionality After

  • org create commands in sf style

@CristiCanizales CristiCanizales self-assigned this Dec 26, 2023
@CristiCanizales CristiCanizales marked this pull request as ready for review December 26, 2023 15:22
@CristiCanizales CristiCanizales requested a review from a team as a code owner December 26, 2023 15:22
Comment on lines 60 to +65

public withJson(): CommandBuilder {
public withJson(logLevel: boolean = true): CommandBuilder {
this.args.push('--json');
this.args.push('--loglevel', 'fatal');
if (logLevel) {
this.args.push('--loglevel', 'fatal');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are now using the SF_LOG_LEVEL environment variable instead of the deprecated --loglevel flag, is this change necessary? Or is it ok to just take out the --loglevel flag entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that flag is still used in other commands, so I'd keep it until the very last moment when we actually change from sfdx to sf or when no other commands are left to be transitioned

.withArg('org:create:scratch')
.withFlag('--definition-file', `${scratchDefFilePath}`)
.withArg('--set-default')
.withJson(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we want JSON anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we want it, the false is just to evaluate the addition of --loglevel

const createCommand = forceOrgCreateBuilder.build({
file: path.join(workspaceUtils.getRootWorkspacePath(), CONFIG_FILE),
alias: TEST_ALIAS,
expirationDays: TEST_ORG_EXPIRATION_DAYS
});
expect(createCommand.toCommand()).to.equal(
`sfdx force:org:create -f ${CONFIG_FILE} --setalias ${TEST_ALIAS} --durationdays ${TEST_ORG_EXPIRATION_DAYS} --setdefaultusername --json --loglevel fatal`
`sfdx org:create:scratch --definition-file ${CONFIG_FILE} --alias ${TEST_ALIAS} --duration-days ${TEST_ORG_EXPIRATION_DAYS} --set-default --json`
Copy link
Contributor

Choose a reason for hiding this comment

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

This command uses JSON, which is why I'm asking about .withJson(false) in the other command.

Copy link
Contributor

@daphne-sfdc daphne-sfdc left a comment

Choose a reason for hiding this comment

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

Approved! 🎉

SFDX: Create a Default Scratch Org

@CristiCanizales CristiCanizales changed the title fix: org create commands to sf style fix: org create command to sf style Jan 4, 2024
@CristiCanizales CristiCanizales merged commit e795f26 into develop Jan 4, 2024
14 checks passed
@CristiCanizales CristiCanizales deleted the cristi/w-14700670/org-create-to-sf branch January 4, 2024 19:03
peternhale pushed a commit that referenced this pull request Jan 5, 2024
* fix: org create commands to sf style

* chore: loglevel flag to SF_LOG_LEVEL env var

* chore: loglevel

* chore: -f to --definition-file

* chore: conflict after conflict resolution

* chore: conflict after conflict resolution

* chore: weird file
daphne-sfdc added a commit that referenced this pull request Jan 16, 2024
* fix: suppress warning for apex w/no coverage

@W-10288513@

* chore: wip

* chore: wip

* chore: extract colorize for testability

* chore:  more optimizations

* fix: org create command to sf style (#5295)

* fix: org create commands to sf style

* chore: loglevel flag to SF_LOG_LEVEL env var

* chore: loglevel

* chore: -f to --definition-file

* chore: conflict after conflict resolution

* chore: conflict after conflict resolution

* chore: weird file

* fix: correct log file name formatting error (#5316)

@ W-13682486@
fix logfile name formatting error
ensure the directory to the logfiles is present

* chore: update to version 59.12.1

* chore: generated CHANGELOG for release/v59.12.1

* chore: update changelog

* chore: update changelog

* chore: update changelog

* chore: update changelog

* chore: updated SHA256 v59.12.1 [skip ci]

* chore: wrong commands in package.json (#5317)

* chore: update to version 59.12.2

* chore: generated CHANGELOG for release/v59.12.2

* chore: update changelog

* chore: updated SHA256 v59.12.2 [skip ci]

* fix: default SF_LOG_LEVEL to fatal (#5318)

* chore: fix merge of develop

* chore: add setting to control ui warnings

Added a setting that allows user to disable coverage warning ui

* chore: handle coverage exception in central spot

Pass all coverage exception through single handler

* chore: tweak exception handler for colorizer

* Update packages/salesforcedx-vscode-apex/package.nls.json

Co-authored-by: Daphne Yang <[email protected]>

* chore: remove extra space

---------

Co-authored-by: Cristina Cañizales <[email protected]>
Co-authored-by: Release Bot <[email protected]>
Co-authored-by: Daphne Yang <[email protected]>
Co-authored-by: Daphne Yang <[email protected]>
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.

3 participants