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: remove namespace if nonamespace option is set #1064

Merged
merged 1 commit into from
May 6, 2024

Conversation

mdonnalley
Copy link
Contributor

What does this PR do?

Remove namespace from ScratchOrgInfo payload if the nonamespace option is true

What issues does this PR fix or reference?

@W-15675379@
forcedotcom/cli#2855

@@ -216,12 +216,16 @@ export const generateScratchOrgInfo = async ({
// project is not required
}

const { namespace: originalNamespace, ...payload } = scratchOrgInfoPayload;

const namespace = originalNamespace ?? sfProject?.get('namespace');
Copy link
Member

Choose a reason for hiding this comment

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

so, originalNamespace comes from the definition file and takes precedence over namespace defined in sfdx-project.json.

it's doc'd for sfdx-project json but not for the definition file here
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm

I'll ask Juliet if we should add a note about it in docs.

@cristiand391
Copy link
Member

QA notes:

repro'd the issue with sf v2.40.7, running:

sf org create scratch -d -f config/project-scratch-def.json -a dreamhouse --duration-days 1 --no-namespace

and specifying the namespace in the scratch def. file, then sf org list --verbose to view the namespace in the scratch org.

--no-namespace works if you specify the namespace in sfdx-project.json.

✅ namespace in scratch org def. file, --no-namespace not passed, org created with namespace
✅ namespace in sfdx-project.json, --no-namespace not passed, org created with namespace
✅ namespace in scratch org def. file, --no-namespace passed, org created without namespace
✅ namespace in sfdx-project.json, --no-namespace passed, org created without namespace

@cristiand391 cristiand391 merged commit f90ab68 into main May 6, 2024
68 checks passed
@cristiand391 cristiand391 deleted the mdonnalley/remove-namespace branch May 6, 2024 14:53
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