Lullabot / drainpipe

GNU General Public License v3.0
32 stars 14 forks source link

Error in composer-lock diff test when PR description contains a backslash "\" before open bracket “[“, open parenthesis “(“ or underscore "_". #241

Closed leonel-lullabot closed 2 months ago

leonel-lullabot commented 1 year ago

The Composer-Lock-Diff test has problems related to the description of some Pull Requests when there is a backslash “\“ before open bracket “[“, open parenthesis “(“ or underscore "_". I leave a screenshot of the PR #1450 description as an example.

image

When the Composer-Lock-Diff test runs curl, it returns \\[unicode-bom] and \\[ESLINT_USE_FLAT_CONFIG]

curl -f \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer  ${{ secrets.GITHUB_TOKEN }}" \
  https://api.github.com/repos/${{ github.repository }}/pulls/$DRAINPIPE_PR_NUMBER | jq '. | {body}' > pull_request.json
"body": "[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n| [eslint-config-prettier](https://togithub.com/prettier/eslint-config-prettier) | [`^8.10.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/eslint-config-prettier/8.10.0/9.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-config-prettier/9.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-config-prettier/9.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-config-prettier/8.10.0/9.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-config-prettier/8.10.0/9.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n<details>\r\n<summary>prettier/eslint-config-prettier (eslint-config-prettier)</summary>\r\n\r\n### [`v9.0.0`](https://togithub.com/prettier/eslint-config-prettier/blob/HEAD/CHANGELOG.md#Version-900-2023-08-05)\r\n\r\n[Compare Source](https://togithub.com/prettier/eslint-config-prettier/compare/v8.10.0...v9.0.0)\r\n\r\n-   Added: The CLI helper tool now works with eslint.config.js (flat config). Just like ESLint itself, the CLI tool automatically first tries eslint.config.js and then eslintrc, and you can force which one to use by setting the \\[ESLINT_USE_FLAT_CONFIG] environment variable. Note that the *config* of eslint-config-prettier has always been compatible with eslint.config.js (flat config) – it was just the CLI tool that needed updating. On top of that, the docs have been updated to mention how to use both eslint.config.js (flat config) and eslintrc, and the tests now test both config systems.\r\n-   Changed: \\[unicode-bom] is no longer turned off. Prettier preserves the BOM if you have one, and does not add one if missing. It was wrong of eslint-config-prettier to disable that rule. If you get ESLint errors after upgrading, either add `\"unicode-bom\": \"off\"` to your config to disable it again, or run ESLint with `--fix` to fix all files according to the rule (add or remove BOM). Thanks to Nicolas Stepien ([@&#8203;nstepien](https://togithub.com/nstepien))!\r\n</details>\r\n\r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Enabled.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\r\n\r\n---\r\n\r\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/IowaWeb/iowadt).\r\n<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->\r\n",

Removing that backslash from the PR description and re-running the Composer-Lock-Diff test it passes.

deviantintegral commented 7 months ago

See also: https://github.com/Lullabot/drainpipe/issues/332