Skip to content

Conversation

fedemkr
Copy link
Member

@fedemkr fedemkr commented Jul 25, 2025

🎟️ Tracking

PM-24171

📔 Objective

Improved AutoMockable.stencil so it uses short method name by default to generate the mocked properties and added some custom annotations logic to better handle specific cases.

Custom annotations:

  • useSelectorName: Add this annotation to a method where you want to use the selector name instead of the short name, e.g. on function overloading.
  • mockReceivedInvocations: Add this annotation to a method where you want to mock the different received parameters invocations to a method.

Docs here: bitwarden/contributing-docs#631

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

…rt name instead of the selector name to generate the mocked properties to ease usage and avoid confusion. Also added custom annotations to use in methods, i.e. useSelectorName and mockReceivedInvocations, to customize its usage.
@fedemkr fedemkr requested review from a team and matt-livefront as code owners July 25, 2025 19:21
@fedemkr fedemkr changed the title [PM-24171] [BEEEP Improved AutoMockable stencil so to use the method sho… [PM-24171] [BEEEP] Improved AutoMockable stencil to use short method name Jul 25, 2025
@fedemkr fedemkr enabled auto-merge (squash) July 25, 2025 19:27
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.36%. Comparing base (18217a6) to head (d427ab7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1792      +/-   ##
==========================================
- Coverage   88.81%   85.36%   -3.46%     
==========================================
  Files         811     1010     +199     
  Lines       51604    61554    +9950     
==========================================
+ Hits        45833    52544    +6711     
- Misses       5771     9010    +3239     

☔ 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.

Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailsbc464ada-564b-4764-8f33-8dc16a62a61b

Great job, no security vulnerabilities found in this Pull Request

@fedemkr fedemkr merged commit ae1b575 into main Jul 25, 2025
12 checks passed
@fedemkr fedemkr deleted the PM-24171/sourcery-name-update branch July 25, 2025 19:31
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