Skip to content

Commit 14d33b2

Browse files
author
Alejandro Velez
committed
fix: add diagnostic logging to inventory post_execute for PR posting
Adds explicit warning messages when post_execute skips PR posting so pipeline logs show exactly why no comment was posted.
1 parent 207c1dc commit 14d33b2

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/thothctl/commands/inventory/commands/iac.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,22 @@ def _display_summary(self, inventory: dict) -> None:
400400
def post_execute(self, **kwargs) -> None:
401401
"""Post inventory summary to PR if --post-to-pr flag is set."""
402402
if not getattr(self, '_post_to_pr', False):
403+
logger.info("post_execute: --post-to-pr not set, skipping")
403404
return
404405

405406
inventory = getattr(self, '_inventory', None)
406-
if not inventory or not inventory.get("components"):
407+
if not inventory:
408+
self.ui.print_warning("⚠️ No inventory data available to post to PR")
409+
return
410+
if not inventory.get("components"):
411+
self.ui.print_warning("⚠️ Inventory has no components to post to PR")
407412
return
408413

409414
from ....core.integrations.pr_comments.pr_comment_publisher import publish_to_pr
410415

411416
content = self._build_inventory_markdown(inventory)
417+
logger.info(f"post_execute: built markdown ({len(content)} chars)")
418+
412419
if publish_to_pr(
413420
content=content,
414421
vcs_provider=getattr(self, '_vcs_provider', 'auto'),

src/thothctl/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Version module."""
2-
__version__ = "0.10.33"
2+
__version__ = "0.10.34"

0 commit comments

Comments
 (0)