[autocorrelator] Implement CI/CQ summary markdown correlator

This change implements the skeleton for the autocorrelator tool as
sketched out in go/ci-cq-auto-correlator.

This tool has two subcommands:

check-ci: This subcommand takes an input summary markdown and compares
it to recent CI builds' summary markdowns. If a correlated failure is
detected, emit a finding as JSON output e.g.

{
    score: 0.95,
    build_id: "887939301011",
    commit_dist: 4,
    is_green: false
}

If CI looks green, emit a finding as a JSON output e.g.

{
    score: 0.0,
    build_id: "887939301011",
    commit_dist: 2,
    is_green: true
}

Simply speaking, this can be used to help answer questions like: "is the
failure I'm seeing in CQ also present in CI?"

Usage: autocorrelator check-ci -base-commit abc -builder foo/bar/baz \
           -search-range 20 -summary-markdown-path path/to/summary.md
	   -json-output out.json

check-try: Take an input summary markdown and compare it to recent try
builds' summary markdowns. Return a list of findings as JSON, which is
the result of running the edit distance algo on every summary markdown,
e.g.

[
    {
        score: 0.88,
        build_id: "881101039773",
	is_green: false
    },
    {
        score: 0.0,
	build_id "8811010397766",
	is_green: true
    },
    {
        score: 0.84,
        build_id: "881101039761",
	is_green: false
    }
]

This can be used to help answer questions like: "is the failure I'm
seeing in CQ also happening on other tryjobs?"

Usage: autocorrelator check-try -builder foo/bar/baz -search-range 20 \
           -summary-markdown-path path/to/summary.md
	   -json-output out.json

Bug: 65374
Change-Id: I186e46d9d0a4b0035f96f4fd65d04ec209a35c3a
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/infra/+/458614
Reviewed-by: Anirudh Mathukumilli <rudymathu@google.com>
Commit-Queue: Anthony Fandrianto <atyfto@google.com>
11 files changed
tree: 9cb5de26da944f1258311f7bd545e5acbb15f110
  1. artifacts/
  2. buildbucket/
  3. checkout/
  4. cmd/
  5. digest/
  6. execution/
  7. gerrit/
  8. gitiles/
  9. gotidy/
  10. monorail/
  11. serial/
  12. third_party/
  13. .gitignore
  14. AUTHORS
  15. go.mod
  16. go.sum
  17. LICENSE
  18. MAINTAINERS
  19. manifest
  20. PATENTS
  21. README.md
README.md

infra

This repo contains tools and config files necessary to run infrastructure related to builds, code review, version control, and continuous integrations.

In order to build the Go code, you must clone this repo into an appropriately named directory. This should do the trick:

REPO=fuchsia.googlesource.com/infra/infra
git clone https://${REPO} $(go env GOPATH)/src/${REPO}