Skip to content

feat(injector): Add ArgumentThatImplements method for argument interface matching#617

Merged
kakkoyun merged 1 commit into
mainfrom
04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching
Jun 6, 2025
Merged

feat(injector): Add ArgumentThatImplements method for argument interface matching#617
kakkoyun merged 1 commit into
mainfrom
04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching

Conversation

@kakkoyun

Copy link
Copy Markdown
Member

This commit introduces the ArgumentThatImplements method to the function signature, allowing the retrieval of the first argument that implements a specified interface type. The implementation includes a new helper function, findImplementingField, which checks for both exact type matches and interface implementations.

Additionally, the ResultThatImplements method has been refactored to utilize the new helper for consistency. The changes enhance the injector's capability to handle argument interface checks, improving the overall functionality and maintainability of the code.

Configuration YAML files and test cases have been added to validate the new functionality across various scenarios, ensuring robust testing of the argument matching feature.

Signed-off-by: Kemal Akkoyun [email protected]

@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from 9c2709c to be2028f Compare May 26, 2025 10:52
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 691062e to 1bbd800 Compare May 26, 2025 10:52
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from be2028f to 35ebe90 Compare May 26, 2025 14:17
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 1bbd800 to 985452d Compare May 26, 2025 14:17
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from 35ebe90 to 66e79f8 Compare May 26, 2025 14:19
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 985452d to 24d72c7 Compare May 26, 2025 14:19
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from 6e4ae96 to 1c9cd64 Compare May 27, 2025 11:40
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 24d72c7 to 4c0282c Compare May 27, 2025 11:40
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 4c0282c to 2be634a Compare May 27, 2025 13:20
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from 1c9cd64 to d01d615 Compare June 5, 2025 11:00
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch 3 times, most recently from 24682c3 to d7599d0 Compare June 5, 2025 14:25
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch 2 times, most recently from d1d3c13 to b8a2864 Compare June 5, 2025 16:27
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from d7599d0 to cb660b2 Compare June 5, 2025 16:27
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from b8a2864 to ad3e699 Compare June 5, 2025 17:30
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from cb660b2 to 260ef98 Compare June 5, 2025 17:30
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling branch from ad3e699 to 827efcf Compare June 5, 2025 19:46
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 260ef98 to 036a718 Compare June 5, 2025 19:46
Base automatically changed from 04-15-feat_injector_typed_refactor_resolveinterfacetypebyname_for_improved_clarity_and_error_handling to main June 5, 2025 20:33
…ace matching

This commit introduces the `ArgumentThatImplements` method to the function signature, allowing the retrieval of the first argument that implements a specified interface type. The implementation includes a new helper function, `findImplementingField`, which checks for both exact type matches and interface implementations.

Additionally, the `ResultThatImplements` method has been refactored to utilize the new helper for consistency. The changes enhance the injector's capability to handle argument interface checks, improving the overall functionality and maintainability of the code.

Configuration YAML files and test cases have been added to validate the new functionality across various scenarios, ensuring robust testing of the argument matching feature.

Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun
kakkoyun force-pushed the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch from 036a718 to b1fe0c5 Compare June 6, 2025 06:12
@kakkoyun
kakkoyun enabled auto-merge June 6, 2025 06:14
@kakkoyun
kakkoyun added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit 8157bfb Jun 6, 2025
48 of 54 checks passed
@kakkoyun
kakkoyun deleted the 04-15-feat_injector_add_argumentthatimplements_method_for_argument_interface_matching branch June 6, 2025 07:02
@codecov

codecov Bot commented Jun 6, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 64.10256% with 28 lines in your changes missing coverage. Please review.

Project coverage is 67.10%. Comparing base (ec50330) to head (b1fe0c5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/injector/aspect/join/function.go 61.90% 14 Missing and 2 partials ⚠️
...ternal/injector/aspect/advice/code/dot_function.go 66.66% 9 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #617      +/-   ##
==========================================
+ Coverage   66.80%   67.10%   +0.29%     
==========================================
  Files         113      113              
  Lines        7866     7904      +38     
==========================================
+ Hits         5255     5304      +49     
- Misses       2068     2082      +14     
+ Partials      543      518      -25     
Components Coverage Δ
Generators 80.24% <ø> (ø)
Instruments ∅ <ø> (∅)
Go Driver 76.51% <ø> (+0.69%) ⬆️
Toolexec Driver 70.83% <ø> (+3.30%) ⬆️
Aspects 74.32% <64.10%> (+2.11%) ⬆️
Injector 74.90% <64.10%> (+1.88%) ⬆️
Job Server 66.99% <ø> (-1.98%) ⬇️
Other 67.10% <64.10%> (+0.29%) ⬆️
Files with missing lines Coverage Δ
...ternal/injector/aspect/advice/code/dot_function.go 60.54% <66.66%> (+2.25%) ⬆️
internal/injector/aspect/join/function.go 68.93% <61.90%> (+1.54%) ⬆️

... and 28 files with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants