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

fix(gatsby): refactor sourceNodes api and add I&C/CFLOW as a codeowner #36244

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/gatsby/src/utils/source-nodes-api-runner.ts @gatsbyjs/integrations-collaboration
25 changes: 25 additions & 0 deletions packages/gatsby/src/utils/source-nodes-api-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Span } from "opentracing"
import apiRunner from "./api-runner-node"

export function sourceNodesApiRunner({
traceId,
deferNodeMutation,
parentSpan,
webhookBody,
pluginName,
}: {
traceId: string
webhookBody: unknown
pluginName?: string
parentSpan?: Span
deferNodeMutation?: boolean
}): Promise<void> {
return apiRunner(`sourceNodes`, {
traceId,
waitForCascadingActions: true,
deferNodeMutation,
parentSpan,
webhookBody: webhookBody || {},
pluginName,
})
}
7 changes: 3 additions & 4 deletions packages/gatsby/src/utils/source-nodes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import report from "gatsby-cli/lib/reporter"
import { Span } from "opentracing"
import apiRunner from "./api-runner-node"
import { sourceNodesApiRunner } from "./source-nodes-api-runner"
import { store } from "../redux"
import { getDataStore, getNode } from "../datastore"
import { actions } from "../redux/actions"
Expand Down Expand Up @@ -106,12 +106,11 @@ export default async ({
const traceId = isInitialSourcing
? `initial-sourceNodes`
: `sourceNodes #${sourcingCount}`
await apiRunner(`sourceNodes`, {
await sourceNodesApiRunner({
traceId,
waitForCascadingActions: true,
deferNodeMutation,
parentSpan,
webhookBody: webhookBody || {},
webhookBody,
pluginName,
})

Expand Down