dlively1/sf-packager

destinationBranch & sourceBranch

okram999 opened this issue · 14 comments

First, i have to admit its a nice handy project.

Can you elaborate more on what each of these branches are intended to be for? I dont see expected content of the package.xml and the components while using this node package.

My use case:
master branch: i have this branch as the metadata deployed to prod. Useing this as reference.
dev branch: where new changes are pushed into.

So, when i do sfpackage dev master ./deploy/, i dont see all the changes a part of it under the deploy folder created.

Also just curious, are you using this in your prod deployment? Does it support all the metadata's supported by the force metadata API?

Finally, looking at the components - it looks as though its deploying the full content and not what was only changed. Please confirm

This tool takes the file names that are output from running the git diff command against two commits (where a git "branch" is merely a pointer to a commit) and copies the entire file into your chosen directory.
Try switching around the branch references you are providing e.g.
sfpackage master dev ./deploy/ as you've said that master is your reference.
Assuming you are making changes in your dev branch and wanting to migrate those changes to master?

Is this a prod ready solution or just a prototype

I've been using it in prod, works great with the exception of two things that I've found:

  • It includes just the lightning component bundle resources that have changed in the deployment package. When deploying, Salesforce ends up deleting the unchanged resources (the ones not included). I end up having to copy those bundles over manually (and wish I knew how to fix it).
  • It doesn't include the required but empty package.xml for destructive changes. I end up having to create that manually.

It's a great tool - I wonder how others are building their release packages if not using this! Thanks Dan and Manu!

thanks @manuerwin @pyao-bwc - for the responses. I have some follow up questions.

  1. how much time does this tool take to generate the unmannaged package for you. For me, at the end of a release cycle, i have a git diff line count of around 1315465.

  2. Does this tool, generates the package.xml & components only for the changes of include everything. E.g. Say Opportunity.object, if i added only a field - does it generate the package with the new field only. Or puts the entire opportunity.object. The same for profiles, permSets etc.

  1. We basically only have Apex and Lightning in our repository, so our diff is on the order of ~2k lines. It doesn't take much time at all to run.

  2. Can't comment as we don't track those metadata. I'd guess it was the whole file, though.

Hi All,

I am trying below steps but it is not producing the expected results.

  1. Git clone the Master Branch
  2. Git clone the INT Branch

then i am issuing the command sfpackage master INT ./deploy/ command but it is only generating the blank package.xml with out any files or changes.

I have no idea how to use this tool. I'm using the commands given in the readme, but no directories or files are created. I'm getting "File name "src/destructiveChanges.txt" cannot be processed, exiting". I'm not sure where the issue is. Are there better instructions available?

@jagrelot what happens when you run the following command?

git --no-pager diff feature-branch dev-master --name-status

Where feature-branch and dev-master are the two branches you are comparing?

I get the list of the metadata that was added, deleted or modified. When I run the sfpackage dev master ./deploy/ command this is the last line in the console "File name "src/destructiveChanges.txt" cannot be processed, exiting"

Is src/destructiveChanges.txt part of your repository?

If so we might need to exclude that, similar to how the src/package.xml is ignored

sf-packager/index.js

Lines 78 to 81 in 58cc1f9

//ignore changes to the package.xml file
if(fileName === 'src/package.xml') {
return;
}

I added an if statement and now I am acutally able to produce something. Thanks!
if(fileName === 'src/destructiveChanges.xml') { return; }

@jagrelot awesome, great to hear.

Feel free to open a pull request and I would be happy to bring in the changes.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.