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

Fix analyzer reference in AuditReports package #5894

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

dariusclay
Copy link
Contributor

@dariusclay dariusclay commented Feb 13, 2025

Fix regression due to #5531

It broke the AuditReports extension since it will not be able to resolve the dependency on Microsoft.Gen.MetadataExtractor.

Microsoft Reviewers: Open in CodeFlow

@dariusclay dariusclay requested review from a team as code owners February 13, 2025 12:31
@IbrahimMNada
Copy link
Contributor

IbrahimMNada commented Feb 13, 2025

Hello ,
I am the one who made that pr if there is anything i can help , I am available

@dariusclay
Copy link
Contributor Author

Hello , I am the one who made that pr if there is anything i can help , I am available

Thanks, I think the implementation is fine, just needed to change ProjectReference -> AnalyzerReference.

@IbrahimMNada
Copy link
Contributor

Hello , I am the one who made that pr if there is anything i can help , I am available

Thanks, I think the implementation is fine, just needed to change ProjectReference -> AnalyzerReference.
i can do it right now and i will run the tests , if you want

@dariusclay
Copy link
Contributor Author

@IbrahimMNada can you pull my branch and run your tests? Changes are already done in this PR.

@IbrahimMNada
Copy link
Contributor

I ran the tests , all seems good, to be 100% sure i can try the package on a sperate fresh project if you'd like

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.Caching.Hybrid Line 86 82.92 🔻
Microsoft.Extensions.AI.Evaluation.Quality Line 88 7.57 🔻
Microsoft.Extensions.AI.Evaluation.Quality Branch 88 16.42 🔻
Microsoft.Gen.MetadataExtractor Line 98 57.35 🔻
Microsoft.Gen.MetadataExtractor Branch 98 62.5 🔻
Microsoft.Extensions.AI.Evaluation.Reporting Line 88 72.06 🔻
Microsoft.Extensions.AI.Evaluation.Reporting Branch 88 64.8 🔻
Microsoft.Extensions.AI.Evaluation.Console Line 88 8.26 🔻
Microsoft.Extensions.AI.Evaluation.Console Branch 88 17.07 🔻
Microsoft.Extensions.AI.OpenAI Line 77 68.75 🔻
Microsoft.Extensions.AI.OpenAI Branch 77 50.41 🔻
Microsoft.Extensions.AI.Ollama Line 80 78.2 🔻
Microsoft.Extensions.AI.Evaluation Line 88 58.67 🔻
Microsoft.Extensions.AI.Evaluation Branch 88 56.67 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.AI 88 89
Microsoft.Extensions.AI.Abstractions 83 85
Microsoft.Extensions.AI.AzureAIInference 91 92

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=951242&view=codecoverage-tab

@eduherminio eduherminio self-requested a review February 13, 2025 13:23
@dariusclay dariusclay enabled auto-merge (squash) February 13, 2025 13:24
Copy link
Member

@eduherminio eduherminio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dariusclay
Copy link
Contributor Author

@RussKie @amadeuszl for approvals

@RussKie
Copy link
Member

RussKie commented Feb 13, 2025

LGTM.

Have you confirmed the change is working as before? E.g., you can build version 9.3 locally, pull dotnet/extensions-samples#645, point it at the locally built version, and verify it can be built.

@RussKie RussKie added the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Feb 13, 2025
@IbrahimMNada
Copy link
Contributor

IbrahimMNada commented Feb 13, 2025

I Tried to run this Microsoft.Extensions.AuditReports package locally on a custom project, I could not find the .target file ....

the analyzers do not fire when i build... is there any documents can help me generate nupkg with the right .target file

@RussKie
Copy link
Member

RussKie commented Feb 13, 2025

I could not find the .target file ....

How did you build and pack? What errors did you observe?

Here's a doc with building instructions. To pack you should run build.cmd -pack to generate nupks under /artifacts folder.
The command would look something like:

.\build.cmd -ci -restore -build -pack /p:OfficialBuildId=20252015.01

@IbrahimMNada
Copy link
Contributor

IbrahimMNada commented Feb 14, 2025

thanks for pointing out what i was missing , I was able to create a package and run locally on a side project.

this branch contains the same changes as the one main...IbrahimMNada:extensions:meta-data-extractor

I generated a package from it then used on a side project , which is this one
https://github.com/IbrahimMNada/MetaDataExtractorTesting/tree/main/WebApplication1

i defined this in order to test them

image

and thankfully it worked

image

However, i noticed that ComplianceReport creates a directory if it does not exist, while MetricsReports & MetadataReports Do not. i will create an issue related to this

I believe its related to Microsoft.Extensions.Compliance.Testing , I'm not sure if its attended or not.

@dariusclay
Copy link
Contributor Author

@RussKie confirmed Microsoft.Extensions.AuditReports works. Locally packed and updated samples to test.

@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Feb 14, 2025
@RussKie RussKie merged commit 0c97648 into main Feb 14, 2025
6 checks passed
@RussKie RussKie deleted the dletterman/compliance-reports-regression branch February 14, 2025 22:40
@RussKie
Copy link
Member

RussKie commented Feb 14, 2025

Thank you, folks, for jumping in quickly and fixing the issue. Let's monitor the dependency flow now.

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

Successfully merging this pull request may close these issues.

6 participants