diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-03-12 12:22:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-03-17 18:06:44 +0100 |
| commit | 5ed211ca96c6e6ab96fad7b5a495d81178ee98eb (patch) | |
| tree | 352711e48e64791cda1615ca2bd6611588a23209 /pkg/bisect | |
| parent | 5958caeafcf3d467009ae984a9be8302bf852a50 (diff) | |
pkg/vcs: refactor bisection support
In preparation for syz-ci bisection:
- move bisection function into a separate interface
they look out of place in vcs.Repo because most OSes
don't implement it and most users don't case
- extract author name and more CC emails for commits
- move linux-specific PreviousReleaseTags into linux.go
- fix inconclusive bisection (more than 1 potential commits)
- add tests fr bisection
- add maintainers returned from get_maintainers.pl for commits
that don't have enough emails (e.g. only author email)
Update #501
Diffstat (limited to 'pkg/bisect')
| -rw-r--r-- | pkg/bisect/bisect.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index df5dfcd90..10a2eff9e 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -136,7 +136,7 @@ func (env *env) bisect() (*vcs.Commit, error) { if good == "" { return nil, nil // still not fixed } - return env.repo.Bisect(bad, good, cfg.Trace, func() (vcs.BisectResult, error) { + commits, err := env.repo.(vcs.Bisecter).Bisect(bad, good, cfg.Trace, func() (vcs.BisectResult, error) { res, err := env.test() if cfg.Fix { if res == vcs.BisectBad { @@ -147,6 +147,13 @@ func (env *env) bisect() (*vcs.Commit, error) { } return res, err }) + if err != nil { + return nil, err + } + if len(commits) == 1 { + return commits[0], nil + } + return nil, nil } func (env *env) commitRange() (*vcs.Commit, string, string, error) { @@ -173,7 +180,7 @@ func (env *env) commitRangeForFix() (*vcs.Commit, string, string, error) { func (env *env) commitRangeForBug() (*vcs.Commit, string, string, error) { cfg := env.cfg - tags, err := env.repo.PreviousReleaseTags(cfg.Kernel.Commit) + tags, err := env.repo.(vcs.Bisecter).PreviousReleaseTags(cfg.Kernel.Commit) if err != nil { return nil, "", "", err } @@ -312,7 +319,7 @@ func (env *env) processResults(current *vcs.Commit, results []error) (bad, good // Note: linux-specific. func (env *env) buildEnvForCommit(commit string) (*buildEnv, error) { cfg := env.cfg - tags, err := env.repo.PreviousReleaseTags(commit) + tags, err := env.repo.(vcs.Bisecter).PreviousReleaseTags(commit) if err != nil { return nil, err } |
