flxbl-io / sfp

A build system for modular development in Salesforce
https://docs.flxbl.io/sfp/
MIT License
26 stars 13 forks source link

Increase wait time until checking if PSGs are updating #70

Closed dschibster closed 2 months ago

dschibster commented 2 months ago

Describe the bug Bringing up this issue again: https://github.com/flxbl-io/sfp/issues/60 It has now happened regularly that sfp "successfully" checked that no PSGs are updating, only for the PSG update status to come after sfp is done This happens non-deterministically, because the time between the two packages, and the time that Salesforce needs to recognize the "update" vary. Therefore I would suggest slightly increasing the wait time until checking the PSGs, or placing the PSG check further down in the deployment preparation.

To Reproduce Create two artifacts, the first one containing a PS and a PSG that contains that PS. The second one overrides a PS that is contained within that PSG with a new value (for example external credential access). In my case, the second artifact is aliasified, but I think that it doesn't make much of a difference

When releasing both at the same time, sometimes after deploying the first one, the second one will fail due to the status of the PSG still being Updating

Expected behavior sfp should properly pull the status of the PSG and wait the required amount of time until deployment.

Screenshots image

Platform Details (please complete the following information): latest ghcr container on Azure DevOps, local runner

Additional context I guess that this is mostly a timing issue, so including a wait time there may make sense? Maybe there is simply a way to switch around the order, or to check directly before issuing the install command.

azlam-abdulsalam commented 2 months ago

Thanks @dschibster , it should actually wait till all of these are updated. This is interesting behaviour, i think salesforce is reporting no PSGs are updated. Will definitely look into it

dschibster commented 2 months ago

@azlam-abdulsalam It would either be that, or it may very well be that the PSGs start updating themselves after your PSG query is done - meaning that there would be a time difference

dieffrei commented 2 months ago

@dschibster have you seen "Outdated" status on permission set group, after any permission set update? Would be possible to check it? My guess is: After PSG update, SF async process is too slow, the SFP query doesn't detect any "updating" PSG status, but maybe PSG got "Outdated" status, until move to "Updating".

dschibster commented 2 months ago

I wasn't quick enough to check. Once it comes up again I could check but not right now unfortunately.