Skip to content

v11.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 15 Dec 22:00

BREAKING CHANGES

For a smooth upgrade, make sure to update to the latest Probot v10 version first (npm install probot@10), run your tests, and address all deprecation messages. Nearly all removed APIs have previously been deprecated.

  • deprecated context.octokit.* have been removed via @octokit/plugin-rest-endpoint-methods v4

  • probot.server property removed. Build your own server instead using import { Server } from "probot"

  • probot.load() is now asynchronous and no longer returns the instance

  • express-async-errors is no longer used.

  • Probot constructor parameter no longer supported in createNodeMiddleware(app, { Probot }). Pass a probot instance instead: createNodeMiddleware(app, { probot })

  • getOptions() has been removed. Use { probot: createProbot() } instead

  • probot.load(appFn) no longer accepts appFn to be a path string. Pass the actual function instead.

  • probot.setup() removed. Use the new Server class instead:

    const { Server, Probot } = require("probot")
    const server = new Server({
      // optional:
      host,
      port,
      webhookPath,
      webhookProxy,
      Probot: Probot.defaults({ id, privateKey, ... })
    })
    
    // load probot app function
    await server.load((app) => {})
    
    // start listening to requests
    await server.start()
    // stop server with: await server.stop()

    If you have more than one app function, combine them in a function instead

    const app1 = require("./app1")
    const app2 = require("./app2")
    
    module.exports = function app ({ probot, getRouter }) {
      await app1({ probot, getRouter })
      await app2({ probot, getRouter })
    }
  • probot.start() / probot.stop() removed. Use the new Server class instead:

    const { Server, Probot } = require("probot")
    const server = new Server({
      Probot: Probot.defaults({ id, privateKey, ... })
      // optional:
      host,
      port,
      webhookPath,
      webhookProxy,
    })
    
    // load probot app function
    await server.load((app) => {})
    
    // start listening to requests
    await server.start()
    // stop server with: await server.stop()
  • REDIS_URL is ignored when using Probot constructor. Use new Probot({ redisConfig: redis://... }) instead

  • Probot constructor no longer reads environment variables. Pass options instead, or import { createProbot } from "probot" instead

  • Probot.run() has been removed. Use import { run} from "probot" instead

  • context.github has been removed. Use context.octokit instead

  • context.event has been removed. Use context.name instead

  • app.route() has been removed. Use the getRouter() argument from the app function instead: (app, { getRouter }) => { ... }

  • app.router has been removed. Use getRouter() from the app function instead: (app, { getRouter }) => { ... }

  • probot.logger has been removed. Use probot.log instead

  • new Probot({ id }) has been removed. Use new Probot({ appId }) instead

  • new Probot({ cert }) has been removed. Use new Probot({ privateKey }) instead

  • probot.webhook has been removed. Use probot.webhooks instead

  • createProbot(options) no longer supports any keys besides overrides, defaults, or env

  • options.throttleOptions has been removed. Set options.Octokit to ProbotOctokit.defaults({ throttle }) instead

  • import { Application } from probot has been removed. Use import { Probot } from probot instead, the APIs are the same