code: func BuildbucketPubSubHandler(ctx *router.Context, d *tq.Dispatcher) error {
  	c := ctx.Context
  	build, err := extractBuild(c, ctx.Request)
  	switch {
  	case err != nil:
  		return errors.Annotate(err, "failed to extract build").Err()
  
  	case build == nil:
  		// Ignore.
  		return nil
  
  	default:
  		return handleBuild(c, d, build, srcmanCheckout, gitilesHistory)
  	}
  }
docs: // BuildbucketPubSubHandler is the main entrypoint for a new update from buildbucket's pubsub.
  //
  // This handler delegates the actual processing of the build to handleBuild.
  // Its primary purpose is to unwrap context boilerplate and deal with progress-stopping errors.