bot icon indicating copy to clipboard operation
bot copied to clipboard

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

Open JasonGross opened this issue 4 years ago • 4 comments

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.

JasonGross avatar Dec 17 '21 17:12 JasonGross

Copied over from #171:

We can also solicit feedback via reactions:

  • 👍 for "this was useful"
  • :-1: for "this was not useful"
  • 👀 for "this helped me understand what's going on"
  • 🚀 for "I plan to add this to the test-suite"
  • 😕 for "I wish the minimizer minimized this example more"

Zimmi48 avatar Dec 27 '21 18:12 Zimmi48

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 avatar Dec 30 '21 18:12 Zimmi48

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 avatar Dec 30 '21 18:12 Zimmi48

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).

Zimmi48 avatar Dec 30 '21 20:12 Zimmi48