Brewtiful Beans Meets Warden, Part 1: Roasted in the Sandbox
The holiday rush is coming to Brewtiful Beans. Gift subscriptions double every December, and Dana, the Support lead, needs a seasonal crew answering cases by the fifteenth.
Joe has spent a week in the dev sandbox building a Support persona: the Service_Console and Reports_Viewer permission sets plus the Support_Cases queue. It works in the sandbox. Now it has to get to production, and Joe would rather not rebuild it from memory, one Setup screen at a time.
With warden-base installed, personas live in the org as records. That means they can move between orgs as a file.
Pack it up
Joe exports the sandbox’s active personas:
sf warden persona export --output personas.json --target-org bb-dev
Exported 2 personas to personas.json
Two personas, though he only built one. He opens a pull request with the file anyway. Persona definitions belong in Git, where a teammate can read them.
Taste before you pour
Before he imports anything, Joe asks production what would change:
sf warden persona diff --input personas.json --target-org bb-prod
Added: 1
Removed: 0
Changed: 1
+ Support
~ SalesRep
Support is new, as expected. But SalesRep has changed too, and Joe didn’t change it.
A quick message to Sales Ops explains it. Someone added a permission set to SalesRep in the sandbox while testing a forecasting app. That change was never meant to reach production. Joe removes it from the file, re-runs the diff, and gets the line he wants: one persona added, nothing else.
persona diff is read-only. It is the cheapest place to find a surprise.
Ship it
sf warden persona import --input personas.json --target-org bb-prod
Import upserts each persona by API name and adds any missing components. It doesn’t delete components that are missing from the file unless Joe passes --prune, and that is the flag he’d preview with --dry-run first. The import also requires the wdn_Persona_Publisher permission set, so not every admin with a terminal can push personas into production.
Dana’s crew now has a persona waiting for them in production. Next, Joe has to create the users.
A persona you can diff is a persona you can trust in production.
Warden is a free, open-source Salesforce CLI plugin for user lifecycle administration:
sf plugins install @syntax-syllogism/warden