Skip to content

Issue-linking failure comment renders with broken markdown #37100

Description

@nollymar

Problem Statement

The "❌ Issue Linking Required" comment that the issue_comp_link-issue-to-pr.yml workflow posts on PRs without a linked issue renders with broken markdown, making the instructions confusing for every contributor who hits the check:

  • The Option 3: Use branch naming heading is swallowed into Option 2's numbered list, appearing as a bogus list item (e.g. "6. Option 3: Use branch naming").
  • Stray blank lines split the bullet and numbered lists apart, producing empty bullet items.
  • The --- separator and the italic footer are glued onto the "Why is this required?" paragraph (…they solve.---*This comment…*).
  • ~30 garbage newlines trail the comment.

Root cause: the comment body is built with a single printf whose format string has 21 %s slots for 22 arguments, and whose \n/\n\n group boundaries do not match the argument groups. With more arguments than slots, bash reuses the format string, which produces the glued footer and trailing newlines. This is the second time this printf drifted out of alignment (a bullet was added in a previous change without adding a format slot), so the printf pattern itself is the defect, not just its current alignment.

Impact: cosmetic/UX only — the check's pass/fail logic is unaffected — but it degrades trust in the CI guidance and the instructions are genuinely harder to follow.

Steps to Reproduce

  1. Open a PR against dotCMS/core with no linked issue (no closing keyword in the body, no Development-section link, no issue number in the branch name).
  2. Wait for the "Add Issue to PR / link-issue" check to fail.
  3. Look at the "❌ Issue Linking Required" comment the bot posts on the PR.
  4. Observe the broken list rendering, glued footer, and stray blank bullets described above.

Expected: Option 1 renders as a contiguous 4-item bullet list, Option 2 as a contiguous 3-item numbered list, Option 3 as its own bold heading, and the --- separator plus italic footer on their own lines.

Actual: see Problem Statement.

Acceptance Criteria

  • The failure comment body is no longer built with a positional printf format string; it uses a literal markdown block (quoted heredoc) that cannot drift out of alignment when lines are added.
  • On a PR with no linked issue, the posted comment renders correctly on GitHub: contiguous lists, Option 3 as a standalone heading, --- and footer on their own lines, no empty bullets, no trailing garbage.
  • Comment wording is unchanged from the current template (cross-repo keyword instructions preserved).
  • The ## ❌ Issue Linking Required header stays byte-identical so the duplicate-comment check and the "Remove failure comment if issue is now resolved" step keep matching, including stale comments posted with the old broken body.
  • After linking an issue to a failing PR, the failure comment is auto-removed and the check passes (cleanup path unaffected).
  • actionlint/shellcheck report no new findings on the workflow versus main.

dotCMS Version

N/A — CI workflow on main branch (.github/workflows/issue_comp_link-issue-to-pr.yml).

Severity

Low - Minor issue or cosmetic

Links

Metadata

Metadata

Assignees

Type

Projects

Status
New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions