[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] GROOVYJOSHCLARK:
This is how I do it and it works flawlessly for 8/8.1/9/10. One thing to note that I always wipe the device which means you must backup everything to PC prior. I backup all MMS/TXTs using Carbonite to my internal storage (which is saved as flat XML files) that's then copied as part of my SD (internal storage) to my PC. Then I copy the entire thing from my PC back to my internal storage after I reset the firmware (both slots), then wipe and install the OS (last step) then I reinstall Carbonite and recover my TXT/MMS (note that I put it in airplane mode during the recovery using Carbonite as you have to change the messaging app to use Carbonite which means NEW incoming messages are lost as Carbonite isn't a txt app). To minimize the possibility of losing incoming SMS/MMS, I use airplane mode so it stops incoming until the restoration completes, once it completes, I make Google messaging (or whatever you use for texts) the default app then I'll disable airplane mode.

The rest of my steps below is copied/pasted from my original source so ignore if there's references to other OS's (this is still the same process I use for any and ALL ROMs) and is applicable:

This is how I install (and I have one of the crazy pixel 2 XLs that bootloops a lot), but using the method below works flawlessly across all ROMs (9 and 10).

My process is this, first I switch to slow-a, then I flash the official Google firmware for whatever the date is on the ROM (UNLESS dev states otherwise and/or to use a different firmware), for example, if the ROM was released in August/Sept 2019 (which the last Bliss was 9/20/2019), I flash the firmware for Google, August 2019 (which was the LAST before 10 so I knew this was the right vendor/firmware). I flash to BOTH slots WITH the wipe to BOTH slots.

I backup data prior to PC of course (with backing up MMS/TXT use carbonite which saves to XML) and then copying the entire SD (Pixel 2 storage) to my laptop and compare the stats (to ensure I captured everything).

I edit the flash-all.bat and pull out the lines, 1 at a time in a CMD windows with ADB and the firmware in focus (CD'd to that directory or path), boot, radio, then system all taken directly from the batch file with rebooting to bootloader from the device after each line completes. I watch the 3rd line as thats the one that wipes, then reboots, and immediately after the first slot is completed, it reboots to OS (but we dont want that to happen yet), so I am watching and waiting for that step. As soon as I see the vendors flash, I get ready to catch the process and about to hold volume down+power the very second it reboots. As soon as it reboots, I am holding power+volume down so it catches the reboot and enters bootloader again. At this point the first firmware has completely flashed slot-a. Then (back in bootloader), I switch to slot B through ADB, redo the entire thing, line by line (copied from the batch), let it boot into OS, no pin, go right through the setup without setting anything (no Google, no pin, nothing). Then for extra safety, I enable dev options just in case and turn off, apply update on reboot, then copy ROM/TWRP to internal SD (Pixel storage) from my PC, fastboot into twrp, flash the twrp installer zip I just copied, then do a twrp factory reset with the swipe bar, then flash ROM zip, then flash twrp again and let it boot into system. At that point it boots and I will setup the device, then install just the magisk app. Within magisk, I choose install, patch boot image (boot.bin was extracted from payload.bin), then fastboot flash boot WHATEVER.magisk.bin in bootloader again, then boot OS, go to Magisk, and all is done.

No issues, BUT before I started using this method, I would have bootloop issues across the board with pretty much ALL ROMs. Hope helps cut down on the issues and for me, it works with 9 and 10. I havent bootlooped since using this process.

*** NOTE ***

I have added a new step in the last step of recovery (before rebooting to OS). Now I reboot TWRP (to switch slots) and install magisk as part of the process so it doesn't encrypt and force encrypt but this is ONLY after I use the base April 2019 9 firmware then dirty the OTA to the latest version needed for the ROM (ROM specific so go by my original post about using whatever the date of the ROM is it or whatever the dev recommends). Again the process to prepare the base without encryption is to simply flash-all April (FULL FIRMWARE, not the OTA version) factory image with -w, boot up once from the April firmware, then follow the TWRP boot.img (ADB) and then dirty update with the OTA in TWRP, to dirty the OTA, in TWRP go to advanced, apply OTA then ADB push the OTA, Google how to do it if you need help with that but its easy), DO NOT BOOT THE OTA VERSION, stay in TWRP and just start the entire process of cleaning from step 1). That way you end up with a magisk install without forced encryption but still pass safetynet.

*** NOTE ***

If you're not taking nandroids nor care about encryption then ignore this note. It works fine without doing this extra work and not everyone cares about encryption (see Magisk pic):

SIDE NOTE, Havoc ROM (This ROM) is my daily driver, its the only ROM I found that passes safetynet, with no issues, or problems, its stable as can be and works flawlessly. I use Havoc for my 9 DD and ABC or PD for 10 (but pretty much only use 9 and this ROM for the stability aspect of it). Havoc has every option I need, and has all customization tweaks I need built right in, so for me, this is the only ROM worth using as a DD, I like all the others, but this is my go-to 9 ROM for my Pixel 2 XL.