Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 this issue Feb 13, 2024 · 6 comments

Comments

@leonid-deriv
Copy link

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

image

@morucci
Copy link
Collaborator

morucci commented Feb 13, 2024

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
Copy link
Author

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

  • change draft status - it will be great to have an event for this
  • status changed (MERGED or CLOSED) - we have events already.

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

@morucci
Copy link
Collaborator

morucci commented Feb 13, 2024

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:

  • if the Change's update date field is updated when the Change's draft status is changed.
  • if the Github GraphQL schema have a notion change to draft/to ready event.

@leonid-deriv
Copy link
Author

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
Copy link
Collaborator

morucci commented Feb 14, 2024

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
Copy link
Author

It will be great to have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants