aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/patch_sync/src/version_control.rs
AgeCommit message (Collapse)Author
2022-02-10patch_sync: Toggle CQ for CrOS, AndroidJordan R Abrahams
Currently, patch sync will always run CQ for CrOS, but never for Android. This was because the chrotomation bot didn't have the proper permissions to run the needed Presubmit-Ready checks. Now the bot does in fact have permission to enable the Presubmit check on Android, but some users may not have this permission when running locally. This commit introduces the ability to toggle running the presubmit/CQ checks early through the --disable-cq flags (by default it's assumed that running these checks is desirable). BUG=None TEST=patch_sync transpose --disable-cq <...> TEST=patch_sync transpose <...> Change-Id: I6185b98aa4394ba22f8433541885a450855cfbb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3451037 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-25patch_sync: Conduct unconditional cleanupJordan R Abrahams
After any sort of modification, we have to conduct a full cleanup of the workspace. While it's still possible to have a panic cause no cleanup, this is an improvement over the previous work, where cleanup could fail during the transpose stage. Also add a --wip mode to prevent spamming people with emails during testing. BUG=b:209493133 TEST=Running patch_sync transpose locally Change-Id: I01e8a5897ec8eeed8f90c528c567b2ba55613b23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3407914 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-14patch_sync: Bugfix for ebuild findingJordan R Abrahams
Previously, the find_ebuild function could return the original ebuild instead of the llvm symlink. This would lead to incorrect uprevs, depending on how the file system returned the order of the files. Adds a test case to prevent this from happening in the future. BUG=b:209493133 TEST=cargo test Change-Id: Ia47ecee2a9c5b6ce0559e316c5227f70dcf87833 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3379482 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-14patch_sync: Refactor shared main codeJordan R Abrahams
This commit attempts to remove duplicated code between Android and CrOS, as the complexity between this duplicated code exceeded the scope of the main file. Also adds display_patches code. This is to pretty print what patches are getting applied and to where. Only enabled if --verbose is on. Also does some minor function cleanup in version_control.rs. BUG=b:209493133 TEST=cargo test TEST=patch_sync transpose --dry-run --verbose <...> Change-Id: I63410160ff5159f4c079ac1cc189674fe3fc02a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3379481 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-13patch_sync: Commit featuresJordan R Abrahams
This adds several important version control features: * Changes branches on set up. * Cleans up any changes made, even if upload fails. * Sends commits for review (enabled via CLI). * Enables CQ for CrOS. BUG=b:209493133 TEST=cargo test Change-Id: I8ab2650aae301c08fd80358162a285e46d44e3e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3379479 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-13patch_sync: Add better command debuggingJordan R Abrahams
This commit allows the git commands to print out what the command was that they failed at. This is pretty helpful in debugging what went wrong. We don't capture the repo output ever, so that can remained piped to the terminal. But we need to do some trickery for the git cmd. BUG=b:209493133 TEST=None Change-Id: I389257fef1e3bf394fb4013588df6c78e83b733a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3379478 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Michael Benfield <mbenfield@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
2022-01-04patch_sync: Base code, version control managingJordan R Abrahams
This is the base code addition for the patch_sync project. This project attempts to synchronize LLVM patches and ChromeOS. This code is not meant to run, but simply be the starting point so that we break up the large code dump. This code is meant to compile, but is not meant to be run. It only adds the version control code which manages `repo` interactions. Additionally, this adds the full Cargo.toml (at least for the current patch stack). BUG=b:209493133 TEST=cargo build Change-Id: I903edba6e633ec53a7fa4d2e7b0c2aac1094933a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3339404 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Jordan Abrahams <ajordanr@google.com> Commit-Queue: Jordan Abrahams <ajordanr@google.com>