rustfmt-check icon indicating copy to clipboard operation
rustfmt-check copied to clipboard

possibility of race condition in commit mode?

Open pdeva opened this issue 10 months ago • 1 comments

can this action run in this race condition when in commit mode?:

  1. commit A is pushed in a PR
  2. rustfmt-check is running and detects it needs to push a commit with formatted rust code and pushes commit B.
  3. meanwhile user pushed commit C with new code.
  4. commit B from rustfmt-check arrives later than commit C, and this commit B ends up overwriting commit C.

pdeva avatar Apr 22 '24 03:04 pdeva

B from the rustfmt-check would be rejected if it's pushed after C.

We would have to explicitly set force with updateRef to overwrite.

mbrobbel avatar Apr 22 '24 09:04 mbrobbel