Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add InternalsVisibleTo attribute for benchmark #9652

Closed

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jan 25, 2024

What's included in this PR

Add InternalsVisibleTo attribute for following assembly names.

  • Docfx.Benchmarks
  • LINQPadQuery

Background
I want to write benchmark & test code that use docfx internal types.

Currently I'm using IgnoresAccessChecksToGenerator to ignore .NET access checks.
But there are some limitations. (e.g. it can't using from LINQPad)

So I want to add InternalsVisibleTo attributes for specific assembly names to docfx DLLs.


.NET Accessibility Levels is not security features. And it can be ignorable by several ways. (e.g. By using .NET 8 UnsafeAccessorAttribute)
I don't think there is a problem with the addition of the InternalsVisibleTo attribute to external assembly names.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e2f78e9) 74.31% compared to head (f4fca85) 74.31%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9652   +/-   ##
=======================================
  Coverage   74.31%   74.31%           
=======================================
  Files         536      536           
  Lines       23179    23179           
  Branches     4054     4054           
=======================================
  Hits        17226    17226           
  Misses       4851     4851           
  Partials     1102     1102           

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

@yufeih
Copy link
Contributor

yufeih commented Jan 27, 2024

I understand internal access is not for security, my concern is if we merge this, other folks would add their own assembly names and this reverse dependency is not a good thing to maintain.

@yufeih yufeih closed this Jan 27, 2024
@filzrev
Copy link
Contributor Author

filzrev commented Jan 27, 2024

@yufeih
I understand that concern.

What’s about creating PR to that adding benchmarks/Docfx.Benchmarks project.
And allow internal access to this assembly.

@filzrev filzrev deleted the chore-add-internalsvisibleto-attr branch April 1, 2024 05:03
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