Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process for ensuring News page is kept updated #102

Closed
broccolini opened this issue Feb 15, 2019 · 1 comment · Fixed by #165
Closed

Process for ensuring News page is kept updated #102

broccolini opened this issue Feb 15, 2019 · 1 comment · Fixed by #165

Comments

@broccolini
Copy link
Member

The News page hasn't been update since November, currently it's a manual process so we need a way to remember to update it. I think we should include this as part of First Responder duties since we're aiming to reduce the amount of project work FR does, and increase time for FR + maintenance tasks.

Proposed process:

  • FR opens News pr every Monday for team to comment re new events and releases.
  • Slack bot reminder on Thursday to help team remember to post updates to pr
  • FR checks again with team on Friday re any changes and updates but doesn't ship (because of timezone differences people may ship releases after someones end of work day so makes more sense to ship on Monday)
  • Next FR reviews and ships News PR and opens a new one for the week. The cycle continues.

This is very manual, if we can automate all or parts of this please make suggestions!

cc @primer/ds-core

@shawnbot
Copy link
Contributor

One way that we could ensure this is kept up to date is to actually use the GitHub releases API to get the latest release of one or more repos server-side:

import Octokit from '@octokit/rest'

const github = new Octokit()
const repos = [
  {name: 'Primer CSS', owner: 'primer', repo: 'css'},
  {name: 'Primer Components', owner: 'primer', repo: 'components'},
  {name: 'Octicons', owner: 'primer', repo: 'octicons'},
]

export default class Releases extends React.Component {
  static getInitialProps(context) {
    return Promise.all(repos.map(({name, owner, repo}) => {
      return github.repos.getLatestRelease({owner, repo})
        .then(release => ({name, owner, repo, release}))
    }))
    .then(repos => ({repos})) // [] => {repos: []}
  }

  render() {
    const {repos = []} = this.props
    return (
      <ul>
        {repos.map(({name, owner, repo, release}) => {
          const url = `https://github.com/${owner}/${repo}`
          return <li><a href={url}>{name}</a> <a href={release.html_url}>{release.name}</a></li>
        }))}
      </ul>
    )
  }
}

We might run into API rate limits, but I think that would only happen if like 1000 people visited this page every day? 🤷‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants