Skip to content

Add run(), translate any Throwable, skip redundant SET in within() (0.2.0) - #9

Merged
rasuvaeff merged 1 commit into
masterfrom
feat/review-2026-11-20
Nov 20, 2026
Merged

rasuvaeff merged 1 commit into
masterfrom
feat/review-2026-11-20

Conversation

@rasuvaeff

@rasuvaeff rasuvaeff commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Wave 2 of the 2026-11-20 code-quality review. Requires rasuvaeff/context ^0.5 (uses Context::budgetMs() instead of the private copy of the rule).

#6 stays open on purpose (needs an owner decision).

Local mutation (--with-uncovered, zend.assertions=-1): MSI ~92.6% (gate 88). Lazy rollouts: none needed.

Fixes #3
Fixes #4
Fixes #5

Summary by Sourcery

Provide unified statement-timeout execution and more efficient, wrapper-aware timeout handling across supported database dialects.

New Features:

  • Add dialect-independent statement execution that applies per-statement or session timeouts as appropriate.

Bug Fixes:

  • Avoid redundant timeout-setting and restoration round trips when a stricter session limit is already active.
  • Allow timeout translation through arbitrary wrapped exceptions while preserving the original error as the cause.

Enhancements:

  • Use the shared context budget API and require the newer context package version.

Build:

  • Update the context dependency to ^0.5.

Documentation:

  • Update the English and Russian documentation and database integration recipe for the new execution and error-translation APIs.

Tests:

  • Add coverage for dialect-specific execution, context termination, wrapped timeout errors, stricter existing limits, rounding boundaries, and native-float restoration.

@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Sorry @rasuvaeff, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 515ed1c0-dda2-40f7-9d10-938a0bf2a26d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

API

Add the public dialect-independent run() method and widen translate() to accept any Throwable, preserving their documented contracts alongside the signatures.

  • src/StatementTimeout.php L144-176

Implementation

Use Context::budgetMs(), avoid resetting an already stricter session limit, and locate the driver exception through the previous chain; remove the former private budget helper.

  • src/StatementTimeout.php L216-223, L271-281 (+4 small edits)

Configuration

Require the context-library release that provides Context::budgetMs().

  • composer.json L31

Documentation

Document the new execution helper, Throwable-chain translation, and stricter-session optimization in the changelog and user guides, including the updated yiisoft/db recipe.

  • CHANGELOG.md L8-20
  • README.md L115-132 (+4 small edits)
  • README.ru.md L119-137 (+4 small edits)
  • llms.txt L54-63, L69-71

Tests

Update the yiisoft/db integration recipe and add or adjust tests for run(), Throwable-chain translation, and skipping redundant session-setting operations.

  • tests/Integration/YiisoftDbIntegrationTest.php L9 (removed lines), L27-28, L83-85
  • tests/StatementTimeoutTest.php L210-214, L270-355, L478-500 (+6 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@rasuvaeff
rasuvaeff merged commit e795d5b into master Nov 20, 2026
15 checks passed
@rasuvaeff
rasuvaeff deleted the feat/review-2026-11-20 branch November 20, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant