fix(pr-digest): wrap thread-breakdown string concat in parens#294
Open
gabrielanhaia wants to merge 1 commit into
Open
fix(pr-digest): wrap thread-breakdown string concat in parens#294gabrielanhaia wants to merge 1 commit into
gabrielanhaia wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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
textvalue 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes a jq parse error in the
Post thread breakdownstep of thepr-digest.ymlreusable workflow: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