Have to umount things before ubports-qa can work
Testing new PRs for the likes of lxc-android-config always requires unmounting various files/dirs overlayed by port specific changes before the install will go through; maybe these could be autodetected somehow and dealt with by the script and at the end of the install process do a reboot (or prompt for it)?
An example of this is for example:
sudo umount /lib/udev/rules.d/70-android.rules
sudo ubports-qa install PR_lxc-android-config_117
sudo reboot
Testing a new lomiri-system-settings change on the other hand will need e.g.:
sudo umount /usr/share/session-migration/scripts
sudo ubports-qa install focal_-_PR_lomiri-system-settings_427
Nowadays there's also some ports using overlaystore (https://docs.ubports.com/en/latest/porting/configure_test_fix/Overlay.html) now which allows porters to create arbitrary overlayfs mounts on practically any directory, for example any changes to /etc/profile.d files on Fairphone 4 requires one to get rid of the read-only overlay:
sudo umount /etc/profile.d
Perhaps the script could have a list of the already known ones to umount and at the end remount as well, including halium-overlay-* stuff which could be reconstructed from /opt/halium-overlay, but maybe not.