This adds a short lint to ensure that all files have a single trailing newline and no trailing whitespaces. This PR is in two commits, one to add the check and another to fix currently offending files in the repo. See https://github.com/apache/tvm/pull/13058/commits/ba2c2e235e2a16d62fdeed959044c65012d9f942 for just the significant changes. Auto-corrections applied with
```
pre-commit run --all-files
```
This fixes the issue where merging from GitHub Actions (i.e. with the default `GITHUB_TOKEN`) doesn't trigger post merge GitHub Actions on the commit it creates in `main`. Instead these jobs are triggered manually by a call to the Actions API after the merge has taken place.
This also updates the tvmbot testing code (and by extension some of the other CI testing code) to remove the fixtures for each test in favor of constructing them from a single sample at runtime, this makes it a lot easier to add new tests and see what is different between each data sample and clean up the testing anti-patterns that were there before (e.g. `run()` instead of `pytest.mark.parameterize`, but none of the tests in `test_ci.py` have changed)
Tested in https://github.com/driazati/tvm/pull/36 which ran https://github.com/driazati/tvm/actions/runs/2881047903
GitHub associates the automation run on PRs for user tagging and reviews
as CI jobs on that PR, and since these often get re-run, skipped, or may
fail in the background they prevent merges. This PR ignores all of these
jobs so only the ones defined in `main.yml` matter, which are the ones
that actually build / test TVM.
This is a simpler version of #11569
This adds a command to restart CI runs that have stopped (either from a
failure, success, or abort) via GitHub comments addressed to tvm-bot:
```
@tvm-bot rerun
```
tvm-bot will then comment on the thread and send a request to Jenkins to
restart CI. This does not restart GitHub Actions jobs though we may be
able to add that in the future.
Co-authored-by: driazati <driazati@users.noreply.github.com>
This implements https://discuss.tvm.apache.org/t/rfc-allow-merging-via-pr-comments/12220. The bot can be invoked from a top-level review comment or via a regular PR comment. The text `@tvm-bot merge` anywhere in the body will trigger the bot. Right now it checks that the latest commit is reviewed and that all CI jobs that have run on that commit are successful. If it fails, it will leave a comment on the PR with the reason.
This is just a start and some features are left for followups:
* Various TODOs throughout the code
* "Scheduled" merges that happen once CI finishes
* Allowing committers to merge without getting a fresh review for changes after an approval