aboutsummaryrefslogtreecommitdiffstats
path: root/syz-ci
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-10-04 11:18:10 +0200
committerTaras Madan <tarasmadan@google.com>2024-10-10 15:39:25 +0000
commitcd942402d6bc82fa3ea87e5c43509e1ec6cfafe2 (patch)
tree4bcd4b26ad9f9a1a79d6530b2bc0bdccc1ea1015 /syz-ci
parentd7475276a82f2dbec772bce46ac82ce370fb4bef (diff)
syz-ci: introduce gitArchive parameters
Some commits don't live long remotely. It sometimes happens we need them later to: 1. Merge coverage. 2. Mention during communication.
Diffstat (limited to 'syz-ci')
-rw-r--r--syz-ci/manager.go14
-rw-r--r--syz-ci/syz-ci.go7
2 files changed, 20 insertions, 1 deletions
diff --git a/syz-ci/manager.go b/syz-ci/manager.go
index 21941cfde..fd19a8780 100644
--- a/syz-ci/manager.go
+++ b/syz-ci/manager.go
@@ -256,6 +256,16 @@ loop:
log.Logf(0, "%v: stopped", mgr.name)
}
+func (mgr *Manager) archiveCommit(commit string) {
+ if mgr.cfg.GitArchive == "" || mgr.mgrcfg.DisableGitArchive {
+ return
+ }
+ if err := mgr.repo.PushCommit(mgr.cfg.GitArchive, commit); err != nil {
+ mgr.Errorf("%v: failed to archive commit %s from repo %s: %s",
+ mgr.name, commit, mgr.mgrcfg.Repo, err.Error())
+ }
+}
+
func (mgr *Manager) pollAndBuild(lastCommit string, latestInfo *BuildInfo) (
string, *BuildInfo, time.Duration) {
rebuildAfter := buildRetryPeriod
@@ -277,7 +287,9 @@ func (mgr *Manager) pollAndBuild(lastCommit string, latestInfo *BuildInfo) (
if err := mgr.build(commit); err != nil {
log.Logf(0, "%v: %v", mgr.name, err)
} else {
- log.Logf(0, "%v: build successful, [re]starting manager", mgr.name)
+ log.Logf(0, "%v: build successful", mgr.name)
+ mgr.archiveCommit(lastCommit)
+ log.Logf(0, "%v: [re]starting manager", mgr.name)
mgr.buildFailed = false
rebuildAfter = kernelRebuildPeriod
latestInfo = mgr.checkLatest()
diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go
index 28cbbbcf0..a4acc8876 100644
--- a/syz-ci/syz-ci.go
+++ b/syz-ci/syz-ci.go
@@ -144,6 +144,10 @@ type Config struct {
// Per-vm type JSON diffs that will be applied to every instace of the
// corresponding VM type.
PatchVMConfigs map[string]json.RawMessage `json:"patch_vm_configs"`
+ // Some commits don't live long.
+ // Push all commits used in kernel builds to this git repo URL.
+ // The archive is later used by coverage merger.
+ GitArchive string `json:"git_archive"`
}
type ManagerConfig struct {
@@ -210,6 +214,9 @@ type ManagerConfig struct {
BisectBackports []vcs.BackportCommit `json:"bisect_backports"`
// Base syz-manager config for the instance.
ManagerConfig json.RawMessage `json:"manager_config"`
+ // By default we want to archive git commits.
+ // This opt-out is needed for *BSD systems.
+ DisableGitArchive bool `json:"disable_git_archive"`
// If the kernel's commit is older than MaxKernelLagDays days,
// fuzzing won't be started on this instance.
// By default it's 30 days.