rust-lang / rust-log-analyzer

Analyzing Travis and Azure Pipelines logs to find encountered errors
MIT License
40 stars 27 forks source link

Add support for configurable and multiple repositories #43

Closed pietroalbini closed 4 years ago

pietroalbini commented 4 years ago

This PR adds support for customizing which repositories RLA interacts with, instead of hardcoding rust-lang/rust everywhere in the code. The change fixes missing reports for auto/try Azure builds (which broke after the switch to rust-lang-ci) and allows getting reports for auto/try GHA builds.

The first commit removes most hardcoded references to rust-lang/rust, replacing them with the --repo CLI flag. The flag is required by both the offline and the server CLI tools.

The second commit adds a --secondary-repo flag to the server CLI. The flag can be specified multiple times, and adds repositories in which builds can run. If an incoming webhook was sent from a secondary repository the build will be fetched from it, but the comment will be posted in the primary repository. Practically speaking, this flag implements support for rust-lang-ci/rust.

The third commit adds a --query-builds-from-primary-repo to the server CLI. The flag is used in the Azure Pipelines configuration, and forces RLA to query builds received from a secondary repository in the primary one. This is needed as the Azure DevOps project for rust-lang-ci/rust is still called rust-lang/rust.

Notably, this PR does not change how Travis CI is handled. I don't have a test environment for it anymore and adding these changes to it is not trivial, as we use repository IDs instead of names to query the Travis CI API. I don't think it matters much as we don't use Travis CI anymore, and I'd almost be open to drop Travis CI support from RLA completely.

Before deploying this PR to production we will need to change the CLI invocation.

New Azure Pipelines CLI invocation:

rla-server --ci azure --repo rust-lang/rust --secondary-repo rust-lang-ci/rust --query-builds-from-primary-repo --index-file azure.idx

New GitHub Actions CLI invocation:

rla-server --ci actions --repo rust-lang/rust --secondary-repo rust-lang-ci/rust --index-file actions.idx

The PR can be reviewed commit-by-commit. r? @Mark-Simulacrum Fixes #42

Mark-Simulacrum commented 4 years ago

I don't think it matters much as we don't use Travis CI anymore, and I'd almost be open to drop Travis CI support from RLA completely.

I'd be all for this, I don't think it makes sense to support what we don't use.

The PR looks good to me. Feel free to merge and deploy at will.