Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 9

Incomplete list of push events

Goal

I would like to retrieve the time at which GitHub has received (recent) commits of a project. To do this, I considered asking for the push events of the project I am interested in.

Problem

However, I have observed that very often, some existing (recent) push events are omitted.

Illustration

Consider this project as an example. I have pushed a single commit on the 26th of July. The commit is indeed listed here, but no push events are listed at all when requesting all events related to the project, even when I am authenticated as the owner of the project.

Questions

  • Is this a bug? Would GitHub please consider fixing it so that the list of events really contain all (recent) push events?
  • Is there another way of retrieving a timestamp by GitHub associated to push commands? (I am okay to use V4 GraphQL as well, but did not find anything useful there related to timestamp of push events.)

Background

The reason I am interested in timestamps provided by GitHub is that I use GitHub as a trusted time source. The commits themselves contain timestamps, but the client can put whatever time is desired there. I need to know the real time commits were sent to GitHub to grade student works and penalize them if they are late.

I know that GitHub classroom (which I am a happy user of) provides some timestamping option, but it does not permit to get a timestamp to multiple commits as I would like to have. See also this post for more background (and for my previous attempt to ask for help).

I am also aware that GitHub will not provide events older than three months through its API. That’s fine with me. My goal is to retrieve timestamps of recent events (meaning, say, one month old or more recent).

8 Replies
Community Manager
Message 2 of 9

Re: Incomplete push events

No, it isn't a bug. There are repository events that are considered "public" and events that are considered "private". Push events are one of the events that are considered private, for which you need to be an admin or an owner on the repository to see them when querying for "all events" on a repository. Additionally, when you query the API, you need to be authenticated in order to see anything other than public events. Changing the visibility of push events is not a change that we would make lightly, since it could have enormous impact on the privacy of GitHub users.

 

One thing you could do instead is require that your students open a pull request with their changes. Since the pull request timestamp is generated on the server, it couldn't be gamed the way you're describing. You wouldn't even need to be an administrator or owner of the repository to verify the timestamp, you would only need read access.

 

Let us know if you have more questions.

Copilot Lvl 3
Message 3 of 9

Re: Incomplete push events

The problem is that I am authenticated, and I am the owner of the repositories I observed the problem with. In my example, I get the same events (namely, missing the push event) when I authenticate before querying. (I should not have illustrated on my example repository using the public event URL in my original post, sorry for the confusion.)

 

I can see other private things with no problem, for example when querying for files using the API on one of my private repositories.

 

My students create their repositories under my organisation, using the GitHub classroom mechanism. So I have access to their private events (otherwise I would not see anything as their repositories for exercices are private).

 

Finally, I usually see a few push events, just not every one of them. (Although this is not illustrated on my simple example in my original post, where there should be one push event and none is visible, even when authenticated.)

Community Manager
Message 4 of 9

Re: Incomplete push events

I validated that I received push events in the output from the List repository events endpoint that you mentioned on a repository that I'm an administrator. This endpoint is not limited to public events when the API is queried in an authenticated manner.

 

I don't know what you mean by "not all the push events". All events API endpoints are limited to the most recent 300 events or 90 days, whichever is smaller, so that could be a factor.

 

I hope that helps.

Copilot Lvl 3
Message 5 of 9

Re: Incomplete push events

Consider this project as an example. I have pushed a single commit on the 26th of July. The commit is indeed listed here, but no push events are listed at all when requesting all events related to the project, even when I am authenticated as the owner of the project.

I can add you as a collaborator of the project, so that you can observe that no push event is visible there even when authenticated.

Community Manager
Message 6 of 9

Re: Incomplete push events

Unfortunately, I can't verify that kind of thing on repositories you own. If you feel there's a bug here, you may need to report it to private support at https://github.com/contact so they can verify what you're seeing.

Copilot Lvl 3
Message 7 of 9

Re: Incomplete push events

I was just editing my message to specify that I can add you as a collaborator of the project, if it helps. So that you can observe that no push event is visible there even when authenticated.

Community Manager
Message 8 of 9

Re: Incomplete push events

I'm not certain that collaborators will have the appropriate access. Private support will have the tools required to properly reproduce the problem.

Copilot Lvl 3
Message 9 of 9

Re: Incomplete push events

Ok, I will contact them. Thanks for your help.