Repository navigation
Force push when synchronizing submodules - #4426
Merged
Merged
Conversation
ScottTodd
approved these changes
Jan 8, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of adding a new commit that fixes up the submodules, rewrite
the HEAD commit so that they are correct. This action was originally
intended for rare cases where Copybara messed up integrations. These
"rare cases" now happen multiple times a day and are cluttering the
repository history with useless commits. We have already decided it's
ok to rewrite the google branch history to fix up Copybara failures to
create merge commits, so this doesn't change things much. It also
us to expand this action to create those merge commits as well.
Somewhat incidentally, I noticed that this action doesn't actually need
to initialize the submodules themselves. It only really deals in
hashes, which are already recorded. Dropping this makes it ~10x faster.
This has a couple disadvantages:
that introduces a submodule diff, the changes will get erroneously
attributed to the current HEAD commit. The rate of pushes to this
branch is pretty low, so I don't think that will happen to
frequently. I can work on some more complex logic that walks the
history instead.
more frequently will make things difficult for them. This branch is
only intended for the export from google source control, so the only
people who should care about it are build cops and maybe googlers,
and I think the inconvenience will be minor.
when it can be safely merged into the main branch. This action runs
in about 10 seconds and quickly reports a failure (plus you can see
the pending status as well), so I think this isn't likely to happen.
Tested:
.
Ran this on my fork. Initially pushed a cherry-picked version of
78170d0a58fe
The check action failed on this, marking it with an "x"
(https://github.com/GMNGeoffrey/iree/runs/1666244136) and the
synchronize action fixed it up
(https://github.com/GMNGeoffrey/iree/runs/1666187868)
with the final result being
GMNGeoffrey@ec9e72364088.