Skip to content

Add distribution status check for autostart sequence#157

Merged
brucetony merged 2 commits intomainfrom
152-fix-internal-token-retrieval
Mar 18, 2026
Merged

Add distribution status check for autostart sequence#157
brucetony merged 2 commits intomainfrom
152-fix-internal-token-retrieval

Conversation

@brucetony
Copy link
Copy Markdown
Collaborator

@brucetony brucetony commented Mar 18, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Validation now requires distribution status to be confirmed before analyses are processed.
  • Chores

    • Autostart loop refactored to decouple execution from instance state and improve logging for periodic checks.
  • Tests

    • Updated mock test data to reflect an executed distribution status.
  • Documentation

    • Minor wording clarifications in runtime docstrings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 973a6d7e-a71b-4359-9e03-270cab08c20d

📥 Commits

Reviewing files that changed from the base of the PR and between 317d9be and d5a4df7.

📒 Files selected for processing (1)
  • tests/constants.py

📝 Walkthrough

Walkthrough

hub_adapter/autostart.py now requires distribution_status == "executed" when parsing analyses and converts _run_autostart from an instance method to an async static method with added per-iteration logging. tests/constants.py updates a mock analysis to set distribution_status to "executed".

Changes

Cohort / File(s) Summary
Autostart validation and refactor
hub_adapter/autostart.py
parse_analyses now collects distribution_status and requires it be "executed" alongside approved and build_status == "executed". _run_autostart changed to @staticmethod async def _run_autostart(interval: int) -> None, loop logs "Checking for new analyses to start" each iteration. Minor docstring edits.
Test fixture update
tests/constants.py
Adjusted MOCK_ANALYSIS to set distribution_status to "executed" (was None), aligning test data with new validation logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through code with a curious nose,
I stamp "executed" where duty goes,
Static steps and log-light beams,
Analyses wake and start their dreams,
I munch on tests and do a little pose.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 'Add distribution status check for autostart sequence' directly reflects the main change: adding distribution_status validation in the autostart sequence.

✏️ 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 152-fix-internal-token-retrieval
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

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)
hub_adapter/autostart.py (1)

479-479: Consider lowering polling heartbeat log verbosity.

Line 479 logs every cycle at INFO, which can be noisy in steady-state production. DEBUG is usually better for this heartbeat line.

📉 Suggested tweak
-                logger.info("Checking for new analyses to start")
+                logger.debug("Checking for new analyses to start")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hub_adapter/autostart.py` at line 479, The heartbeat log "Checking for new
analyses to start" is too noisy at INFO; change the log level to DEBUG by
replacing the logger.info call with logger.debug and, if desired, wrap it with a
logger.isEnabledFor(logging.DEBUG) check to avoid any unnecessary formatting
cost; update the reference in autostart.py where the logger variable emits that
message so the periodic polling heartbeat is only visible at DEBUG verbosity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@hub_adapter/autostart.py`:
- Line 479: The heartbeat log "Checking for new analyses to start" is too noisy
at INFO; change the log level to DEBUG by replacing the logger.info call with
logger.debug and, if desired, wrap it with a logger.isEnabledFor(logging.DEBUG)
check to avoid any unnecessary formatting cost; update the reference in
autostart.py where the logger variable emits that message so the periodic
polling heartbeat is only visible at DEBUG verbosity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90f7a0fd-fe40-4af7-bf92-7c8223d4db9e

📥 Commits

Reviewing files that changed from the base of the PR and between 2e1a92a and 317d9be.

📒 Files selected for processing (1)
  • hub_adapter/autostart.py

@brucetony brucetony merged commit 14eb93d into main Mar 18, 2026
3 checks passed
@brucetony brucetony deleted the 152-fix-internal-token-retrieval branch March 18, 2026 13:34
@brucetony brucetony linked an issue Mar 19, 2026 that may be closed by this pull request
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.

Check for distribution status

1 participant