Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Record commit date #1841

Open
oliviercailloux opened this issue May 26, 2019 · 0 comments
Open

Record commit date #1841

oliviercailloux opened this issue May 26, 2019 · 0 comments

Comments

@oliviercailloux
Copy link

oliviercailloux commented May 26, 2019

Feature request ✨

I would like to be able to programmatically get from GitHub the reception times for each commit.

Details
Given one of my student’s repository used for an assignment. GitHub would send me (through an authenticated API request) a list of pairs (commit, time). There would be one such pair for each commit having happened on that repository in, say, the last three months. For each such commit, the time would be the time at which GitHub received the commit (thus, the time of the corresponding push).

Usage
I would use this feature as a source of trusted timestamps, for determining when the repository was in some state.

Here are two use cases where I need it.

  • In-session graded assignment. I give the link for assignment at the start of the session, students have 30 minutes for the assignment. They can submit late, but they lose points gradually.
  • Off-line graded project assignment. Students have to commit before a certain deadline (say in two weeks), but again, they may commit late (say, 24h), and lose points gradually.

In both cases, note that I want to avoid strong deadlines where late commits would not be considered at all when grading. I want to know which and when was the last commit on time (if any) and when was each late commit. (In some cases I’ll use the last commit on time for grading instead of the very last commit, for example, if a student committed by mistake 5 days later than the deadline just to correct a spelling mistake, she shouldn’t get the full penalty for 5 days late.)

(Unsatisfactory) current solutions

  • Using the commit dates as sent by the client is not a solution: this is easy to manipulate, and I have observed students do it.
  • Setting a deadline when creating the assignment is not entirely satisfactory. Because (if I understood correctly) it only timestamps the last commit on time. I can’t easily know, given a late commit, when it has been received by GitHub.
  • Using the GitHub events API looked promising. But I have spent countless hours trying to use it to systematically determine the time when GitHub received every (recent) commit in a given repository. It is extremely hard. It is hard to summarize exactly why, but to give a hint for the reason of my statement, it is not true (contrary to my initial hope) that it suffices to search for the sha of a commit and look at the time of the corresponding event, because some sha’s are missing from the list (seems to happen when a new branch gets created, the first commit(s) on the new branch are not listed in the corresponding CREATE_BRANCH event and no PUSH_EVENT ever mention those, if I understood correctly). Also, I have seen a commit being listed in a PUSH_EVENT with a completely incorrect date, much later than indeed received by GitHub (and I doubt the student had anyhow changed the considered commit). I believe a special API dedicated for this usage would be most welcome.
  • A python tool promises to capture event times given by GitHub; but judging from the source code, it simply uses the (not sufficiently reliable) approach described here above (looking at commits for each push events).

Supplementary notes

  • This feature would make sense on any repository, not necessarily the ones created in Classroom, but obviously there is a particular need of it for graded assignments, hence my posting here.
  • Having the history only over the last three months would be more than enough for my needs: I grade homeworks less than three months later than the deadline. And it matches the current GitHub policy regarding events. Thus, I believe that the GitHub servers already store this information, I just want access to it.
  • I realize that some subtleties are involved as it is possible to rewrite history in git, thus, I suppose, a commit could be changed and “seen again” from GitHub. If so, I’d like the API to send me the last modification time of each commit. (I don’t expect students to rewrite history, unless perhaps they try to cheat, so sending the last modification time seems appropriate; this would I suppose suffice to render cheating attempts ineffective.) (Precisely this kind of subtleties are another reason a general correct algorithm would be hard for me to write on the basis of the event api.)
  • Very related discussion; Modify assignment deadlines in the past #1362 has a request that my suggestion would solve; more vaguely related discussion and issues Adding a due date for assignments #379, Due dates for GitHub Classroom  #959.

Question / request

  • Is there anything I overlooked in GitHub API (v3 or GraphQL) that would already permit to do what I seek here?
  • Are my difficulties of using the GitHub event API due to bugs in this API, and should I better report it as a bug to GitHub? Indeed the documentation about PUSH_EVENT suggests that all related commits should be listed, but I’m not very sure of my interpretation. (Slightly related question here.)
  • What do you think of providing such a feature specifically to GitHub Classroom users, would this make sense? (I guess, organisationally speaking, it would also be much easier and quicker to let this change be implemented at the Classroom level than convince GitHub to add some general API.)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants