SFDO-Tooling / CumulusCI

Python framework for building portable automation for Salesforce projects
http://cumulusci.readthedocs.io
BSD 3-Clause "New" or "Revised" License
363 stars 242 forks source link

`update_admin_profile` task fails on namespaced org with Person Accounts enabled #3762

Open asbestossupply opened 8 months ago

asbestossupply commented 8 months ago

Describe the bug

I am developing a namespaced, unlocked package with a dependency on a package that requires Person Accounts enabled. When using a namespaced org, the update_admin_profile task (which is used in important CCI flows such as dev_org) is failing. This does not occur if I use a non-namespaced org.

Reproduction steps

  1. Ensure the project has a namespace defined in cumulusci.yml:
    project:
    name: MY-PROJECT
    package:
    name: MY-PROJECT
    api_version: "59.0"
    namespace: MY_NS
  2. Add a dev_namespaced org to cumulusci.yml:
    orgs:
    scratch:
    dev_namespaced:
      config_file: orgs/dev.json
      days: 7
      namespaced: true
  3. Ensure the orgs/dev.json has Person Accounts enabled:
    {
    "orgName": "MY-PROJECT - Dev Org",
    "edition": "Developer",
    "features": ["PersonAccounts"],
    "settings": {
    }
    }
  4. run cci flow run dev_org --org dev_namespace
  5. Error:

Error: Could not process MDAPI response: Update of Profile Admin: Error on line 644, col 29: In field: recordType - no RecordType named Account.Business_Account found

Your CumulusCI and Python versions

umulusCI version: 3.84.3 Python version: 3.12.2

Operating System

MacOS 14

Windows environment

No response

CumulusCI installation method

pipx

Error Gist

https://gist.github.com/asbestossupply/1ae948bcce20b1e62ab4f1674824ff0e

Additional information

No response

asbestossupply commented 8 months ago

Apologies, this seems like a duplicate of #3544

I did notice something interesting though. After creating the namespaced org there's a discrepency between PersonAccounts and Non-Person Accounts - the former have a namespace applied but the latter do not:

image

And from what I can tell, the update_profile task is setting the namespace on all types. This would explain why the failure only occurs in namespaced orgs and is on the Business_Account type since it is not namespaced.