Skip to content

Conversation

@artparrot-ux
Copy link

@artparrot-ux artparrot-ux commented Sep 17, 2025

Log which HARD_CHECK_KEYS failed in grail/cli/validate.py

Summary by CodeRabbit

  • New Features
    • The CLI validator now includes clearer error output on hard verification failures. It lists the specific checks that failed, helping users quickly identify the root cause when validation does not pass. No changes to the execution flow or error handling—only improved visibility into failure details to aid troubleshooting without altering existing behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Walkthrough

Added detailed logging on hard verification failures in the CLI validator by computing the specific failed check keys and appending them to the log message. No control flow or error handling changes.

Changes

Cohort / File(s) Summary of changes
CLI Validation Logging
grail/cli/validate.py
On hard-check failure, compute failed_keys from HARD_CHECK_KEYS using checks.get(k, False) and log "failed checks = [failed_keys]"; no changes to branching or exceptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Thump-thump goes my coder heart at night,
I list failed keys by moonlit byte,
No paths diverged, no logic fight—
Just clearer tracks in error light.
A carrot toast to logs done right! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately summarizes the primary change: adding logging of failed HARD_CHECK_KEYS in the CLI validate module. It names the affected area (cli/validate) and the behavior change (log failed HARD_CHECK_KEYS for hard verification) without vague language or extraneous detail, so a teammate scanning history can understand the main intent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
grail/cli/validate.py (1)

1251-1256: Prefer lazy logging with parseable payload

Use logger’s %s formatting and emit a JSON array for easier grepping/metrics. Minor style/perf win.

Apply this diff:

-                    failed_keys = [k for k in HARD_CHECK_KEYS if not checks.get(k, False)]
-                    logger.warning(
-                        f"Hard verification failed for uid {uid_str}; "
-                        f"invalidating uid for window {target_window}; "
-                        f"failed checks = {failed_keys}"
-                    )
+                    failed_keys = [k for k in HARD_CHECK_KEYS if not checks.get(k, False)]
+                    logger.warning(
+                        "Hard verification failed for uid %s; invalidating uid for window %s; failed_checks=%s",
+                        uid_str,
+                        target_window,
+                        json.dumps(failed_keys),
+                    )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9f6d5a and c6e1392.

📒 Files selected for processing (1)
  • grail/cli/validate.py (1 hunks)
🔇 Additional comments (1)
grail/cli/validate.py (1)

1251-1256: LGTM: logging failed HARD_CHECK_KEYS meets the PR objective

Captures and reports exactly which hard checks failed; keeps order stable via HARD_CHECK_KEYS.

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