Skip to content

Remove Yahoo dash address normalization#14

Merged
gmr merged 2 commits into
gmr:masterfrom
andrewrabert:fix/remove-yahoo-dash-addressing
Mar 13, 2026
Merged

Remove Yahoo dash address normalization#14
gmr merged 2 commits into
gmr:masterfrom
andrewrabert:fix/remove-yahoo-dash-addressing

Conversation

@andrewrabert
Copy link
Copy Markdown
Contributor

@andrewrabert andrewrabert commented Feb 24, 2026

Yahoo dash addresses (e.g. nickname-keyword@) are distinct accounts, not aliases of the base address (nickname@). The DASH_ADDRESSING rule was incorrectly normalizing them as equivalent, causing unrelated addresses to be treated as the same. Base addresses themselves are not deliverable inboxes.

This change removes all normalization rules from the Yahoo provider. The provider class remains to continue identifying Yahoo addresses and to explicitly denote that they are not to be normalized.

Some info on this https://help.yahoo.com/kb/SLN28815.html

Summary by CodeRabbit

  • Behavior Change
    • Dash-based email normalization removed — addresses with dashes (e.g., Yahoo) now preserve the full local-part instead of being truncated.
  • Chores
    • CI now runs on pull request events in addition to push, respecting existing path filters.

Yahoo dash addresses (e.g. nickname-keyword@) are distinct accounts,
not aliases of the base address (nickname@). The DASH_ADDRESSING
rule was incorrectly normalizing them as equivalent, causing
unrelated addresses to be treated as the same. Base addresses
themselves are not deliverable inboxes.

This change removes all normalization rules from the Yahoo provider.
The provider class remains to explicitly denote that Yahoo addresses
are not to be normalized.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

The PR removes dash-based local-part normalization by deleting DASH_ADDRESSING usage and associated splitting logic, replaces the Rules enum member with NONE, updates the Yahoo provider to use Rules.NONE, adjusts the Yahoo test expectation, and adds a pull_request trigger to CI workflow.

Changes

Cohort / File(s) Summary
Rule Definition
email_normalize/providers.py
Removed DASH_ADDRESSING enum member, added NONE = 0, and changed Yahoo's Flags from Rules.DASH_ADDRESSING to Rules.NONE with an explanatory comment.
Normalization Logic
email_normalize/__init__.py
Deleted the code path that split the local_part on - (dash addressing), so dash-based normalization is no longer applied; other rules remain.
Tests
tests/test_normalize.py
Updated Yahoo test expected normalized address to use the full local_part instead of truncating at the first dash.
CI Workflow
.github/workflows/testing.yaml
Added pull_request trigger to the workflow and paths-ignore for docs and metadata files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nibble code beneath the moonlight,
Dashes gone — what a gentle sight,
NONE hops in, tidy and neat,
Tests updated, CI taps its feet,
A rabbit cheers for simpler bytes 🐇✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: removal of Yahoo dash address normalization, which is the core objective across all modified files.
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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
tests/test_normalize.py (1)

108-115: Test update is correct.

uuid.uuid4() always produces a dash-containing string (e.g., a1b2c3d4-e5f6-...), so this test implicitly verifies that a dash-containing local_part is no longer truncated at the first dash. The updated assertion correctly reflects the new no-normalization behavior.

As a minor readability improvement, an explicit nickname-keyword@ style local_part would make the intent of the test self-evident without relying on knowledge of UUID formatting:

✨ Optional: explicit dash-address test
 def test_yahoo(self):
-    local_part = str(uuid.uuid4())
-    domain_part = str(uuid.uuid4())
-    address = '{}@{}'.format(local_part, domain_part)
+    # Dash addresses (nickname-keyword@) are distinct accounts, not aliases
+    nickname = str(uuid.uuid4())
+    local_part = '{}-keyword'.format(nickname)
+    domain_part = str(uuid.uuid4())
+    address = '{}@{}'.format(local_part, domain_part)
     mx_records = [(1, 'mta5.am0.yahoodns.net')]
     self._perform_test(
         address, '{}@{}'.format(local_part, domain_part),
         mx_records, 'Yahoo')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_normalize.py` around lines 108 - 115, Replace the generated uuid
local_part in test_yahoo with a clear dash-containing literal (e.g.,
"nickname-keyword") so the intent is explicit; update the local_part and address
variables used in the call to self._perform_test(address,
'{}@{}'.format(local_part, domain_part), mx_records, 'Yahoo') while keeping
mx_records and the expected result unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/test_normalize.py`:
- Around line 108-115: Replace the generated uuid local_part in test_yahoo with
a clear dash-containing literal (e.g., "nickname-keyword") so the intent is
explicit; update the local_part and address variables used in the call to
self._perform_test(address, '{}@{}'.format(local_part, domain_part), mx_records,
'Yahoo') while keeping mx_records and the expected result unchanged.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81b2e23 and 6648712.

📒 Files selected for processing (3)
  • email_normalize/__init__.py
  • email_normalize/providers.py
  • tests/test_normalize.py
💤 Files with no reviewable changes (1)
  • email_normalize/init.py

Copy link
Copy Markdown

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/testing.yaml (1)

49-53: ⚠️ Potential issue | 🟠 Major

Upgrade codecov/codecov-action@v1.0.2 — this version was sunset on February 1, 2022 and no longer functions.

Coverage uploads will fail on every push to any branch. Since fail_ci_if_error: true is enabled (line 54), these failures will block CI.

Upgrade to the current version @v5 (or @v5.5.2 for exact pinning):

Proposed fix
-        uses: codecov/codecov-action@v1.0.2
+        uses: codecov/codecov-action@v5
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/testing.yaml around lines 49 - 53, Replace the deprecated
Codecov action reference used in the workflow (uses:
codecov/codecov-action@v1.0.2) with the supported v5 release (e.g., uses:
codecov/codecov-action@v5 or `@v5.5.2`) so coverage uploads no longer fail; keep
the existing inputs (token: ${{secrets.CODECOV_TOKEN}} and file:
build/coverage.xml) and any related flags (like fail_ci_if_error: true)
unchanged unless the new action docs indicate a renamed input, in which case
update the input name to match the v5 parameter names.
🧹 Nitpick comments (1)
.github/workflows/testing.yaml (1)

28-28: actions/checkout@v1 is deprecated — upgrade to @v4.

These actions will start to fail after January 30, 2025. While this is a pre-existing issue, since the workflow file is being touched in this PR it's a good opportunity to upgrade.

🔧 Proposed fix
-        uses: actions/checkout@v1
+        uses: actions/checkout@v4
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/testing.yaml at line 28, The workflow is using the
deprecated action reference "uses: actions/checkout@v1"; update that step to use
the maintained release "actions/checkout@v4" (replace the string
"actions/checkout@v1" with "actions/checkout@v4" in the workflow) and verify any
inputs remain compatible with Checkout v4 in the same job step where "uses:
actions/checkout@v1" appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/testing.yaml:
- Around line 49-53: Replace the deprecated Codecov action reference used in the
workflow (uses: codecov/codecov-action@v1.0.2) with the supported v5 release
(e.g., uses: codecov/codecov-action@v5 or `@v5.5.2`) so coverage uploads no longer
fail; keep the existing inputs (token: ${{secrets.CODECOV_TOKEN}} and file:
build/coverage.xml) and any related flags (like fail_ci_if_error: true)
unchanged unless the new action docs indicate a renamed input, in which case
update the input name to match the v5 parameter names.

---

Nitpick comments:
In @.github/workflows/testing.yaml:
- Line 28: The workflow is using the deprecated action reference "uses:
actions/checkout@v1"; update that step to use the maintained release
"actions/checkout@v4" (replace the string "actions/checkout@v1" with
"actions/checkout@v4" in the workflow) and verify any inputs remain compatible
with Checkout v4 in the same job step where "uses: actions/checkout@v1" appears.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6648712 and 228113a.

📒 Files selected for processing (1)
  • .github/workflows/testing.yaml

@gmr gmr merged commit 86dde7e into gmr:master Mar 13, 2026
8 checks passed
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.

2 participants