Skip to content

Enhance node name extraction logic to accurately classify file format…#1655

Open
jokob-sk wants to merge 1 commit into
mainfrom
next_release
Open

Enhance node name extraction logic to accurately classify file format…#1655
jokob-sk wants to merge 1 commit into
mainfrom
next_release

Conversation

@jokob-sk
Copy link
Copy Markdown
Collaborator

@jokob-sk jokob-sk commented May 25, 2026

…s for PUSH and PULL modes

Summary by CodeRabbit

  • Tests
    • Enhanced sync protocol test suite with improved validation of filename format detection to distinguish between PUSH and PULL operations.
    • Added regression test to ensure node names containing specific encoded markers are correctly processed in PULL mode.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 87f0f272-eca1-42d9-8789-a9525b552acc

📥 Commits

Reviewing files that changed from the base of the PR and between bfe5bc0 and c829c4c.

📒 Files selected for processing (1)
  • test/plugins/test_sync_protocol.py

📝 Walkthrough

Walkthrough

The test suite's node name extraction utility was refined to more strictly distinguish PUSH vs PULL filename patterns by requiring both a .decoded./.encoded. marker and a numeric counter segment for PUSH classification. A regression test was added to ensure PULL filenames with .encoded. in the node name are not misclassified.

Changes

Filename Detection Logic Refinement

Layer / File(s) Summary
PUSH/PULL detection logic update
test/plugins/test_sync_protocol.py
_node_name_from_filename now requires both a .decoded./.encoded. marker and a numeric counter segment to classify a filename as PUSH; otherwise it falls back to PULL extraction. Docstring expanded to document both supported filename shapes.
Regression test for encoded node names in PULL mode
test/plugins/test_sync_protocol.py
Added test_pull_with_encoded_in_node_name to verify that PULL filenames containing .encoded. in the node name extract correctly as PULL node names without PUSH misclassification.

Possibly related PRs

  • netalertx/NetAlertX#1653: Both PRs adjust SYNC filename/node-name extraction logic for decoded/encoded artifacts in the sync protocol implementation and tests.

Poem

A rabbit refines the path with care,
Distinguishing PUSH from PULL with flair,
Numeric counts now validate true,
Edge cases tested, old bugs subdued! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: enhancing node name extraction logic to accurately classify file formats for PUSH and PULL modes, which aligns with the changeset updates to the _node_name_from_filename function.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next_release

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.

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