Open chaoscreater opened 7 months ago
This is another case where we run into problems because of the limited information we have as a browser extension.
It's a slightly complicated process that'll unfortunately cause a bit of UI flashing (see below), but I see the value. I'm not sure if I'll get around to implementing it, but until then, a workaround would be to use a parameter to toggle the stages instead - parameters are cached in AZDO natively:
(not particularly interesting for anyone who isn't trying to implement this)
It looks like AZDO handles the stage selection by adding a stagesToSkip: ["stage_id_1", "stage_id_2", ...]
entry to the POST payload when starting the run.
This means we'll either have to i) re-implement the "Run" button ourselves (a non-starter, since we don't have access to the necessary information), ii) modify the POST request after it's been sent (no longer possible in Manifest v3, thanks to Google), iii) hook into the client-side data AZDO uses to track which stages to skip (non-starter since it's handled entirely within AZDO's React, not using DOM inputs), or iv) emulate the UI interactions that would set the given stages (will cause UI flashes, but looks like the only possible solution).
Emulating the UI is possible, but a bit complicated because it's purely a loop of "observe DOM changes, interact as needed, hope nothing unexpected happens". Specifically it'd probably be a process of:
.bolt-portal-host
element for new direct descendants. If it's a pipeline run popup, continue.The most complicated part is the repeated use of observers pausing the process, since that's not a pattern that's generally supported (but isn't incredibly hard to implement), and it requires a lot of cleanup in case the user closes the popup at some arbitrary point in the process.
Hi again,
I'd like to make another feature request please. When I run a pipeline, I get to choose the stage I want to run and by default, all stages are ticked, which isn't what I want. Any stage that has the "apply" name should be unticked and users can manually tick it if they choose to run it. Here's an example of what I mean:
You can run a pipeline at the root level:
OR you can drill down into a specific pipeline run and do a new run:
Either of those will present the same panel as the first screenshot.
I tried to write a userscript for this and it's not very consistent. It will always untick the tickbox for the panel that is open under the specific pipeline run, but will only untick the tickbox for the panel opened under the pipeline root ONLY when the page is refreshed. Also, I can't figure out how to get it to untick the tickbox just once, as I need to be able to manually tick it if I want to run that stage. I'm terrible with Javascript and this is what I've got, maybe it might help?