Skip to content

chore: apply Rector refactors to ConfigTest#819

Merged
ChristophWurst merged 1 commit into
masterfrom
copilot/run-rector-and-commit-changes
May 5, 2026
Merged

chore: apply Rector refactors to ConfigTest#819
ChristophWurst merged 1 commit into
masterfrom
copilot/run-rector-and-commit-changes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

This PR applies the repository’s Rector rules and commits the resulting updates. The changes are scoped to ConfigTest and align PHPUnit assertions with current Rector/Nextcloud rule expectations.

  • Scope

    • Updated /home/runner/work/nextcloud_sentry/nextcloud_sentry/tests/Unit/ConfigTest.php only.
    • No production code or runtime behavior changes.
  • Rector-driven PHPUnit updates

    • Marked the test class as final.
    • Replaced static assertions (self::assert*) with instance assertions ($this->assert*).
    • Replaced float assertSame(...) assertions with assertEqualsWithDelta(..., PHP_FLOAT_EPSILON) for numeric precision-safe checks.
  • Representative diff

    -class ConfigTest extends TestCase {
    +final class ConfigTest extends TestCase {
    
    -self::assertSame(0.5, $result);
    +$this->assertEqualsWithDelta(0.5, $result, PHP_FLOAT_EPSILON);

Agent-Logs-Url: https://github.com/ChristophWurst/nextcloud_sentry/sessions/4d7f491a-d592-4eaa-b620-96a4e2b7ef61

Co-authored-by: ChristophWurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst
Copy link
Copy Markdown
Owner

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e9f7b41-d8ff-467a-8a8f-326e00e450d5

📥 Commits

Reviewing files that changed from the base of the PR and between 78641a2 and 3a9ae16.

📒 Files selected for processing (1)
  • tests/Unit/ConfigTest.php

Walkthrough

The ConfigTest class is refactored to adopt instance-level PHPUnit assertions. The final keyword is added to the class declaration. All static assertion calls (self::assert*) are converted to instance method calls ($this->assert*). Additionally, floating-point value assertions are changed from strict equality (assertSame) to tolerance-based comparisons (assertEqualsWithDelta with PHP_FLOAT_EPSILON), affecting sampling-rate and profile-sampling-rate tests while maintaining type assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With final grace and instance calls,
From self to \$this the refactor sprawls,
Float precision—epsilon's touch—
Makes testing fairer, oh so much!
A rabbit's hop toward cleaner walls! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: applying Rector refactors to ConfigTest, which aligns with the changeset that updates the test class with Rector-driven modifications.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the Rector refactoring applied to ConfigTest and detailing the specific changes made.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 copilot/run-rector-and-commit-changes

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@ChristophWurst ChristophWurst merged commit 924d8d5 into master May 5, 2026
27 checks passed
@ChristophWurst ChristophWurst deleted the copilot/run-rector-and-commit-changes branch May 5, 2026 06:16
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.

2 participants