Skip to content

Conversation

@PatOConnor43
Copy link

@PatOConnor43 PatOConnor43 commented Oct 20, 2018

Resolves #693

Checklist

  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

  • This PR introduces a generate_changelog.sh script that should take the newest PRs that have not been part of the latest release and creates an entry for them in the CHANGELOG.md file.
  • This uses the free, unauthenticated Github api to get PR titles. I felt like this was okay since it was the simplest solution and they allow 60 requests per hour this way.

Example usage and output:

./generate_changelog.sh -v 6.0.0 -t 59077e7424629898d6554bc6a0ddcbd768901ae2
Getting title of PR #656
Getting title of PR #636
Getting title of PR #628
Getting title of PR #613
Getting title of PR #619
Getting title of PR #616
Getting title of PR #611
Successfully wrote to CHANGELOG.md

diff

diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd2334b..ad57211 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
 # Change Log
 All notable changes to this project will be documented in this file.
+## [6.0.0] - 2018-10-19 ##
+### Added
+- [PR #656](https://github.com/sendgrid/sendgrid-python/pull/656): Fix helper mail_example redirection link
+- [PR #636](https://github.com/sendgrid/sendgrid-python/pull/636): Fix broken link for mail example
+- [PR #628](https://github.com/sendgrid/sendgrid-python/pull/628): Update README
+- [PR #613](https://github.com/sendgrid/sendgrid-python/pull/613): Update README.md by including email
+- [PR #619](https://github.com/sendgrid/sendgrid-python/pull/619): Fix format of dependency `pytest`
+- [PR #616](https://github.com/sendgrid/sendgrid-python/pull/616): Fix typos
+- [PR #611](https://github.com/sendgrid/sendgrid-python/pull/611): fixes #610
+
 
 ## [5.6.0] - 2018-08-20 ##
 ### Added

If you have questions, please send an email to SendGrid, or file a GitHub Issue in this repository.

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 20, 2018
@SendGridDX
Copy link

SendGridDX commented Oct 20, 2018

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 20, 2018

Codecov Report

Merging #695 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #695      +/-   ##
==========================================
+ Coverage   85.03%   85.04%   +0.01%     
==========================================
  Files          35       35              
  Lines        1156     1157       +1     
  Branches      172      172              
==========================================
+ Hits          983      984       +1     
  Misses         90       90              
  Partials       83       83
Impacted Files Coverage Δ
sendgrid/helpers/mail/validators.py 44.44% <0%> (ø) ⬆️
sendgrid/helpers/mail/exceptions.py 66.66% <0%> (ø) ⬆️
sendgrid/helpers/inbound/send.py 93.75% <0%> (ø) ⬆️
sendgrid/helpers/mail/content.py 84.61% <0%> (ø) ⬆️
sendgrid/helpers/inbound/config.py 97.05% <0%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cedb4cc...a1fc8c7. Read the comment docs.

@PatOConnor43
Copy link
Author

I noticed that this issue was in the java library as well. If this PR gets accepted I can PR it there as well or you can. Whatever's easiest for you.

@PatOConnor43
Copy link
Author

@thinkingserious I don't want to be a pain, just don't want this to slip through the cracks. Can I get review on this?

@thinkingserious
Copy link
Contributor

This is awesome @PatOConnor43!

I would just say that we should include an option where I can pass our GitHub token in for the API call so that we don't get hit by the rate limiting issue.

@PatOConnor43
Copy link
Author

I can definitely do that. I'll get that updated tonight. Thanks!

@PatOConnor43
Copy link
Author

@thinkingserious This should be ready for review again. It supports passing in the token with a -t flag or as an env var. It will also fall back to the un-authenticated way if no token is provided.

@misterdorm misterdorm added status: work in progress Twilio or the community is in the process of implementing hacktoberfest difficulty: hard fix is hard in difficulty and removed status: code review request requesting a community code review or review from Twilio labels Oct 30, 2018
Copy link
Contributor

@misterdorm misterdorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine as-is, but I left a few suggestions for improvements if you would like to take those on. Thanks!

url="$host/$origin/$repo/pull/$pr"
api_url="$api_host/repos/$origin/$repo/pulls/$pr"
curl_command="curl -s $api_url"
if [ "$authorization_token" != "" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do: if [ -z "$authorization_token" ] instead

curl_command="curl -s $api_url"
if [ "$authorization_token" != "" ]
then
curl_command="curl -H \"Authorization: token $authorization_token\" -s $api_url"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:
curl_command="$curl_command -H \"Authorization: token $authorization_token\""
So there is a single place to update the curl command if needed in the future.

-v v_content="$content" \
'/All notable changes to this project will be documented in this file/{print;print v_header1;print v_header2;print v_content;next}1' CHANGELOG.md \
> CHANGELOG.md.temp
mv CHANGELOG.md.temp CHANGELOG.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mv -f just to be sure?

# Generate changelog from last tag
latest_release="$(git describe --tags --abbrev=0)"
create_changelog
echo "Successfully wrote to CHANGELOG.md" No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If create_changelog fails for some reason, it would be nice to display an error message, instead of "success" regardless of the outcome.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a set -e at the top of the file. I think this should halt the script and print the expected error message. Does that work for you?

@PatOConnor43
Copy link
Author

Can do 👍 I'll get this updated tonight

@thinkingserious thinkingserious added type: twilio enhancement feature request on Twilio's roadmap status: waiting for feedback waiting for feedback from the submitter and removed status: work in progress Twilio or the community is in the process of implementing labels Oct 30, 2018
@PatOConnor43
Copy link
Author

Thanks for the review @misterdorm. I noticed that this issue was posted in a couple of the sendgrid repos. Would it be helpful for me to make PRs to them as well? I don't want to spam this PR in a bunch of repos if you guys just want to handle it.

@misterdorm
Copy link
Contributor

@PatOConnor43 If you want to create PRs in the other repos where someone else hasn't already picked up the issue, please feel free. There are at least a few other repos where others have implemented this, and in those cases it would just be redundant. Thanks!

@misterdorm misterdorm added status: work in progress Twilio or the community is in the process of implementing and removed status: waiting for feedback waiting for feedback from the submitter labels Oct 31, 2018
@thinkingserious
Copy link
Contributor

Hello @PatOConnor43,

Thanks again for the PR!

It's HACKTOBERFEST! We want to show our appreciation by sending you some special Hacktoberfest swag. If you have not already, could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@PatOConnor43
Copy link
Author

@thinkingserious Any chance I can still get one of those sweet Sendgrid Hacktoberfest shirts for this PR?

@childish-sambino
Copy link
Contributor

Closing as we're now using internal tooling for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: hard fix is hard in difficulty status: work in progress Twilio or the community is in the process of implementing type: twilio enhancement feature request on Twilio's roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-generate the release notes upon release

5 participants