Refined-github: Repository creation date

Created on 9 Nov 2019  路  11Comments  路  Source: sindresorhus/refined-github


It would be nice if we could have a quick access to the repository creation date (to know if it's a recent or an old project).

Example URL:

github.com/user/repo

enhancement good first issue help wanted

Most helpful comment

Screen Shot 2019-11-20 at 5 16 48 PM

This is using the repo's created at value, but I'd like to base it off the time of first commit as discussed

All 11 comments

I sometimes needed this too. Where should it be shown if so?

@sindresorhus under the repo name

@yakov116 I disagree. It's not important enough to clutter up that area. It should be in a more subtle place.

I sometimes needed this too. Where should it be shown if so?

This should be possible with this query, but for some reason it requires a before cursor.

{
  repository(owner: "sindresorhus", name: "refined-github") {
    defaultBranchRef {
      target {
        ... on Commit {
          history(last: 1) {
            nodes {
              committedDate
            }
          }
        }
      }
    }
  }
}

history(first: 1) works without any other parameter (but it's the latest commit, not the first)

Otherwise we have to use the REST API and still use 2 queries. The first one includes a link to the last page, which will include the first commit.

I don't know how the extension works, it was just a suggestion that I can't make myself but I see a created_at property when I use the REST API to get repository informations (for example https://api.github.com/repos/Androz2091/AtlantaBot) with only one query. Wouldn't it be better to use that?

Edit: Knowing that the first commit is not necessarily equal to the date of creation of the project, right?

I see a created_at property when I use the REST API

D'oh. Indeed. It should be pretty easy to implement then. Ideally this information should be found on the GraphQL API though; Only as a last resort we should use the REST API.

Knowing that the first commit is not necessarily equal to the date of creation of the project, right?

Technically I'd say that the first commit is the birth of the project. I think created_at is the time you created a GitHub repo but one could create a GitHub repo long after starting work locally.

However this is kind of a nitpick so created_at should be good enough.

@fregante

{
  repository(owner: "sindresorhus", name: "refined-github") {
    createdAt
  }
}

=>

{
  "data": {
    "repository": {
      "createdAt": "2016-02-15T16:45:02Z"
    }
  }
}

I like the idea of this, I'm going to give adding it a shot. Does anyone have issues with @fregante's idea of adding it to the stats/number's bar?

Screen Shot 2019-11-20 at 5 16 48 PM

This is using the repo's created at value, but I'd like to base it off the time of first commit as discussed

Wow, that's awesome. Personally, the date of creation of the repository is perfect for me.

This is using the repo's created at value, but I'd like to base it off the time of first commit as discussed

As long as it can be determined in one HTTP request

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juliocanares picture juliocanares  路  3Comments

fregante picture fregante  路  3Comments

Arcanemagus picture Arcanemagus  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

sindresorhus picture sindresorhus  路  3Comments