When the upgrade platform completes upgrading the backup and uploads it to your branch, the branch enters a special mode. In this mode, every time you push a commit to the branch, the system will restore the upgraded backup and update all the custom modules. This setup is designed to let you test your custom modules on a fresh copy of the upgraded database. Reference: https://www.odoo.com/documentation/17.0/administration/upgrade.html
Regarding your question about the third-party modules: If these modules were installed on the staging branch for the old version of Odoo, then yes, you'll need to update the version in the manifest file - and the whole module to ensure compatibility and trigger the necessary updates for the upgrade to complete successfully.