solenopsis / Solenopsis

A deployment tool for Salesforce
http://solenopsis.github.com/Solenopsis/
Other
104 stars 41 forks source link

bot files fail to deploy after version is activated #280

Open pcon opened 2 years ago

pcon commented 2 years ago

It appears that when running a delta-push bot files are trying to be re-deployed after they have been pushed and activated. The delta-push command should not include a .bot file in it's push if the same bot file exists in the target org

sfloess commented 2 years ago

@pcon - what's the severity on this? Specifically asking so I can prioritize my time :) Super busy at work, but if this is a blocker, I will do my best :)

pcon commented 2 years ago

@sfloess it's pretty high priority. It requires us to disable the bot to do the push. Which with the bot getting ready to go live will cause problems.

sfloess commented 2 years ago

@pcon - will see what I can do sir.

sfloess commented 2 years ago

@pcon - haven't looked a this yet so forgive the question if it'll be obvious :) How does one know it's the same bot file?

pcon commented 2 years ago

@sfloess I haven't had much time to dig into it, but each bot file has a botVersions section that defines the version. I think what is happening is that Solenopsis is just pushing all the .bot files all the time regardless of if it's changed or not. Or something like that. When the bot is marked as active (this has to be done in the Lightning Experience view) the deployment fails because it's trying to redeploy an active bot.

sfloess commented 2 years ago

@pcon - OK gotcha. I'll look more closely, but this gets me on the right track :)

sfloess commented 2 years ago

@pcon - may need your help here. What do I do to reproduce this. I tried a pull-full and then delta-push. I am betting there is some setting someplace (UI or otherwise)?

[sf:deploy] -----------------------------------------------------------------------------------
[sf:deploy] Component Failures:
[sf:deploy] 1.  bots/RedHatChatBot.bot -- Error: Not available for deploy for this organization
[sf:deploy] -----------------------------------------------------------------------------------

I googled and tried to enable einstein bots but am not finding that in the web UI.

sfloess commented 2 years ago

After meeting w/ @pcon to enable bots:

sfloess commented 1 year ago

@pcon - reproduced this with my sandbox...onto a fix :)

sfloess commented 1 year ago

@pcon - out of curiosity, do you know what in the .bot file denotes it is active?

sfloess commented 1 year ago

@pcon - looks like it may be driven by isActive in LiveChatButton.

pcon commented 1 year ago

I think that we just need to do a pull and see if the version number already exists in the deployment. If it does remove the entire botVersions stanza with the same fullName and not try to redeploy it. However, I'm not sure if SFDC would consider that a removal or not...

sfloess commented 1 year ago

@pcon - I don't recall seeing a version number in the meta data bot file. Are you referring to something else?

sfloess commented 1 year ago

@pcon - are you talking about this:

    <botVersions>
        <fullName>v1</fullName>
pcon commented 1 year ago

@sfloess yeah that's the field

sfloess commented 1 year ago

@pcon - thanks bro! I was assuming so - trying to get this done now. Cannot believe how far removed from all this I feel atm :)

sfloess commented 1 year ago

@pcon - I think we are in business! Mind testing my branch sfloess_issue-280? I tested it locally, but I'd like your official blessing.

pcon commented 1 year ago

I'm out until next Wednesday. Might want to reach out to Preeti to see if she can test it. She's doing all the bot development anyway

sfloess commented 1 year ago

@pcon - certainly! I didn't realize you were out!

sfloess commented 1 year ago

@pcon - when you return and have time: I note the master branch is protected and required an approver? Not sure if you set this or not. Regardless, this will break builds (it broke on this resolution) as the build needs to update the spec file and tag in git.

I disabled to get the build to pass, but wanted to reach out and let you know (just in case we want that re-enabled).

sfloess commented 1 year ago

Re-opening as this is still a problem.