-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not convert the markdown PR description to HTML for bitbucket #6287
Do not convert the markdown PR description to HTML for bitbucket #6287
Conversation
d0d297f
to
bb4eccc
Compare
Sorry for the delay here. So you're saying it used to work fine, then something changed and it stopped working? If so, do you know what change broke it here in I'm wondering if that change was unintentional, or maybe we upgraded a library that flipped a default setting w/o us realizing it. Because rather than special-casing BitBucket, in that case we might be able to set the value back to what it was previously which was working everywhere... Also, can you squash history down to drop the changes from 5bc9df6? Since it looks like you backed those out in favor of flipping a config. |
e01fa40
to
dc511fb
Compare
I traced the change back to the upgrade of the dependabot-omnibus package from 0.212.0 to 0.214.0. There I found this little change. Which is fine of course and should stay. |
Oh yeah that makes sense. 😀 I'm on my phone now but should be able to review the code in detail this coming week. |
common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb
Outdated
Show resolved
Hide resolved
dc511fb
to
5db1258
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man, you're making me glad I wasn't able to review this last week! 🤣
This PR just got cleaner/tidier as time went on. Nice job!
5db1258
to
d18568b
Compare
@@ -45,6 +45,8 @@ def sanitize_links_and_mentions(text:, unsafe: false) | |||
sanitize_nwo_text(doc) | |||
|
|||
mode = unsafe ? :UNSAFE : :DEFAULT | |||
return doc.to_commonmark([mode] + COMMONMARKER_OPTIONS) unless format_html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if we do this, it'll affect all providers that don't support html:
dependabot-core/common/lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb
Line 244 in 9df8aec
!%w(azure bitbucket codecommit).include?(source.provider) |
That doesn't mean this is a bad way to go, but let me double-check if that list is still accurate... for example I already found #6453
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead and merge this, and then I'll open a follow-up PR to address #6453 and get input from Microsoft folks... I have a feeling that it now supports HTML, which would make our lives easy here. If not, we may need to refactor source_provider_supports_html
into two separate methods, but that's beyond the scope of this PR.
While researching #6287 (comment), I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213 which says that Azure ADO now supports the `<details>` tag in Markdown. Furthermore, I suspect that ADO now fully supports HTML in PR descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body. So opening this PR as the simple solution. If ADO doesn't support HTML but does support the `<details>` tag, then we'll unfortunately need a more complex solution of refactoring things... but I hope not. Fix #6453
While researching dependabot#6287 (comment), I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213 which says that Azure ADO now supports the `<details>` tag in Markdown. Furthermore, I suspect that ADO now fully supports HTML in PR descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body. So opening this PR as the simple solution. If ADO doesn't support HTML but does support the `<details>` tag, then we'll unfortunately need a more complex solution of refactoring things... but I hope not. Fix dependabot#6453
While researching dependabot#6287 (comment), I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213 which says that Azure ADO now supports the `<details>` tag in Markdown. Furthermore, I suspect that ADO now fully supports HTML in PR descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body. So opening this PR as the simple solution. If ADO doesn't support HTML but does support the `<details>` tag, then we'll unfortunately need a more complex solution of refactoring things... but I hope not. Fix dependabot#6453
While researching #6287 (comment), I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213 which says that Azure ADO now supports the `<details>` tag in Markdown. Furthermore, I suspect that ADO now fully supports HTML in PR descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body. So opening this PR as the simple solution. If ADO doesn't support HTML but does support the `<details>` tag, then we'll unfortunately need a more complex solution of refactoring things... but I hope not. Fix #6453
* Azure DevOps now supports HTML in PR descriptions While researching #6287 (comment), I noticed that https://developercommunity.visualstudio.com/content/problem/608769/add-support-for-in-markdown.html eventually leads to https://developercommunity.visualstudio.com/t/add-support-for-the-html-tag-in-markdown/609415#T-N1190213 which says that Azure ADO now supports the `<details>` tag in Markdown. Furthermore, I suspect that ADO now fully supports HTML in PR descriptions but it's not documented either way in https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/create?view=azure-devops-rest-7.0&tabs=HTTP#request-body. So opening this PR as the simple solution. If ADO doesn't support HTML but does support the `<details>` tag, then we'll unfortunately need a more complex solution of refactoring things... but I hope not. Fix #6453 * Add a test on azure sources --------- Co-authored-by: Barry Gordon <brrygrdn@github.com>
Recently something changed in formatting the PR description, resulting in a mess of HTML where a nice description should be in bitbucket.
This PR changes the PR description from:

to:
