Skip to content

fix(slurpitsync): process interfaces synchronously instead of concurr…#115

Merged
minitriga merged 1 commit intomainfrom
atg-20260217-slurpit-fix
Feb 18, 2026
Merged

fix(slurpitsync): process interfaces synchronously instead of concurr…#115
minitriga merged 1 commit intomainfrom
atg-20260217-slurpit-fix

Conversation

@minitriga
Copy link
Contributor

@minitriga minitriga commented Feb 18, 2026

…ently

Summary by CodeRabbit

  • Refactor
    • Improved internal processing efficiency for interface operations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Walkthrough

The change in infrahub_sync/adapters/slurpitsync.py converts an asynchronous concurrent execution pattern into a synchronous sequential one. Previously, the code used asyncio.gather() to execute normalize_and_find_prefix concurrently across multiple entries. This is replaced with a synchronous list comprehension that calls normalize_and_find_prefix directly for each entry. The net change removes 5 lines and adds 2, shifting the operation from concurrent to sequential processing without altering the function's signature or public interface.

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting concurrent interface processing to synchronous execution in the slurpitsync adapter.

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


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.

@cloudflare-workers-and-pages
Copy link

Deploying infrahub-sync with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9dc6025
Status: ✅  Deploy successful!
Preview URL: https://511f1e62.infrahub-sync.pages.dev
Branch Preview URL: https://atg-20260217-slurpit-fix.infrahub-sync.pages.dev

View logs

@minitriga minitriga merged commit 84dc75e into main Feb 18, 2026
14 of 15 checks passed
@minitriga minitriga deleted the atg-20260217-slurpit-fix branch February 18, 2026 14:40
Copy link
Contributor

@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)
infrahub_sync/adapters/slurpitsync.py (1)

118-118: filter_interfaces can be de-asyncified now that all await calls are gone.

After this change filter_interfaces has no await expressions, yet it remains async def, and its only call-site (line 189) still wraps it in run_async. The coroutine works but imposes a needless event-loop round-trip and hides the fact that the method is now purely synchronous.

♻️ Proposed refactor
-    async def filter_interfaces(self, interfaces) -> list:
+    def filter_interfaces(self, interfaces) -> list:
-            nodes = self.run_async(self.filter_interfaces(interfaces))
+            nodes = self.filter_interfaces(interfaces)

Also applies to: 151-152

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@infrahub_sync/adapters/slurpitsync.py` at line 118, The method
filter_interfaces should be converted from "async def filter_interfaces" to a
regular "def filter_interfaces(...)->list" since there are no awaits inside;
change its signature and body to synchronous code (keep the same logic and
return type). Update its call-site(s) that currently wrap it with run_async (and
any await/run_async usage) to call filter_interfaces directly and use the
returned list synchronously. Also check the similar case referenced around the
nearby functions (the other async defs at the same region) and apply the same
de-asyncify + caller update for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@infrahub_sync/adapters/slurpitsync.py`:
- Line 118: The method filter_interfaces should be converted from "async def
filter_interfaces" to a regular "def filter_interfaces(...)->list" since there
are no awaits inside; change its signature and body to synchronous code (keep
the same logic and return type). Update its call-site(s) that currently wrap it
with run_async (and any await/run_async usage) to call filter_interfaces
directly and use the returned list synchronously. Also check the similar case
referenced around the nearby functions (the other async defs at the same region)
and apply the same de-asyncify + caller update for consistency.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant