Skip to content
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: Allowing Users to subscribe to the pro-newsletter #8856

Merged
merged 11 commits into from
Jan 17, 2024

Conversation

MonalikaPatnaik
Copy link
Collaborator

What

tried writing functions in Brevo.pm module for adding users to contact list and getting their contact info.

Screenshot

Related issue(s) and discussion

@sonarcloud
Copy link

sonarcloud bot commented Aug 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot added the Stale label Nov 15, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2023

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (e8cb4f4) 49.28% compared to head (cb1442e) 44.01%.

Files Patch % Lines
lib/ProductOpener/Brevo.pm 56.25% 12 Missing and 2 partials ⚠️
lib/ProductOpener/Users.pm 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8856      +/-   ##
==========================================
- Coverage   49.28%   44.01%   -5.27%     
==========================================
  Files          66       65       -1     
  Lines       20546    20493      -53     
  Branches     4946     4940       -6     
==========================================
- Hits        10126     9021    -1105     
- Misses       9132    10299    +1167     
+ Partials     1288     1173     -115     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot removed the Stale label Dec 3, 2023
@MonalikaPatnaik MonalikaPatnaik marked this pull request as ready for review December 6, 2023 04:45
@MonalikaPatnaik MonalikaPatnaik requested a review from a team as a code owner December 6, 2023 04:45
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Thanks, It's almost good, some changes proposed though to avoid slowing down dev environment and tests.

lib/ProductOpener/Users.pm Outdated Show resolved Hide resolved
lib/ProductOpener/Brevo.pm Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Nearly good, I added comments, I hope they are not too cryptic. Otherwise I can try to fix it for you.

tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
tests/unit/brevo.t Outdated Show resolved Hide resolved
@MonalikaPatnaik
Copy link
Collaborator Author

@alexgarel could you pls tell how would I mock $ProductOpener::Brevo::brevo_api_key in my test, I have tried but it is using the actual value defined in the Brevo.pm module only :"

@alexgarel
Copy link
Member

@MonalikaPatnaik this was not possible to change the brevo_api_key in the module because it was a private variable. So I changed a bit the pattern to use a function so that we can mock it.

At the end I refactored the test a bit to make it less repetitive and easier to read.

Thanks for this PR !

Copy link

sonarcloud bot commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@alexgarel alexgarel enabled auto-merge (squash) January 17, 2024 10:17
@MonalikaPatnaik
Copy link
Collaborator Author

@MonalikaPatnaik this was not possible to change the brevo_api_key in the module because it was a private variable. So I changed a bit the pattern to use a function so that we can mock it.

At the end I refactored the test a bit to make it less repetitive and easier to read.

Thanks for this PR !

Thankyou so much @alexgarel🙂

@teolemon
Copy link
Member

teolemon commented Feb 6, 2024

Just to be clear @MonalikaPatnaik , there's no UI yet, right ?

@MonalikaPatnaik
Copy link
Collaborator Author

Just to be clear @MonalikaPatnaik , there's no UI yet, right ?

No @teolemon, it's a functionality only

john-gom pushed a commit that referenced this pull request May 24, 2024
Brevo.pm module for adding users to contact list using API at subscription time.

---------
Co-authored-by: Alex Garel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Make it possible to subscribe to the pro newsletter
4 participants