I'm working on a stack of 10ish branches and I've ...
# how-do-i
g
I'm working on a stack of 10ish branches and I've CI optimisations turned on (see image). We run our CI checks on Github actions which charges you a minimum a minute for each run. We currently have 3 actions (unit-test, lint, integration-test) so if I restack on top of our main branch and submit then we'll be billed for 24 minutes (8 middle branches * 3 actions) of CI time that's useless to us. Are there any best practices here for how others have improved this?
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
Hey George, have you looked into the graphite merge queue at all? there are a number of additional optimizations there that could reduce the number of CI runs if you are looking to be economical.
g
Thanks I'll take a look, I've been meaning to anyway. I'm a little confused by the fast-forward optimisation described here https://graphite.dev/docs/merge-queue-optimizations I thought the unit the merge queue deals with is a stack, so why would it be running CI on all the PRs in the stack? This seems like it's still going to be making unnecessary CI runs if I want to merge a stack as one? This may be related to another question I have, when merging a stack with multiple branches is there a way for all the commits to land at once (without squashing)? The commits usually represent meaningful units of work so I'd like them kept, but it means that the merge takes a long time and also triggers our pre-prod pipeline for every branch in the stack rather than just the tip, which is ultimately all we really care about (and is the behaviour I'd get if I merged the tip of the stack directly into our main branch)
p
I thought the unit the merge queue deals with is a stack
Thats correct if assuming you have the CI setting turned on to run on the topmost pr of the stack. It is possible to not have this turned on.
is there a way for all the commits to land at once (without squashing)?
You have the option to choose your merge strategy in the merge queue settings.
g
Which setting will make all the PRs land at once into the main branch on merge?
p
The setting for this ^^ is actually the fast forward merge. Run on all PRs in a stack in parallel and the FF merge (the general git concept, not a graphite specific thing)
g
Thanks, is it possible to get this behaviour without using the merge queue? i.e. on a normal stack merge
p
No, in a regular stack merge we merge a stack of PRs from the bottom up via the GitHub merge API, rebasing the rest of the stack as PRs are merged.
g
Cheers