Skip to content

Conversation

@narayana-plivo
Copy link
Contributor

@narayana-plivo narayana-plivo commented Jan 21, 2026

Summary by CodeRabbit

  • New Features

    • High Availability (HA) Number support added to improve phone-number reliability.
    • New optional parameter when purchasing phone numbers to enable HA behavior.
    • Phone-number purchase responses now include a fallback number for continuity and failover.
  • Tests

    • Added a test validating phone-number purchases with HA enabled.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

Adds HA Number support by introducing an optional ha_enable parameter to Numbers.buy(), updates package version to 4.59.5, adds fallback_number to phone number fixture responses, and includes a test exercising ha_enable.

Changes

Cohort / File(s) Summary
Version Metadata
plivo/version.py, setup.py
Bumped package version to 4.59.5.
HA Number Feature
plivo/resources/numbers.py, CHANGELOG.md
Numbers.buy() signature updated to accept optional ha_enable (boolean); validation and parameter forwarding updated; changelog entry added for 4.59.5 noting HA Number and fallback_number.
Tests & Fixtures
tests/resources/fixtures/phoneNumberCreateResponse.json, tests/resources/test_numbers.py
Added fallback_number field to fixture objects; new test test_create_with_ha_enable added to assert buy accepts ha_enable and issues expected POST.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped a flag named ha_enable bright,
A fallback number tucked in tight,
Version bumped, the changelog sings,
Tests hop in with tiny wings,
Happy jumps — numbers stay right.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Title check ❓ Inconclusive The title 'ha number' is vague and generic, using only an abbreviation without context about what 'HA' means or what change is being made. Use a more descriptive title such as 'Add HA (High Availability) Number support to phone number purchase' to clearly convey the feature being added.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/resources/test_numbers.py`:
- Around line 83-88: The test test_create_with_ha_enabled is failing because
`@with_response` expects a fixture file named
phoneNumberCreateWithHaEnabledResponse.json that doesn't exist; fix by either
adding that fixture under tests/resources/fixtures with the expected mocked
response or (preferred) change the decorator call on test_create_with_ha_enabled
to reuse an existing fixture via the with_response method_name parameter (e.g.,
method_name='phoneNumberCreateResponse') so the test uses a valid fixture;
update only the decorator on test_create_with_ha_enabled or add the new fixture
file accordingly.

@narayana-plivo narayana-plivo merged commit 3bc956d into master Jan 22, 2026
8 of 13 checks passed
@narayana-plivo narayana-plivo deleted the ha-number branch January 22, 2026 03:26
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.

5 participants