My package.xml was 40,000 lines. The CLI just gave up.
Architect in Progress
0:00 / 0:00
My package.xml was 40,000 lines. The CLI just gave up.
26 просмотров · 2 нед. назад
Architect in Progress
12 подписчиков
26 просмотров · 2 нед. назад
A Metadata API retrieve caps at 10,000 files and 39 MB. An enterprise org is bigger than both, so you have to split the manifest. Everyone splits it by metadata type — one file for ApexClass, one for CustomField, one for Flow. It's readable, it's stable, and every check you'd think to write says it worked.
It also quietly deletes most of your objects.
A custom field isn't a file. In metadata format it lives inside its object's .object file. Put CustomField and ValidationRule in separate manifests and every object that has both gets rebuilt by four or five separate retrieves — and when you merge the results, the last one wins. The retrieve succeeded. Nothing errored. The object came back with a fraction of its fields.
This is that bug, the tool that catches it, and the 48 hours it cost me years ago.
I'm Kripa, a Salesforce Technical Architect in Sydney.
CODE
Splitter, verifier and retrieve driver. Python 3, standard library only, runs on Mac and Windows. The manifest generator is in there too, so you can reproduce all of it without pointing anything at a real org:
https://github.com/kripaSFDC/sfdx-pac...
CHAPTERS
0:00 The error nobody could explain
1:49 Three caps, and the one everyone miscounts
3:10 Read the manifest
3:58 Split it by type
6:20 The verifier says FAIL
9:41 Why it breaks
10:52 Atoms
12:28 Pack and pass
15:13 The profile trap
17:16 Retrieve for real
19:07 The mistake
22:17 The close
THE ONE LINE TO TAKE AWAY
A split that loses nothing can still be wrong — and "retrieve succeeded" is not
the same as "you got your org".
---
NEXT SATURDAY
Your org looks like one giant lump of metadata. I'll show you the one setting
that's making it look that way.
---
I'm Kripa, a Salesforce Technical Architect in Sydney working toward Enterprise
Architect. One video every week: a real problem, the real code, and the honest
lessons — including the ones from bad jobs.
Subscribe if you're technically strong but stuck.
GitHub: https://github.com/kripaSFDC
---
All views expressed are my own and do not represent any employer or client.
All code is written in personal developer orgs. No client or employer
information appears in this video. The package.xml used throughout is generated
by a script in the repo.