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

Extracting nested nuget dependencies in csproj files #8203

Closed
ruudhe opened this issue Jan 6, 2021 · 4 comments · Fixed by #9035
Closed

Extracting nested nuget dependencies in csproj files #8203

ruudhe opened this issue Jan 6, 2021 · 4 comments · Fixed by #9035
Assignees
Labels
manager:nuget NuGeT (.NET) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality

Comments

@ruudhe
Copy link

ruudhe commented Jan 6, 2021

What would you like Renovate to be able to do?
References in .csproj files can be placed inside an element like Choose instead of the usual ItemGroup elements inside the Project element:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
  </ItemGroup>

  <Choose>
    <When Condition="some-condition-like-exists">
      <ItemGroup>
        <ProjectReference Include="My.Package.csproj" />
      </ItemGroup>
    </When>
    <Otherwise>
      <ItemGroup>
        <PackageReference Include="My.Package" Version="1.0.0" />
      </ItemGroup>
    </Otherwise>
  </Choose>
</Project>

Any package references inside the Choose / When / Otherwise elements are not found, it would be nice if the extractor could support extracting these nested package references.

Did you already have any implementation ideas?
It could be done traversing through the xml elements instead of only the ItemGroup child elements, for example here

@viceice viceice added manager:nuget NuGeT (.NET) package manager type:bug Bug fix of existing functionality priority-2-high Bugs impacting wide number of users or very important features labels Jan 6, 2021
@viceice
Copy link
Member

viceice commented Jan 6, 2021

I declare this as bug because I suggested to remove deep traversal to speed up extraction.

Maybe we only should have a blacklist of elements to ignore (eg PropertyGroup) and traverse all other.

@rarkins
Copy link
Collaborator

rarkins commented Jan 7, 2021

Does it really take that much time to traverse a parsed XML file?

@viceice
Copy link
Member

viceice commented Jan 7, 2021

Does it really take that much time to traverse a parsed XML file?

Not sure, but these file can sometimes be pretty big. We should at least ignore PropertyGroup, as the they can't be a parent of our deps.

@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Jan 12, 2021
@viceice viceice added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready help wanted Help is needed or welcomed on this issue and removed priority-2-high Bugs impacting wide number of users or very important features status:requirements Full requirements are not yet known, so implementation should not be started labels Mar 8, 2021
@viceice viceice self-assigned this Mar 8, 2021
@viceice viceice added status:in-progress Someone is working on implementation and removed help wanted Help is needed or welcomed on this issue status:ready labels Mar 8, 2021
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 24.77.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:nuget NuGeT (.NET) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants