CumulusCI
CumulusCI copied to clipboard
Inject Username for Tokens On Deploy
Feature Type
I'm interested in extensions to existing CumulusCI functionality (e.g., broader applicability of an existing Task or Flow).
Does your feature request solve a current problem?
Currently, AuthProvider metadata requires an executionUser which must be a Salesforce username. This is difficult to do dynamically without writing scripts to pull the username and set the username before a metadata deployment.
Describe the solution you'd like
It would be helpful to have this injected on deploy similar to namespace injection.
Describe alternatives you've considered
- Looked into creating a script to get the username and set an environment variable using the command task, but as @davidmreed describes, this isn't possible within a subshell. Even tried using
sourcewith no luck.
Additional context
- Found others with the same issue: https://salesforce.stackexchange.com/questions/363730/issue-on-deploying-authprovider
- One concern I have thought of but don't have an easy answer for how to specify different users if you don't want the username of the running user. Also theoretically you might want other data about the user besides the username for other usecases.
@Julian88Tex How would automation determine which Salesforce username to inject upon deployment? Is it guaranteed to be the scratch org user? Or would the automation engineer need to specify in all cases?
@davidmreed A fair question I thought about some. I feel like for an MVP injecting that username for the running user makes sense. Theoretically, if you are creating additional users you'd probably know their username. The trickiest one is the user-created by the CLI since the username is random.
I could see a phase 2 of this feature include some parameters in cumulusci.yml in order to set a user to be injected similar to the namespace.
@davidmreed Oooo this exists now? https://github.com/SFDO-Tooling/CumulusCI/blob/5b07db38b3262520da3a177dd063352ead16cdf4/docs/history.md?plain=1#L13
Sure does. Closed in #3460, kudos to @TheBitShepherd.