aboutsummaryrefslogtreecommitdiffstats
path: root/syz-ci
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-09-24 11:16:33 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-09-24 09:39:46 +0000
commit5643e0e933eb9fd69bb78740a8f3967b4d37bc0e (patch)
tree52dea103c932f902df404c5e9ab76917e3ea2c14 /syz-ci
parent89298aad70c7bd5d018a868dc31bc6ff4dca7f27 (diff)
syz-ci: reset to the build commit at restart
If we failed to build/test the current tip of the tree, it seems that we still stay on that commit, which may lead to problems in fix commit collection, coverage report generation and in determining the right people to Cc. Always reset to the last successfully built kernel commit before restarting a syz-manager instance. Closes #5333.
Diffstat (limited to 'syz-ci')
-rw-r--r--syz-ci/manager.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/syz-ci/manager.go b/syz-ci/manager.go
index cdbd6b40f..21941cfde 100644
--- a/syz-ci/manager.go
+++ b/syz-ci/manager.go
@@ -430,6 +430,13 @@ func (mgr *Manager) restartManager() {
mgr.Errorf("failed to load build info: %v", err)
return
}
+ // HEAD might be pointing to a different commit now e.g. due to a recent failed kernel
+ // build attempt, so let's always reset it to the commit the current kernel was built at.
+ _, err = mgr.repo.CheckoutCommit(mgr.mgrcfg.Repo, info.KernelCommit)
+ if err != nil {
+ mgr.Errorf("failed to check out the last kernel commit %q: %v", info.KernelCommit, err)
+ return
+ }
buildTag, err := mgr.uploadBuild(info, mgr.currentDir)
if err != nil {
mgr.Errorf("failed to upload build: %v", err)