Fix incorrect subscription name in Phase 9 of ZODAN add_node#417
Fix incorrect subscription name in Phase 9 of ZODAN add_node#417mason-sharp merged 2 commits intomainfrom
Conversation
create_sub_on_new_node_to_src_node generated sub_{subscriber}_{provider}
instead of the expected sub_{provider}_{subscriber} convention, causing
remove-node to fail when looking up subscriptions by their expected name.
Introduce spock.gen_sub_name(provider_node, subscriber_node) helper and
replace all inline 'sub_' || concatenations to prevent future mismatches.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdded an immutable helper function Changes
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/tap/t/012_zodan_basics.pl (1)
54-74: Consider usingspock.gen_sub_namein these test calls to avoid future drift.Hardcoding the name in both places can regress again if naming rules evolve.
♻️ Suggested update
-psql_or_bail(1, "SELECT spock.sub_disable('sub_n2_n1')"); +psql_or_bail(1, "SELECT spock.sub_disable(spock.gen_sub_name('n2', 'n1'))"); ... -psql_or_bail(1, "SELECT spock.sub_enable('sub_n2_n1')"); +psql_or_bail(1, "SELECT spock.sub_enable(spock.gen_sub_name('n2', 'n1'))");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/tap/t/012_zodan_basics.pl` around lines 54 - 74, Replace the hardcoded subscription name 'sub_n2_n1' with a generated name using spock.gen_sub_name to prevent drift: update the psql_or_bail calls that invoke spock.sub_disable('sub_n2_n1') and spock.sub_enable('sub_n2_n1') to compute the subscription name via spock.gen_sub_name(...) (matching the same parameters used when creating the subscription), and likewise update any other test references (e.g., assertions or calls that expect that literal name such as checks against spock.local_node) to use the generated name so tests remain correct if naming rules change.
🤖 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/tap/t/012_zodan_basics.pl`:
- Around line 54-74: Replace the hardcoded subscription name 'sub_n2_n1' with a
generated name using spock.gen_sub_name to prevent drift: update the
psql_or_bail calls that invoke spock.sub_disable('sub_n2_n1') and
spock.sub_enable('sub_n2_n1') to compute the subscription name via
spock.gen_sub_name(...) (matching the same parameters used when creating the
subscription), and likewise update any other test references (e.g., assertions
or calls that expect that literal name such as checks against spock.local_node)
to use the generated name so tests remain correct if naming rules change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b4a48883-7741-4f0d-bfef-8f20aff169b2
📒 Files selected for processing (1)
tests/tap/t/012_zodan_basics.pl
ibrarahmad
left a comment
There was a problem hiding this comment.
LGTM, Just check If we need some docs adjustment or not.
create_sub_on_new_node_to_src_node generated sub_{subscriber}_{provider} instead of the expected sub_{provider}_{subscriber} convention, causing remove-node to fail when looking up subscriptions by their expected name.
Introduce spock.gen_sub_name(provider_node, subscriber_node) helper and replace all inline 'sub_' || concatenations to prevent future mismatches.