Skip to content

Conversation

@reichie020212
Copy link
Member

Why is this change needed?

spp_sms module is still in another repo and is still in 15.0

How was the change implemented?

Moved the spp_sms module to this repo and migrated it to 17.0

New unit tests

Unit tests executed by the author

How to test manually

Related links

@codecov
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

❌ Patch coverage is 90.02268% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.00%. Comparing base (d840c60) to head (6ec4f45).
⚠️ Report is 54 commits behind head on 17.0.

Files with missing lines Patch % Lines
spp_sms/models/iap_account.py 40.42% 28 Missing ⚠️
spp_sms/models/mailing_mailing.py 91.56% 1 Missing and 6 partials ⚠️
spp_sms/tools/sms_api.py 73.07% 7 Missing ⚠️
spp_sms/tests/test_mailing_mailing.py 98.56% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #785      +/-   ##
==========================================
+ Coverage   75.67%   76.00%   +0.32%     
==========================================
  Files         764      778      +14     
  Lines       20218    20659     +441     
  Branches     2501     2541      +40     
==========================================
+ Hits        15300    15701     +401     
- Misses       4382     4416      +34     
- Partials      536      542       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

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

@reichie020212 please check the codecov report.

@gonzalesedwin1123 gonzalesedwin1123 self-requested a review March 31, 2025 01:21
Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

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

@reichie020212 check also the sonarqubecloud report.

@OpenSPP OpenSPP deleted a comment from github-actions bot Mar 31, 2025
@github-actions
Copy link

github-actions bot commented Mar 31, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@megaxayda
Copy link

I have read the CLA Document and I hereby sign the CLA

openspp-bot added a commit to OpenSPP/openspp-cla that referenced this pull request Mar 31, 2025
@megaxayda megaxayda self-assigned this Apr 2, 2025
@kneckinator kneckinator self-requested a review April 2, 2025 06:51
@OpenSPP OpenSPP deleted a comment from Copilot AI Apr 11, 2025
@OpenSPP OpenSPP deleted a comment from Copilot AI Apr 11, 2025
"website": "https://github.com/OpenSPP/openspp-modules",
"license": "AGPL-3",
"depends": ["iap", "sms", "mass_mailing_sms", "g2p_registry_base", "g2p_programs"],
"development_status": "Beta",
Copy link
Contributor

Choose a reason for hiding this comment

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

Status should be alpha at this stage.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

error_messages = original_get_sms_api_error_messages(self)
error_messages["invalid_to_number"] = _("The number you're trying to reach is not correctly formatted.")
error_messages["invalid_from_number"] = _("The number you're trying to send from is not correctly formatted.")
error_messages["cannot_be_reached"] = _("The number you're trying to reach is not correctly formatted.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This message is misleading. The message means that the SMS Gateway cannot reach the phone number, and that it might be incorrect. Better error message: "The number cannot be reached. Please check the number."

See: https://www.twilio.com/docs/api/errors/21214

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

result.append({"state": state, "credit": 0, "res_id": number["number"]})
return result

# NOTE: Removing sns_amazon for now since boto3 is not compatible with the current version of urllib3
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this only mentioned here and not in the PR conversation? This is something we should solve. When you say current version of urllib3, which version are you referring to?

Copy link
Member Author

Choose a reason for hiding this comment

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

what i mean in this comment is the latest version. I haven't thoroughly investigating this since we're not using sms amazon. i'll try to dwell on this issue on a later time.

return result

# NOTE: Removing sns_amazon for now since boto3 is not compatible with the current version of urllib3
# elif account[0].provider == "sns_amazon":
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move all the AWS SNS-specific code to a separate function, i.e awssns_send_sms_batch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

account = self.env["iap.account"].search([("active_status", "=", True)]).get("sms")

if not account or account[0].provider != "sms_twilio":
return original_send_sms_batch(self, messages, delivery_reports_url)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this SMS batch function handle AWS SNS messages?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@sonarqubecloud
Copy link

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 24, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants