fix: revert multiline yaml parsing indentation change#638
Merged
Conversation
Adds a regression test for issue #637 using the multi-line quoted payload shape that a `payload: |` block produces: keys at column 0 and a `text:` value wrapping across a blank line. This fails on js-yaml 5.x (`deficient indentation` -> SlackError) with the production code unchanged, proving the v3.0.4 regression. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
js-yaml 5.x adopts strict YAML 1.2 flow-scalar indentation and throws `deficient indentation` on a double-quoted value that wraps across a blank line onto a column-0 continuation line. A `payload: |` block strips its common indent, so keys and wrapped values land at column 0 -- the exact shape of a multi-paragraph Slack message. Payloads that worked in v3.0.3 broke in v3.0.4 (#635). 5.x offers no option or schema to relax this (CORE_SCHEMA, YAML11_SCHEMA and the default all throw identically), so revert js-yaml to ^4.2.0 and restore the @types/js-yaml devDependency. This makes the regression test added in the previous commit pass. Fixes #637 Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The live-API suite only sent single-line `text:` values, so it shared the unit tests' blind spot and would not have caught #637. Add a chat.postMessage step whose `text:` wraps across a blank line onto a column-0 continuation -- the shape a `payload: |` block produces for a multi-paragraph Slack message -- so a future js-yaml bump that breaks this parsing fails against the real API too. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
🦋 Changeset detectedLatest commit: c40c6bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #638 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 7 7
Lines 730 730
=======================================
Hits 729 729
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Drop "strings" from the unit test name. - Reference issue #637 on the integration workflow step. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Member
Author
|
🔭 Commit ba96dbd shows a similar error as #637 and the tests following 505dddf pass in CI! YAMLException: deficient indentation (4:1)
1 | channel: C0123456789
2 | text: "first line
3 |
4 | second line"
-----^
at throwErrorAt (file:///home/runner/work/slack-github-action/slack-github-action/node_modules/js-yaml/dist/js-yaml.mjs:889:8) |
Member
Author
|
🚀 Will fast merge to avoid ongoing CI errors! |
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.
Summary
This pull request reverts
js-yamlto4.xto restore parsing of multiline payload strings, fixing a v3.0.4 regression.5.x(bumped in build(deps): bump js-yaml from 4.2.0 to 5.2.0 #635) enforces strict YAML 1.2 flow-scalar indentation and throwsdeficient indentationwhen a double-quoted value wraps across a blank line onto a column-0 continuation.payload: |block strips its common indent, so keys and wrapped values land at column 0 — the exact shape of a multi-paragraph Slack message. Payloads that worked in v3.0.3 broke in v3.0.4.5.xschema or option relaxes this (CORE_SCHEMA,YAML11_SCHEMA, and the default all throw identically), so this revertsjs-yamlto^4.2.0and restores the@types/js-yamldevDependency.The first commit adds the failing regression test with production code unchanged (fails on
5.x); a later commit lands the revert that turns it green.Fixes #637
Requirements