grafana / grafana-github-actions

Github automation
Other
22 stars 9 forks source link

update changelog: escape underscore characters #28

Open gabor opened 3 years ago

gabor commented 3 years ago

we had pull-requests with _ characters in the title, for example handle $__interval. the changelog-generator should markdown-escape the _, but it is not doing that currently.

tolzhabayev commented 2 years ago

@gabor can you elaborate a bit more on why it should escape it with a backslash as it looks like github can handle underscores pretty well even when unescaped? Any examples of where it broke or how to reproduce?

gabor commented 2 years ago

hi @tolzhabayev , thanks for looking at this issue!

the CI jobs that validate the changelog-markdown-file will fail in some situations. for example, i made a test pull request where i removed the escaping, and see how it failed: https://github.com/grafana/grafana/pull/42829

basically, if you run yarn run prettier:check, it will complain if underscores are not escaped (seems not in every case, but it does for the case of $__interval and $__interval_ms)

tolzhabayev commented 2 years ago

@gabor I have looked more into it and it seems it should be working. I have tested it locally and it works for me 🤷 I have created a PR to bump the prettier version, maybe that would help keeping it similar to the grafana repository. Otherwise it would be good to see which execution failed to escape (maybe there is an error message, if you have a link to github action run logs).

gabor commented 2 years ago

@tolzhabayev hmm, i think the prettier that is failing is in the grafana/grafana repo... you can reproduce it like this:

so, in short:

  1. we have a github action that generates a changed CHANGELOG.md
  2. the prettier check in grafana/grafana is not happy with the format of that CHANGELOG.md

so, if you want prettier-check in [2] be happy with the changes produces in [1], we either need to change [1], or change [2].

does this help?

maybe i'm misunderstanding something in the question, sorry 😄