Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update changelog: escape underscore characters #28

Open
gabor opened this issue Sep 30, 2021 · 4 comments
Open

update changelog: escape underscore characters #28

gabor opened this issue Sep 30, 2021 · 4 comments

Comments

@gabor
Copy link

gabor commented Sep 30, 2021

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 tolzhabayev self-assigned this Dec 6, 2021
@tolzhabayev
Copy link
Contributor

tolzhabayev commented Dec 6, 2021

@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?

@tolzhabayev tolzhabayev removed their assignment Dec 7, 2021
@gabor
Copy link
Author

gabor commented Dec 7, 2021

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: grafana/grafana#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
Copy link
Contributor

tolzhabayev commented Dec 8, 2021

@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
Copy link
Author

gabor commented Dec 9, 2021

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

  • use the grafana/grafana repo
  • checkout the branch from my test-failed-PR git checkout origin/gabor/changelog-escape-test
  • yarn install
  • git diff .. this should show no changes
  • yarn run prettier:write
  • git diff .. this will show that prettier wants to change the CHANGELOG.md file

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants