change-metrics / monocle

Monocle helps teams and individual to better organize daily duties and to detect anomalies in the way changes are produced and reviewed.
https://demo.changemetrics.io/
GNU Affero General Public License v3.0
362 stars 56 forks source link

[Question]: Can you clarify when updated_at field modified in "Change" event (in relation to changing from draft : false to draft:" #1115

Open leonid-deriv opened 4 months ago

leonid-deriv commented 4 months ago

List of events - updated_at does not correspond to any other event so what triggered the update?

image

morucci commented 4 months ago

created_at is the date when the event happened (for a Change it is the same value as ChangeCreatedEvent). updated_at only reported the last update date of a Change. When a Change is updated Monocle extracts all related Events and does not have the capability to reports when the Events have been updated.

leonid-deriv commented 4 months ago

Sorry, not sure I understand your last comment. what are events which trigger updates? I can think of a couple (at least):

The reason we are interested in the draft field is because it can be used to identify when the actual review started.

morucci commented 4 months ago

Monocle only relies on the Change update date reported by the code review system. It does not make assumption about what kind of events are 'update' events.

Regarding Github, if we want to a new Event about draft, we need to check:

leonid-deriv commented 4 months ago

Yes, update date field is updated and there is also record in timelineItems. Here the request and response

query {
  repository(owner: "xxx", name: "xxxx) {
    pullRequest(number: 18) {
      id
      title
      isDraft
      createdAt
      updatedAt
      author {
        login
      }
      timelineItems(last: 5, itemTypes: [READY_FOR_REVIEW_EVENT]) {
        nodes {
          __typename
          ... on ReadyForReviewEvent {
            createdAt
            actor {
              login
            }
          }
        }
      }
    }
  }
}
{
  "data": {
    "repository": {
      "pullRequest": {
        "id": "PR_kwDOK5E-T85mxWkF",
        "title": "test for draft-pr",
        "isDraft": false,
        "createdAt": "2024-02-13T16:10:23Z",
        "updatedAt": "2024-02-13T16:19:31Z",
        "author": {
          "login": "xxx-xxx"
        },
        "timelineItems": {
          "nodes": [
            {
              "__typename": "ReadyForReviewEvent",
              "createdAt": "2024-02-13T16:19:31Z",
              "actor": {
                "login": "xxx-xxx"
              }
            }
          ]
        }
      }
    }
  }
}
morucci commented 4 months ago

Thank you for the investigation ! Then it might be possible to create that new Monocle Event for ReadyForReview. I can't tell when I'll be able to implement this but for sure that's an interesting data to have.

leonid-deriv commented 4 months ago

It will be great to have it.