Add workflow to clean Dependabot PR descriptions#1005
Add workflow to clean Dependabot PR descriptions#1005mhucka wants to merge 2 commits intoquantumlib:mainfrom
Conversation
This adds a simple work to clean up the Dependabot description bodies to remove unwanted sections (like the list of commands) and convert the HTML body to Markdown. The algorithm is simple: look for `<details><summary>Commits</summary>`, which marks the beginning of a section listing the commits in the upstream repository, and just delete everything in the Dependabot description from that point to the end. This gets rid of the commits list, the Dependabot command summary, and miscellaneous other bits that we don't find useful.
pavoljuhas
left a comment
There was a problem hiding this comment.
I am not sure about this - a quick dependabot reference can be useful when working on the PR. After this change maintainers would need to fish it out from the first message history which can be confusing.
I am approving in case you feel it is worth that risk.
By "dependabot reference", do you mean the list of dependabot commands that it adds to the PR, or something else? If it's that list of commands, it would be easy enough to append a link to this page after munging the PR description. That would keep the PR description short, and perhaps be more useful. |
Yes, the list of dependabot commands.
Yes, that would however still introduce an off-topic info to the commit message (or require a manual edit). I gave the clean-up code a test run on the description of quantumlib/Cirq#7779 which left a What's Changed and Changelog sections for the first package; still too much non-relevant information. I feel attempts to transform the description automatically would be fragile should dependabot decide to change message formatting. For cirq I plan to just add a simple blocking check on the commit message length. |
This adds a simple work to clean up the Dependabot description bodies to remove unwanted sections (like the list of commands) and convert the HTML body to Markdown.
The algorithm is simple: look for
<details><summary>Commits</summary>, which marks the beginning of a section listing the commits in the upstream repository, and just delete everything in the Dependabot description from that point to the end. This gets rid of the commits list, the Dependabot command summary, and miscellaneous other bits that we don't find useful.