← Back to Pull requests

[19.0][IMP] base_tier_validation: chatter warning at request_validation if reviewers lack access #32

Closed
unknown closed this pull request without merging on Nov 16, 2026 10:59 UTC
View on GitHub
unknown unknown commented on May 13, 2026 21:52 UTC
Author

Summary

Make stalled-by-misconfiguration tier validations visible at runtime instead of letting them silently freeze.

After request_validation creates the tier.review rows for a record, the new _warn_reviewers_lacking_access helper checks whether each reviewer can read the document itself, so access rights and record rules both count. For any reviewer who can't:

  • a server-level WARNING is logged (record name, id, reviewer logins) — enough for an admin to debug from logs;

  • a chatter message is posted on the validated document naming the affected reviewer(s) and explaining the workflow will stall until they get access or are replaced.
  • This catches the cases the onchange warning at definition save (#31) can't:

  • review_type='field' (reviewer only resolves at validation time);

  • group membership changed after the definition was saved;

  • reviewers who can read the model but are hidden from this document by a record rule.
  • Reproduction

    1. As admin, create a tier definition on account.move with the demo user as reviewer.
    2. Log in as admin; create a journal entry; request validation.
    3. Before: nothing visible to anyone — demo can't see the document, admin doesn't know why the workflow is stuck.
    4. After: chatter on the journal entry says "the following reviewer(s) may not be able to read this document...: Demo. The workflow will remain pending until they get access or are replaced." Server log also gets a WARNING.

    Record rules

    The check runs on the document as the reviewer, in the reviewer's companies, so a record rule that hides the document is caught too. The onchange in #31 has no document yet, so it stays model-level, and its warning says so.

    Test plan

    Tests:

  • test_request_validation_warns_reviewer_without_access: unlinks the tester model's ir.model.access, requests validation as test_user_2, asserts a chatter message naming the reviewer was posted.

  • test_request_validation_warns_reviewer_hidden_by_record_rule: the reviewer can read the model, a record rule hides this document; the warning names them.

  • test_request_validation_no_warning_when_reviewer_has_access: same flow with the default public ACL in place, asserts no spurious chatter message.
  • Companion PR

    #31 covers the same problem at config time (onchange warning on tier.definition). They're independent — review either order.

    Diff: 298 lines (+223 / -75) across 3 files Reviewer: bofiltd Review duration: 268627m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 298 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #32"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40% (MEDIUM) · Higher = larger blast radius
    40%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%