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
feat(applicationset): add short sha to PR generator #9668 #9669
feat(applicationset): add short sha to PR generator #9668 #9669
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9669 +/- ##
==========================================
+ Coverage 45.84% 45.86% +0.02%
==========================================
Files 227 227
Lines 26846 26856 +10
==========================================
+ Hits 12307 12317 +10
Misses 12859 12859
Partials 1680 1680
Continue to review full report at Codecov.
|
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.
LGTM
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.
Thanks @Redlinkk for the PR.
LGTM!
82d13fa
to
8133222
Compare
I've also added the short sha to the SCM generator as @nar3k requested it on the issue |
8133222
to
d0ddb7e
Compare
Could it be 8 characters? For Gitlab, it's short uses 8 characters -- |
4d114a9
to
7a4aca7
Compare
You are absolutely right @benkn, I made a mistake in my spec document, and I blindly followed it. It should now be fixed. Thanks for the review. |
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.
One nitpick.
"branch": pull.Branch, | ||
"branch_slug": slug.Make(pull.Branch), | ||
"head_sha": pull.HeadSHA, | ||
"head_short_sha": pull.HeadSHA[:8], |
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.
Should there be a length check, just in case the API returns an empty (or short) string?
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.
I added the length check. If the head_sha is shorter than 8 characters, then I return the same value for the head_short_sha.
@@ -127,6 +127,7 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha | |||
"url": repo.URL, | |||
"branch": repo.Branch, | |||
"sha": repo.SHA, | |||
"short_sha": repo.SHA[:8], |
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.
Should there be a length check, just in case the API returns an empty (or short) string?
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.
Same as above
7a4aca7
to
f1ea9f3
Compare
Signed-off-by: Romain Poirot <github@romainpoirot.fr>
Signed-off-by: Romain Poirot <github@romainpoirot.fr>
f1ea9f3
to
5045bce
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.
lgtm, thanks!
Fixes #9668
Signed-off-by: Romain Poirot github@romainpoirot.fr
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: