Skip to content

Commit

Permalink
improve debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Sep 1, 2024
1 parent 7eda0e0 commit 2329e63
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51613,6 +51613,12 @@ function reportDeployedPrsToLinear(pullRequests) {
Effect_exports.map(
(issueView) => issueView.data.attachmentsForURL.nodes
),
Effect_exports.tap(
(attachments) => Effect_exports.logDebug(
`${attachments.length} attachment${attachments.length === 1 ? "" : "s"} found for pull request ${pullRequest.url}`,
`Belonging to issue${attachments.length === 1 ? "" : "s"} ${attachments.map((attachment) => attachment.issue.identifier).join(", ")}`
)
),
Effect_exports.andThen(
(attachments) => Effect_exports.all(
attachments.map(
Expand Down Expand Up @@ -51657,9 +51663,6 @@ function getCommentBody(pullRequest) {
}
return match11;
})
),
Effect_exports.tap(
(commentBody) => Effect_exports.logDebug(`Comment body for pull request ${pullRequest.url}`, commentBody)
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/report-deployed-prs-to-linear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export function reportDeployedPrsToLinear(pullRequests: PullRequest[]) {
Effect.map(
(issueView) => issueView.data.attachmentsForURL.nodes,
),
Effect.tap((attachments) =>
Effect.logDebug(
`${attachments.length} attachment${attachments.length === 1 ? '' : 's'} found for pull request ${pullRequest.url}`,
`Belonging to issue${attachments.length === 1 ? '' : 's'} ${attachments.map((attachment) => attachment.issue.identifier).join(', ')}`,
),
),
Effect.andThen((attachments) =>
Effect.all(
attachments.map((attachment) =>
Expand Down Expand Up @@ -72,8 +78,5 @@ function getCommentBody(pullRequest: PullRequest) {
return match
}),
),
Effect.tap((commentBody) =>
Effect.logDebug(`Comment body for pull request ${pullRequest.url}`, commentBody),
),
)
}

0 comments on commit 2329e63

Please sign in to comment.