newrelic / opensource-website

Source code for New Relic's Opensource site.
https://opensource.newrelic.com
Apache License 2.0
152 stars 91 forks source link

Data structure for external contributions #346

Closed tangollama closed 4 years ago

tangollama commented 4 years ago

In support of #15, we've adjusted the data model for projects (in src/data/projects) to include three new attributes. All three are optional:

You can see this outlined here: https://hackmd.io/4V9s5U3FSTqV0M9kHVywAA?view

Consequences

cc: @jbeveland27 @danielgolden

For instance: OpenTelemetry:

{
  "name": "open-telemetry",
  "fullName": "open-telemetry",
  "title": "OpenTelemetry",
  "slug": "open-telemetry",
  "owner": {
    "login": "open-telemetry",
    "type": "Organization"
  },
  "excludeFromExploreProjects": true,
  "githubUrl": "https://github.com/open-telemetry",
  "permalink": "https://opensource.newrelic.com/open-telemetry",
  "iconUrl": "/images/open-telemetry.png",
  "shortDescription": "New Relic's involvement in OpenTelemetry short description",
  "description": "Bacon ipsum dolor amet chicken brisket shankle, flank filet mignon pork belly ribeye chuck ham venison pig. Spare ribs bresaola jowl chislic chuck. Pig hamburger cow ham hock buffalo picanha. Landjaeger venison pork, burgdoggen leberkas shank fatback shankle rump ham hock tenderloin pork loin. Chuck tongue buffalo landjaeger boudin sirloin. Short loin swine kevin, tail sausage tri-tip doner. Tail capicola jerky andouille turducken tri-tip bresaola boudin doner cow.",
  "projectTags": ["opentelemetry"],
  "contributors": [{
      "name": "Octocat",
      "login": "octocat",
      "contributorType": "approver",
      "id": 1,
      "avatarUrl": "https://github.com/images/error/octocat_happy.gif",
      "url": "https://api.github.com/users/octocat",
      "htmlUrl": "https://github.com/octocat"
    },{
      "name": "Octocat",
      "login": "octocat",
      "contributorType": "maintainer",
      "id": 1,
      "avatarUrl": "https://github.com/images/error/octocat_happy.gif",
      "url": "https://api.github.com/users/octocat",
      "htmlUrl": "https://github.com/octocat"      
  }],
  "subProjects": ["open-telemetry-go", "open-telemetry-java"]
}
devfreddy commented 4 years ago

Approximate changes needed:

create-pages.js

templates/

type-defs.gql

devfreddy commented 4 years ago

@jbeveland27 For:

We do NOT collect/refresh stats on external projects.

I'm thinking this is an additional step in the project-stats piece that checks for an existing project.json file for each project and checks to see if isExternal is true, if it is, skip it, otherwise continue. Thoughts?

jbeveland27 commented 4 years ago

Yeah I think that makes sense. I was brainstorming about how external projects would be picked up without having to manually enter them into that constants.js file. My thought was to build up the list by culling through the project.json files and grabbing the ones that didn't have newrelic or newrelic-experimental as the owner. Since isExternal exists now, that will be easier to use.

That begs the question - is isExternal necessary since that's already captured by owner? Or rather, is it ever possible to have a newrelic/newrelic-experimental owner and isExternal: false?

tangollama commented 4 years ago

@jbeveland27 good question, but yes, I think it is. There's a good chance that at some point, we could accept an external NR1 app project as part of the explore projects experience. That said, maybe the attribute name is confusing.

tangollama commented 4 years ago

Maybe something like "excludeFromExploreProjects". That's more accurate. @devfreddy

devfreddy commented 4 years ago

@tangollama @jbeveland27 What do you think about adding back a field like projectType, maintainerType, or contributorType?

With values like:

We should be able to then display each uniquely with its own custom template.

contributors could still live in cachedContributors in projectStats, they would just only receive manual updates, as the scripts wouldn't pick them up when querying our organizations.

subProjects could become relatedProjects and we could make it a relationship to other projects. This would let us re-use that field on newrelic projects to related all of the nr1-nerdpacks together, all of the agent projects together, etc.