Skip to content

Commit edc3953

Browse files
committed
improve logging a bit
1 parent 227b124 commit edc3953

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

dist/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -51700,8 +51700,10 @@ function reportDeployedPrsToLinear(pullRequests) {
5170051700
(commentBody) => linearClient2.getIssueViewForAttachmentUrl(pullRequest.url, commentBody).pipe(
5170151701
Effect_exports.map((issueView) => issueView.attachmentsForURL.nodes),
5170251702
Effect_exports.tap(
51703-
(attachments) => Effect_exports.logDebug(
51704-
`${attachments.length} attachment${attachments.length === 1 ? "" : "s"} found for pull request ${pullRequest.url}`,
51703+
(attachments) => attachments.length === 0 ? Effect_exports.logInfo(
51704+
`No Linear attachments found for pull request ${pullRequest.url}`
51705+
) : Effect_exports.logDebug(
51706+
`${attachments.length} Linear attachment${attachments.length === 1 ? "" : "s"} found for pull request ${pullRequest.url}`,
5170551707
`Belonging to issue${attachments.length === 1 ? "" : "s"} ${attachments.map((attachment) => attachment.issue.identifier).join(", ")}`
5170651708
)
5170751709
),

dist/index.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/report-deployed-prs-to-linear.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ export function reportDeployedPrsToLinear(pullRequests: PullRequest[]) {
1919
.pipe(
2020
Effect.map((issueView) => issueView.attachmentsForURL.nodes),
2121
Effect.tap((attachments) =>
22-
Effect.logDebug(
23-
`${attachments.length} attachment${attachments.length === 1 ? '' : 's'} found for pull request ${pullRequest.url}`,
24-
`Belonging to issue${attachments.length === 1 ? '' : 's'} ${attachments.map((attachment) => attachment.issue.identifier).join(', ')}`,
25-
),
22+
attachments.length === 0
23+
? Effect.logInfo(
24+
`No Linear attachments found for pull request ${pullRequest.url}`,
25+
)
26+
: Effect.logDebug(
27+
`${attachments.length} Linear attachment${attachments.length === 1 ? '' : 's'} found for pull request ${pullRequest.url}`,
28+
`Belonging to issue${attachments.length === 1 ? '' : 's'} ${attachments.map((attachment) => attachment.issue.identifier).join(', ')}`,
29+
),
2630
),
2731
Effect.andThen((attachments) =>
2832
Effect.all(

0 commit comments

Comments
 (0)