Skip to content
Compare
Choose a tag to compare

v16.0.1

@gr2m gr2m released this
· 1081 commits to master since this release
Compare
Choose a tag to compare

To upgrade to v16, make sure you have the latest v15 release installed first:

npm install @octokit/rest@15.18

Now run the tests and look for DEPRECATED messages in the logs. Once you see no more deprecations, upgrading to v16 should cause no problems.

BREAKING CHANGES

  • all previously deprecated methods have been removed

  • preview headers that are not required to use an API have been removed

  • .gitdata.getTags() has been removed. Use .gitdata.listRefs({namespace: tags}) instead

  • Methods for undocumented endpoints have been removed.

    Instead of octokit.users.getById({id}) use octokit.request('GET /user/:id', {id})
    Instead of octokit.repos.getById({id}) use octokit.request('GET /repositories/:id', {id})

  • octokit.enterprise.* methods have been removed. They have been moved tot the @octokit/enterprise-rest plugin

  • octokit.issues.addLabels sends labels parameter with "labels" namespace instead of sending the array in the request body root. This is not supported by GitHub Enterprise 2.15 or older. You have several options.

    1. Use the @octokit/enterprise-compatibility plugin
    2. Use the @octokit/enterprise-rest plugin loading all routes for the GHE version you want to support
    3. Use octokit.request() directly:
    octokit.request('/repos/:owner/:repo/issues/:number/labels', {
      owner,
      repo,
      number,
      data: ['label1', 'label2']
    })
  • The milestone parameter is no longer validated using a regex as it cannot be derived from octokit/routes

  • Dropped support for node 4

  • error.message is no longer a JSON string containing GitHub’s error message. Instead the JSON is parsed internally and error properties are assigned with its value. This is not technically a breaking change but a bug fix, but as this bug was around for a long time and plenty of apps depend on JSON.parse(error.message) to be working, we treat it as a breaking change by way of precaution

  • error.status is now the response status code number. The status text is no longer returned

Features

Bug Fixes

  • routes: remove validation for milestone parameter as it cannot be derived from octokit/routes (4d04d17)
  • only set preview headers required to use the API (1628821)
  • parse JSON from GitHub error messages (dd6306e)

Continuous Integration

  • travis: drop tests in node 4 & 9, test in node 10 (ad8b1e5)

Bug Fixes in v16.0.1

  • typescript: Adding return types (18ac5bf), closes #1116
  • typescript: Adding the noImplicitAny flag to validate:ts (ef4d35a)
  • typescript: Github.plugin is a static method, not an instance method (01763bf)
  • typescript: include a header object when transforming Content-Type and Content-Length to headers.content-type and headers.content-length (0b9cc37)

Thanks @mamodom for your great help with these Typescript fixes 💐