Open shawntabrizi opened 3 years ago
The merging of master should happen in prepare branch which is executed before the benchmark is ran
You're suggesting it should also happen again before the push is made?
https://github.com/paritytech/bench-bot/blob/ee7bf897d75d90dae0e3d7fcd8d68c85edd4fefc/bench.js#L374
when you run the benchmark bot, you must be very careful not to push any changes, no matter how trivial to the branch, or else your benchmark results will not get comitted
Is it because the history gets desynchronized with the commits on the remote ref? Having the bot pull the commits just before pushing is an idea to counteract that.
One note about the merging of master: I thought the idea of doing that before the commit was so that the results are representative of how the code is going to perform after merging into master. If we pull commits after running the benchmark, then its result is not taking into account the new changes; thus another way of going about this would be to pull again and restart the benchmark if some change is detected to the HEAD sha of the pull request.
@joao-paulo-parity yeah you are right. We dont want to commit the benchmarks if there is some underlying logic that has changed. But probably we want to detect there was a latest commit (if that is possible), and stop the current benchmark, and report all that.
Not high priority, but just a little better experience i think.
when you run the benchmark bot, you must be very careful not to push any changes, no matter how trivial to the branch, or else your benchmark results will not get comitted
FWIW we should be reporting failures due to pushes:
https://github.com/paritytech/bench-bot/blob/11b9240228c8608062b1c1cf9fe8aec70634fedd/bench.js#L431
That is what's expected to happen if you were to push changes while the bot is running a benchmark because, at the end, the bot will not be able to do git push
with the weights since the branch has become outdated.
The following part is not covered, though:
and stop the current benchmark
So when the pull request's commits gets updated, we should either:
So I would be in favor of just stopping the benchmark when there are new commits on the PR branch. This would be the most flexible approach.
when you run the benchmark bot, you must be very careful not to push any changes, no matter how trivial to the branch, or else your benchmark results will not get comitted.
I believe this is because we are missing a simple
pull
/merge
operation before we callcommit
.Of course the bot should not try to handle any merge conflicts on its own, but should certainly be able to commit changes to anything that has a clean merge.