feat(changelog): skip ssh and x509 signatures in tag messages#748
Merged
orhun merged 1 commit intoorhun:mainfrom Jul 27, 2024
Merged
Conversation
Git supports SSH and x509 signatures in addition to GPG signatures. See <https://git-scm.com/docs/gitformat-signature#_description>. The regex is not 100% accurate (e.g. this would allow `SSH MESSAGE`, which is not part of the gitformat-signature description), but I prioritized readability over correctness in this case (since the code is for replacing text, not verifying the signature).
|
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #748 +/- ##
=======================================
Coverage 36.71% 36.71%
=======================================
Files 19 19
Lines 1501 1501
=======================================
Hits 551 551
Misses 950 950
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
orhun
approved these changes
Jul 27, 2024
Owner
orhun
left a comment
There was a problem hiding this comment.
Perfect, thanks for catching this!
|
Congrats on merging your first pull request! ⛰️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Support for tag messages was added in 3eb828e. The commit contains code for stripping GPG signatures from the tag message, but git supports SSH signatures and x509 signatures as well.
This PR adds support for stripping those signature types.
The regex is not 100% accurate (e.g. this would allow
SSH MESSAGE, which is not part of the gitformat-signature description), but I prioritized readability over correctness in this case (since the code is for replacing text, not verifying the signature).Motivation and Context
Signatures should not show up in the changelog, regardless of what kind of signature was used.
How Has This Been Tested?
I have no x509 certificates, but I created a SSH-signed tag in my fork, and then ran the
resolves_existing_tag_with_name_and_messagetest and replaced the tag that is checked fromv0.2.3toexample-ssh-signed-tagScreenshots / Logs (if applicable)
Types of Changes
Arguably this could also be a bug fix.
Checklist:
I did not update any documentation, since I could find no mention of the gpg signature stripping.
I am not sure how to add a test: the existing functionality is covered by reading a tag that is GPG signed, but I have no way to add a SSH signed tag to this repository :^)