Skip to content

DocsPrTrigger

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api/src/docs-pr/docs-pr-trigger.ts

A dependency-free hop that lets the webhook request a docs-PR check WITHOUT importing DocsPrModule — which would create a module cycle (WebhookModule -> DocsPrModule -> GithubAppModule -> forwardRef(WebhookModule)).

DocsPrService registers the real handler on init. If the feature module isn't loaded, requestCheck is a silent no-op — so wiring this into the webhook can never break it.

Methods

MethodSignatureReturns
registerregister(fn: (projectId: string) => Promise<unknown>)void
registerPrClosedregisterPrClosed(fn: (repoUrl: string, prNumber: number, merged: boolean) => Promise<unknown>)void
requestCheckrequestCheck(projectId: string)void
requestPrClosedrequestPrClosed(repoUrl: string, prNumber: number, merged: boolean)void

Where it refuses work

  • DocsPrTrigger stops the work with an early return when !this.handler.
  • DocsPrTrigger stops the work with an early return when !this.prClosedHandler.

Referenced By

  • DocsPrService (DEPENDS_ON)
  • GithubAppController (DEPENDS_ON)
  • WebhookService (DEPENDS_ON)

Was this page helpful?

Download as PDF