Skip to content

Conversation

@creativeprojects
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Walkthrough

Replaced Mockery configuration from .mockery.yaml to .mockery.yml and updated Makefile to use the new config and default tag. Regenerated mocks with testify template, adding/removing constructors, standardising receiver/parameter names, and adjusting mock call helpers. schedule/mocks/Handler.go now embeds testify’s mock.Mock and updates method helper signatures.

Changes

Cohort / File(s) Summary
Mockery config and build wiring
\.mockery.yaml, \.mockery.yml, Makefile
Removed old YAML config; added new .mockery.yml using testify template with unrolled variadics and per-interface output naming. Makefile now references .mockery.yml and drops explicit --tag v2.53.5.
Config mocks standardisation
config/mocks/NamedPropertySet.go, config/mocks/ProfileInfo.go, config/mocks/PropertyInfo.go, config/mocks/SectionInfo.go
Constructor changes: removed NewNamedPropertySet; added NewProfileInfo; transient adds/removals around NewSectionInfo with no net addition. Refactored receivers/param names; updated Run/Return/RunAndReturn helper signatures and return handling; imports de-aliased; no behaviour beyond mocks.
Monitor mock constructor
monitor/mocks/OutputAnalysis.go
Added NewOutputAnalysis constructor; refactored receivers and return handling; standardised Return/Run helper parameter names.
Schedule Handler mock refactor
schedule/mocks/Handler.go
Added NewHandler. Changed Handler to embed mock.Mock (from custom Mock). Updated method helper signatures with explicit parameter names/types, and revised Run/Return/RunAndReturn helpers across methods (e.g., CheckPermission, CreateJob, ParseSchedules, Scheduled).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is missing and does not convey any information about the changes, leaving reviewers without context or rationale for the upgrade to Mockery v3. Please add a meaningful description summarising the configuration updates, Makefile adjustments, and regenerated mock code to clarify the scope and intent of this pull request.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “upgrade mockery to v3” succinctly captures the primary purpose of migrating to the new Mockery configuration and reflects the core changes made in this pull request.
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
  • Commit unit tests in branch mockery-v3

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

@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: 1

🧹 Nitpick comments (2)
Makefile (1)

116-116: Safer mock cleanup to avoid directory deletion errors

find may hit directories under mocks; rm without -r will error, and behaviour differs by platform. Restrict to files and delete directly.

Apply:

-	find . -path "*/mocks/*" -exec rm {} \;
+	find . -type f -path "*/mocks/*" -delete
.mockery.yml (1)

5-7: Lock in expecter generation explicitly

Mocs include Expecter types; make this explicit to avoid future default changes altering generated API.

Apply:

 template: testify
+with-expecter: true
 template-data:
   unroll-variadic: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f15a5a and c58bb83.

📒 Files selected for processing (9)
  • .mockery.yaml (0 hunks)
  • .mockery.yml (1 hunks)
  • Makefile (2 hunks)
  • config/mocks/NamedPropertySet.go (16 hunks)
  • config/mocks/ProfileInfo.go (15 hunks)
  • config/mocks/PropertyInfo.go (47 hunks)
  • config/mocks/SectionInfo.go (20 hunks)
  • monitor/mocks/OutputAnalysis.go (9 hunks)
  • schedule/mocks/Handler.go (14 hunks)
💤 Files with no reviewable changes (1)
  • .mockery.yaml
🧰 Additional context used
🧬 Code graph analysis (5)
config/mocks/NamedPropertySet.go (2)
config/info.go (2)
  • NamedPropertySet (66-69)
  • PropertyInfo (72-117)
config/mocks/PropertyInfo.go (1)
  • PropertyInfo (28-30)
schedule/mocks/Handler.go (5)
schedule/handler.go (1)
  • Handler (12-29)
user/user.go (1)
  • User (3-10)
schedule/permission.go (1)
  • Permission (7-7)
schedule/config.go (1)
  • Config (10-29)
calendar/event.go (1)
  • Event (15-24)
config/mocks/SectionInfo.go (3)
config/info.go (2)
  • SectionInfo (30-39)
  • PropertyInfo (72-117)
restic/commands.go (1)
  • CommandIf (124-134)
config/mocks/PropertyInfo.go (1)
  • PropertyInfo (28-30)
config/mocks/PropertyInfo.go (3)
config/info.go (4)
  • PropertyInfo (72-117)
  • NumericRange (120-123)
  • PropertySet (50-63)
  • NamedPropertySet (66-69)
restic/commands.go (1)
  • Option (28-33)
config/mocks/NamedPropertySet.go (1)
  • NamedPropertySet (27-29)
config/mocks/ProfileInfo.go (3)
config/info.go (4)
  • NewProfileInfo (659-661)
  • ProfileInfo (20-27)
  • PropertyInfo (72-117)
  • SectionInfo (30-39)
config/mocks/PropertyInfo.go (1)
  • PropertyInfo (28-30)
config/mocks/SectionInfo.go (1)
  • SectionInfo (28-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and test (1.24, windows-latest)
  • GitHub Check: Build and test (1.24, macos-latest)
  • GitHub Check: Build and test (1.24, ubuntu-latest)
🔇 Additional comments (8)
Makefile (1)

114-118: Good: switched to .mockery.yml and using the config flag

The target now runs mockery with the new YAML filename; this aligns with the new config file added in the repo.

config/mocks/NamedPropertySet.go (1)

12-24: Constructor addition LGTM

NewNamedPropertySet sets up TestingT and assertions via t.Cleanup; this matches the pattern used elsewhere.

config/mocks/PropertyInfo.go (1)

13-26: Constructor addition LGTM

NewPropertyInfo mirrors the standard constructor pattern with Test/Cleanup. No API risk.

monitor/mocks/OutputAnalysis.go (1)

13-26: Constructor addition LGTM

NewOutputAnalysis initialises the embed and registers Cleanup; consistent with testify mock best practice.

schedule/mocks/Handler.go (2)

14-26: Constructor and embed change LGTM

Switching Handler to embed mock.Mock and adding NewHandler with Test/Cleanup is correct and consistent with other mocks.


41-55: Signature alignment with interface looks correct

CheckPermission uses user.User and schedule.Permission as per schedule.Handler interface.

Please confirm no call sites relied on parameter names (e.g., using reflect-based arg matchers by name); testify matches by position/type, so this should be safe.

config/mocks/ProfileInfo.go (1)

12-24: Constructor upgrade LGTM.

The new constructor wiring with Cleanup mirrors the testify v3 templates and will auto-assert expectations without extra boilerplate. No issues spotted.

config/mocks/SectionInfo.go (1)

13-25: Constructor upgrade LGTM.

The SectionInfo mock picks up the same testify v3 constructor pattern, so expectation assertions will now run automatically via Cleanup. Looks solid.

@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.70%. Comparing base (2f15a5a) to head (c58bb83).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #561   +/-   ##
=======================================
  Coverage   79.70%   79.70%           
=======================================
  Files         137      137           
  Lines       13462    13462           
=======================================
  Hits        10729    10729           
  Misses       2306     2306           
  Partials      427      427           
Flag Coverage Δ
unittests 79.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

@creativeprojects creativeprojects merged commit b2e0ea9 into master Sep 26, 2025
14 of 15 checks passed
@creativeprojects creativeprojects deleted the mockery-v3 branch September 26, 2025 13:54
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