Skip to content

feat(notificationChannels): add Plivo SMS and voice channel config form - #2212

Open
sarveshpatil-plivo wants to merge 1 commit into
n9e:mainfrom
sarveshpatil-plivo:plivo-notification-channels
Open

feat(notificationChannels): add Plivo SMS and voice channel config form#2212
sarveshpatil-plivo wants to merge 1 commit into
n9e:mainfrom
sarveshpatil-plivo:plivo-notification-channels

Conversation

@sarveshpatil-plivo

@sarveshpatil-plivo sarveshpatil-plivo commented Jul 23, 2026

Copy link
Copy Markdown

Adds the configuration form for the Plivo SMS and voice notification channels, the companion to the backend PR ccfos/nightingale#3277.

The form follows the typed-config channels such as PagerDuty, so a user fills in only their own values and never a raw URL or JSON body.

  • New Plivo.tsx form under notificationChannels/pages/Form, with Auth ID, Auth Token as a masked field, and source number. The Answer URL and Answer Method fields appear only for the voice channel, and Answer Method defaults to POST.
  • Added PlivoRequestConfig and the plivo request type in types.ts.
  • Registered the plivo-sms and plivo-voice channels in constants.ts with the phone contact key and the typed plivo_request_config, plus the Plivo logo under /image/logos/.
  • Added i18n entries for all languages (en_US, zh_CN, zh_HK, ja_JP, ru_RU).

Screenshots

Plivo SMS channel form:

plivo-06-sms-form

Plivo Voice channel form:

plivo-07-voice-form

Summary by CodeRabbit

  • New Features
    • Added Plivo Voice and Plivo SMS as notification channel options.
    • Added Plivo configuration fields for authentication, source number, connection settings, retries, and timeouts.
    • Added voice-specific answer URL and method settings.
    • Added localized labels and configuration text in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Plivo voice and SMS notification channel types, typed request configuration, a conditional configuration form, and localized labels across five locales.

Changes

Plivo notification channel

Layer / File(s) Summary
Plivo channel contract and defaults
src/pages/notificationChannels/types.ts, src/pages/notificationChannels/constants.ts
Adds PlivoRequestConfig, enables plivo request types, and defines default configurations for plivo-voice and plivo-sms.
Plivo configuration form
src/pages/notificationChannels/pages/Form/Plivo.tsx, src/pages/notificationChannels/pages/Form/index.tsx
Renders Plivo credentials, source number, networking, retry, timeout, and voice-only webhook fields with conditional validation.
Plivo localized labels
src/pages/notificationChannels/locale/*
Adds Plivo configuration labels and voice/SMS type names to English, Japanese, Russian, Simplified Chinese, and Hong Kong Chinese locales.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant NotificationChannelForm
  participant Plivo
  participant LocaleStrings
  User->>NotificationChannelForm: Select Plivo voice or SMS
  NotificationChannelForm->>Plivo: Provide request_type and ident
  Plivo->>LocaleStrings: Resolve Plivo field labels
  Plivo-->>NotificationChannelForm: Render validated configuration fields
Loading

Suggested reviewers: jsers

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Plivo SMS and voice notification channel configuration support.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/pages/notificationChannels/pages/Form/Plivo.tsx (1)

16-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use Tailwind for conditional container visibility.

Replace the inline display style with conditional block/hidden utilities.

Proposed fix
-    <div
-      style={{
-        display: isPlivo ? 'block' : 'none',
-      }}
-    >
+    <div className={isPlivo ? 'block' : 'hidden'}>

As per coding guidelines, use Tailwind utility classes for container layout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/notificationChannels/pages/Form/Plivo.tsx` around lines 16 - 20,
Update the container div in the Plivo form to replace its inline display style
with conditional Tailwind classes: apply block when isPlivo is true and hidden
otherwise, while preserving the existing visibility behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/notificationChannels/types.ts`:
- Around line 64-74: Update the PlivoRequestConfig interface so answer_url and
answer_method are optional, allowing valid plivo-sms defaults without those
voice-only fields. Restrict answer_method to the literal union 'GET' | 'POST'
while preserving the existing required fields and types.

---

Nitpick comments:
In `@src/pages/notificationChannels/pages/Form/Plivo.tsx`:
- Around line 16-20: Update the container div in the Plivo form to replace its
inline display style with conditional Tailwind classes: apply block when isPlivo
is true and hidden otherwise, while preserving the existing visibility behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e93b8d0d-b920-4c4c-b829-99e2a917d7b4

📥 Commits

Reviewing files that changed from the base of the PR and between 928a0be and 9b5ff18.

⛔ Files ignored due to path filters (1)
  • public/image/logos/plivo.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • src/pages/notificationChannels/constants.ts
  • src/pages/notificationChannels/locale/en_US.ts
  • src/pages/notificationChannels/locale/ja_JP.ts
  • src/pages/notificationChannels/locale/ru_RU.ts
  • src/pages/notificationChannels/locale/zh_CN.ts
  • src/pages/notificationChannels/locale/zh_HK.ts
  • src/pages/notificationChannels/pages/Form/Plivo.tsx
  • src/pages/notificationChannels/pages/Form/index.tsx
  • src/pages/notificationChannels/types.ts

Comment on lines +64 to +74
interface PlivoRequestConfig {
auth_id: string;
auth_token: string;
src_number: string;
answer_url: string;
answer_method: string;
proxy: string;
timeout: number;
retry_times: number;
retry_sleep: number;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Make voice-only fields optional.

plivo-sms defaults omit answer_url and answer_method, but this interface requires both. A valid SMS configuration therefore cannot satisfy ChannelItem. Make them optional; constrain answer_method to 'GET' | 'POST'.

Proposed fix
-  answer_url: string;
-  answer_method: string;
+  answer_url?: string;
+  answer_method?: 'GET' | 'POST';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interface PlivoRequestConfig {
auth_id: string;
auth_token: string;
src_number: string;
answer_url: string;
answer_method: string;
proxy: string;
timeout: number;
retry_times: number;
retry_sleep: number;
}
interface PlivoRequestConfig {
auth_id: string;
auth_token: string;
src_number: string;
answer_url?: string;
answer_method?: 'GET' | 'POST';
proxy: string;
timeout: number;
retry_times: number;
retry_sleep: number;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/notificationChannels/types.ts` around lines 64 - 74, Update the
PlivoRequestConfig interface so answer_url and answer_method are optional,
allowing valid plivo-sms defaults without those voice-only fields. Restrict
answer_method to the literal union 'GET' | 'POST' while preserving the existing
required fields and types.

@sarveshpatil-plivo

Copy link
Copy Markdown
Author

@710leo Are there any other changes to be made?
If not, can we go ahead with merging this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant