brownfield-team / anacapa-github-linker

A tool for managing students in computer science courses. Deployed at:
https://ucsb-cs-github-linker.herokuapp.com
MIT License
4 stars 6 forks source link

Commits Job, User view #234

Open pconrad opened 4 years ago

pconrad commented 4 years ago

As an instructor or admin, I can run a job that populates a table of commits.

LATER: Filter on that page by repo, start/end date/time.

Commits table:

NEXT STORY:

I can see all of the commits for a given team, aggreated together in some coherent view:

From Team page, a link to a "Team Commits"

ProbablyFaiz commented 4 years ago

For future reference, here's a GraphQL query I've assembled mostly from here that does most of this (pagination handling aside):

{
  organization(login: "org-name") {
    name
    repositories(first: 49) {
      totalCount
      nodes {
        refs(refPrefix: "refs/heads/", orderBy: {direction: DESC, field: TAG_COMMIT_DATE}, first: 100) {
          edges {
            node {
              ... on Ref {
                name
                target {
                  ... on Commit {
                    history(first: 100) {
                      edges {
                        node {
                          ... on Commit {
                            message
                            committedDate
                            author {
                              name
}                          }                        }                      }                    }                  }                }              }            }          }        }      }    }  }}

Note: the constants 49, 100, and 100 are deliberate. Raising these will cause GitHub to reject the query as it could exceed their limit of a maximum of 500,000 nodes in one request.