“Next application release” in the text above = set of all artifacts in the package: any instructions, RAPs with application code, DL’s with HotFIxes, etc. It is clear, that HotFix is a separate artifact.
The first approach mentioned is correct, though with a little twist.
Let's discuss HFix,
Hotfixes address general PegaRULES Process Commander (PRPC) issues related to security, enhancements, and errors that may occur in rules and/or code(those rules part of base PegaRULES application). When user takes a RAP or product rule for migration/deployment in the higher environment, it includes only built on application(your application ruleset not PegaRULES), refer below:-
Thus, the changes made by the Hfix didn't get migrated irrespective of committed or not.
Now let us come to your point 2 of the first approach:-
Ideally, if you don't want to face the reported issue in the lower environment, it's better to install all the hotfixes installed earlier of DEV environment in each Test/Staging/Pre-Prod/Prod environments.
Again, there is no specific order. Either you can install all the Hotfixes before deploying RAP in the new environment or after.
Hope it clarifies all your queries. Kindly mark as answered if it does.
Thanks for your answer. Some time ago I had a directly conversation with several PEGA’s TSA.
There are several important points regarding HotFixes:
1. The same DLs must be used for all environments, because within the time each HotFix may change dependencies. And new DL with the same HotFix may have 9, 10… etc dependent HotFixes. So, result for different DLs for the same HotFix may differs.
2. DL must be applied at the same order at all Environments.
3. Generally HotFixes must be applied before the application RAPs loading, because some HotFixes have additional steps like Re-validation (via wizard) of the specific RULE-types (including developed application). So, in this situation we must install HotFix, re-validate existing code and after that install RAP-files of application, which have the re-validated rules from Dev already.