Skip to content

feat(injector): method-call join point#245

Closed
RomainMuller wants to merge 21 commits intomainfrom
romain.marcadier/method-decl
Closed

feat(injector): method-call join point#245
RomainMuller wants to merge 21 commits intomainfrom
romain.marcadier/method-decl

Conversation

@RomainMuller
Copy link
Copy Markdown
Contributor

The method-call join point can be used to match calls to a specific method, given the receiver type and method name. The receiver is matched exactly, meaning that no interface resolution is done... Interface calls are matched only if the configured receiver type is the interface itself.

RomainMuller and others added 21 commits August 19, 2024 19:55
Use a new and improved method to preserve line information from the
original source file into the modified AST; by comparing information
about original nodes in the decorator's view with those in the
restorer's.

This ensures better correspondance, emits fewer line directives, and
shoudl result in better debugging experience on instrumented code.
Create a new `injector.Injector` API that does not rely on
`decorator.Load` (internally using `packages.Load`), instead using the
basic `go/types` API to type-check the AST nodes in order to obtain the
`Uses` map that is sufficient to build an import-managing
`decorator.Decorator` instance.

The package name resolution is done by parsing type information from the
archives mentioned in the `importcfg` file.

This change removes unnecessary compilation of un-instrumented archives
which are not useful, and hence saves time and disk space.
…injector-api

# Conflicts:
#	internal/injector/injector.go
…injector-api

# Conflicts:
#	internal/injector/injector.go
#	internal/injector/lineinfo/annotation.go
#	internal/injector/lineinfo/lineinfo.go
#	internal/toolexec/aspect/oncompile.go
Co-authored-by: Eliott Bouhana <47679741+eliottness@users.noreply.github.com>
…injector-api

# Conflicts:
#	internal/injector/builtin/integration_test.go
#	internal/injector/testdata/injector/access-return-value/expected.diff
The `method-call` join point can be used to match calls to a specific
method, given the receiver type and method name. The receiver is matched
exactly, meaning that no interface resolution is done... Interface calls
are matched only if the configured receiver type is the interface
itself.
Base automatically changed from romain.marcadier/new-injector-api to main August 27, 2024 08:44
@RomainMuller RomainMuller deleted the romain.marcadier/method-decl branch September 17, 2024 08:02
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 65.81395% with 147 lines in your changes missing coverage. Please review.

Project coverage is 63.67%. Comparing base (741f717) to head (d52743a).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
internal/injector/parse.go 61.53% 26 Missing and 9 partials ⚠️
internal/injector/injector.go 71.26% 16 Missing and 9 partials ⚠️
internal/injector/aspect/join/expression.go 41.46% 21 Missing and 3 partials ⚠️
internal/injector/write.go 44.44% 10 Missing and 5 partials ⚠️
internal/injector/imports.go 81.69% 11 Missing and 2 partials ⚠️
internal/injector/aspect/join/join.go 44.44% 8 Missing and 2 partials ⚠️
internal/injector/restorer.go 74.28% 6 Missing and 3 partials ⚠️
internal/toolexec/aspect/oncompile.go 69.56% 4 Missing and 3 partials ⚠️
internal/toolexec/importcfg/lookup.go 53.84% 5 Missing and 1 partial ⚠️
internal/injector/check.go 82.35% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
+ Coverage   63.63%   63.67%   +0.03%     
==========================================
  Files          95       95              
  Lines        5095     5029      -66     
==========================================
- Hits         3242     3202      -40     
+ Misses       1505     1482      -23     
+ Partials      348      345       -3     
Components Coverage Δ
Instruments 34.56% <ø> (ø)
Go Driver 62.92% <ø> (-0.85%) ⬇️
Toolexec Driver 65.83% <66.66%> (-0.69%) ⬇️
Aspects 68.43% <46.03%> (-1.84%) ⬇️
Injector 70.43% <65.72%> (-1.66%) ⬇️
Files with missing lines Coverage Δ
internal/injector/aspect/context/context.go 96.36% <100.00%> (+0.28%) ⬆️
internal/toolexec/proxy/compile.go 88.46% <100.00%> (+7.90%) ⬆️
internal/injector/check.go 82.35% <82.35%> (ø)
internal/toolexec/importcfg/lookup.go 53.84% <53.84%> (ø)
internal/toolexec/aspect/oncompile.go 70.31% <69.56%> (+0.45%) ⬆️
internal/injector/restorer.go 74.28% <74.28%> (ø)
internal/injector/aspect/join/join.go 63.73% <44.44%> (-11.61%) ⬇️
internal/injector/imports.go 81.69% <81.69%> (ø)
internal/injector/write.go 44.44% <44.44%> (ø)
internal/injector/aspect/join/expression.go 62.82% <41.46%> (-23.67%) ⬇️
... and 2 more

... and 13 files with indirect coverage changes

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.

1 participant