Skip to content

fix(pr-digest): wrap thread-breakdown string concat in parens#294

Open
gabrielanhaia wants to merge 1 commit into
mainfrom
fix/pr-digest-thread-jq
Open

fix(pr-digest): wrap thread-breakdown string concat in parens#294
gabrielanhaia wants to merge 1 commit into
mainfrom
fix/pr-digest-thread-jq

Conversation

@gabrielanhaia
Copy link
Copy Markdown
Member

What?

Fixes a jq parse error in the Post thread breakdown step of the pr-digest.yml reusable workflow:

jq: error: syntax error, unexpected '+', expecting '}' (Unix shell quoting issues?)
    text: "*\`\(.area)\`* — \(.prs | length) stale\n" +

The cause: a multi-line string-concatenation + inside an object-literal value, without parentheses to group the expression. jq consumed the string, expected } to close the object, and choked on the +. Wrapping the concatenation in parens disambiguates the parser and matches the pattern already used in the main-message step.

Why?

Caught on the first real production run against monta-app/monorepo-typescript (112 open PRs, 29 stale, 5 critical). The main digest posted to Slack successfully (✅ visible in #monta-eng), but the thread reply step crashed with the above error and no breakdown was posted.

This fix is isolated to two lines — string concat semantics unchanged, just parenthesised.

Context

jq could not parse:

    text: "literal\n" +
          (.expr)

inside an object literal value — it consumed the string, expected '}'
to close the object, and got '+' instead, erroring with:

    syntax error, unexpected '+', expecting '}' (Unix shell quoting issues?)

Wrapping the concatenation in parentheses disambiguates the parser:

    text: ("literal\n"
           + (.expr))

This matches the established pattern in the main-message step. Caught
by the first real production run (112 open PRs, 29 stale, 5 critical):
the main digest posted successfully but the thread reply step crashed.

The same shape is now valid jq grammar in all encountered versions.
@gabrielanhaia gabrielanhaia self-assigned this May 30, 2026
@gabrielanhaia gabrielanhaia marked this pull request as ready for review May 30, 2026 08:45
@gabrielanhaia gabrielanhaia requested a review from a team as a code owner May 30, 2026 08:45
@gabrielanhaia gabrielanhaia requested review from chandrashekar-dhar, Copilot and joscdk and removed request for a team May 30, 2026 08:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a jq parse error in the reusable PR digest workflow’s Slack thread breakdown payload construction by grouping a multi-line string concatenation expression.

Changes:

  • Wraps the per-area thread breakdown text value concatenation in parentheses.
  • Keeps the generated Slack message semantics unchanged while matching the existing jq expression pattern used elsewhere in the workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants