coq / bot

A (Coq Development Team) bot written in OCaml
MIT License
23 stars 17 forks source link

Should coqbot compose the comment rather than run-coq-bug-minimizer? #190

Open JasonGross opened 2 years ago

JasonGross commented 2 years ago

It may make sense to have coqbot compose the reply comment instead (this would also allow coqbot to do the truncation of the file only for the comment and not also for the submitted PR). If we move the curl response to happen after artifact upload, then the bot could perhaps link directly to the artifacts too.

Zimmi48 commented 2 years ago

Copied over from #171:

We can also solicit feedback via reactions:

Zimmi48 commented 2 years ago

We've decided to switch to relying on workflow_run webhooks from the https://github.com/coq-community/run-coq-bug-minimizer repo and on artifacts uploaded by the workflow. The run-coq-bug-minimizer script will need to be adapted to upload more artifacts (like the stamp, and some variables to indicate if the run timed out, if there was an error, etc.). When a workflow finishes the bot will retrieve the list of artifacts (we can do so with: https://docs.github.com/en/rest/reference/actions#list-workflow-run-artifacts), download the artifacts that are relevant to it, read any information it needs, and compose the comment. To start with, we will keep the comment close to what it used to be (except that we will put direct links to artifacts instead of what we do today).

Zimmi48 commented 2 years ago

This is an example of workflow_run webhook payload:

{
  "action": "completed",
  "workflow_run": {
    "id": 1638373879,
    "name": "CI",
    "node_id": "WFR_kwLOD4eP885hp5n3",
    "head_branch": "run-coq-bug-minimizer-3669253975192",
    "head_sha": "eec4bc2b8e4e09f7aa12c378876aaddec23f9dd1",
    "run_number": 798,
    "event": "push",
    "status": "completed",
    "conclusion": "success",
    "workflow_id": 1173486,
    "check_suite_id": 4795426477,
    "check_suite_node_id": "CS_kwDOD4eP888AAAABHdRmrQ",
    "url": "https://api.github.com/repos/coq-community/run-coq-bug-minimizer/actions/runs/1638373879",
    "html_url": "https://github.com/coq-community/run-coq-bug-minimizer/actions/runs/1638373879",
    "pull_requests": [

    ],
    "created_at": "2021-12-30T18:15:26Z",
    "updated_at": "2021-12-30T18:26:40Z",
    "run_attempt": 1,
    "run_started_at": "2021-12-30T18:15:26Z",
    "jobs_url": "https://api.github.com/repos/coq-community/run-coq-bug-minimizer/actions/runs/1638373879/jobs",
    "logs_url": "https://api.github.com/repos/coq-community/run-coq-bug-minimizer/actions/runs/1638373879/logs",
    "check_suite_url": "https://api.github.com/repos/coq-community/run-coq-bug-minimizer/check-suites/4795426477",
    "artifacts_url": "https://api.github.com/repos/coq-community/run-coq-bug-minimizer/actions/runs/1638373879/artifacts",
Zimmi48 commented 2 years ago

coqbot should also handle minimization resumption in case TIMEDOUT=1 (in this case RESUMPTION_ARGS are important as well).

These variables are set in https://github.com/coq-community/run-coq-bug-minimizer/blob/master/run.sh. The current logic for building the comments is in reply-coqbot*.sh (and some functions are defined in coqbot-config.sh).