NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

“Browse” tab can’t show the embedded icon of the package from DevOps private feeds #9250

Open v-luzh opened 4 years ago

v-luzh commented 4 years ago

Details about Problem

NuGet version: NuGet Client Dev\5.6.0.6479 VS Version: Master\29902.138 OS: Windows-10-Enterprise-RS5

Detailed repro steps

  1. Create a Console App (.NET Core 3.1) in VS and open the PM UI of the solution.
  2. Add the DevOps feed into the Settings->NuGet Package Manager->Package Sources.
  3. Select the new added DevOps feed in the Package source dropdown box in the PM UI and install the package [classlib.net48 -version 1.0.5 (don’t have the backlash problem in bug 9225), dotnet.icon -version 1.0.0 (embedded icon)]
  4. Check all the tabs in PM UI.

    Expected

    The embedded icon should show correctly in all the tabs of PM UI.

    Actual

    Only “Browse” tab can’t show the embedded icon of the package from DevOps feed as below screenshot. image

Note

It doesn't repro for the nuget.org feed.

dominoFire commented 4 years ago

@karann-msft @jmyersmsft

jmyersmsft commented 4 years ago

Azure Artifacts does not yet support extracting embedded icons to re-host them, so it has no icon to provide to VS. For already-installed packages, NuGet is pulling the icon from the .nupkg that it already has on disk.

This is near the top of our (Azure Artifacts's) backlog, but I can't give any more concrete information about timeline.

To be clear, this is an Azure Artifacts problem, not a NuGet problem. Also, this doesn't affect the content of the packages in any way, just what we return in search results.

zivkan commented 4 years ago

Closing as per the comment above. NuGet added a new feature and Azure Artifacts hasn't yet implemented it.

dominoFire commented 4 years ago

I will use this issue as an Epic to track all efforts to enable this scenario in NuGet PM UI and Azure DevOps

donnie-msft commented 4 years ago

Closed as Duplicate a VS Feedback ticket around this issue (1114782)

AroglDarthu commented 3 years ago

Just want to mention that this issue also happens on the "Updates" and "Consolidate" tabs.

rrelyea commented 3 years ago

putting on my plate right now...as I am doing work in this area.

donnie-msft commented 3 years ago

New upvotes on https://developercommunity2.visualstudio.com/t/nuget-package-projecticon-azure-devops-artifacts-i/1014111?from=email&viewtype=all#T-ND1307513

rrelyea commented 3 years ago

fixed in dev build 7084, which isn't inserted into P4 yet...but we hope to this week.

v-luzh commented 3 years ago

Reactivate this bug since it still repro on Main\31101.164 + NuGet Client Dev\5.10.0.7152. Please help to check if the fix is merged to dev branch? Thanks.

rrelyea commented 3 years ago

yes, was mistakenly closed. i fixed embedded icons...but doesn't yet work with authenticated feeds. More work to do that..

woeterman94 commented 2 years ago

Any updates on this? It still doesn't work even with a valid .nuspec file

image

image

image

Nexusmeister commented 2 years ago

Are there any updates on this problem?

Xyotic commented 2 years ago

Also looking forward to this!

StefanOverHaevgRZ commented 2 years ago

Probably no update?

TheRealAyCe commented 1 year ago

It works when your package only has an iconUrl. The main problem here is that it forces you to use iconUrl only. It would be fine if it would default to using the iconUrl when both it and icon are available. But as soon as you use both (which is the recommended thing to do it seems?), it ignores iconUrl and no longer shows an actual icon.

    <icon>nugeticon.png</icon>
    <iconUrl>some icon url address</iconUrl>

doesn't work in the feed search (but does, once installed).

    <iconUrl>some icon url address</iconUrl>

does work in the feed search and once installed, but is no longer recommended.

Please just make it use iconUrl if available, until you've implemented re-hosting of package internal icons. You're already doing that if icon is not set!

michael-hawker commented 1 year ago

Think we've been hitting this as well, really hard to know. Also makes it impossible to validate packages have the proper icon setup on our private feed before we publish...

jamesSampica commented 12 months ago

Intra-organization packages would be much more identifiable with this fixed.

donnie-msft commented 11 months ago

Going to take a look this Sprint to see if I can articulate the problem with this icon binding.

DaleyKD commented 10 months ago

@donnie-msft : Any update?

I know this seems like a silly thing we're requesting, but it sure would be nice for Azure Artifacts to support standard nuspec stuff.

Thanks!

Nexusmeister commented 10 months ago

Intra-organization packages would be much more identifiable with this fixed.

This is a problem that we are facing like every day. It is a little "bug" but it annoys while validating the correct package

donnie-msft commented 10 months ago

@donnie-msft : Any update?

I know this seems like a silly thing we're requesting, but it sure would be nice for Azure Artifacts to support standard nuspec stuff.

Thanks!

Not yet, I ended up having to move it to November Sprint, and Quality Week will be next week which is when I'll look into this task. Thanks for your patience!

DaleyKD commented 10 months ago

I appreciate that. I'm glad to hear that ADO isn't forgotten. There are many times it feels like it is, especially with buggy Build Tasks.

donnie-msft commented 9 months ago

I've found that there's a few ways to encounter this problem. Out of curiosity, how many of you are seeing this with an Azure DevOps feed with upstream package sources?

DaleyKD commented 9 months ago

We do, but I don't know why: image

donnie-msft commented 9 months ago

Providing an update on what I've found and a rough draft of my notes:

My rough draft proposal would be:

Questions/concerns:

AzDo package sources with Upstreaming: I'm not yet clear if the authenticated HTTP call would cause AzDo to save packages to the feed when Browse tab makes authenticated requests for icons. My guess is that it would save those packages (as it does that when installing a package that exists on an upstream). Questions to be understood are 1. is that a problematic side effect for those feeds and 2. does it have performance implications on Client that need more design work.

jmyersmsft commented 9 months ago

Current implementation in Azure Artifacts is to return a 404 when asked to extract an icon from a package from upstream that hasn't been saved to the feed.

That could possibly be changed in the future to do something like forward the request on to the upstream, but that's nontrivial for us. We pull nuspecs from PackageBaseAddress to get metadata rather than the registrations API, so we don't have the upstream's IconUrl at hand.

smkanadl commented 9 months ago

I never use upstream sources. Since a nuget.config file with package source mapping makes it quite easy to setup multiple packages sources, I will not need package icons from upstream sources at all.

felipementel commented 6 months ago

I'm preparing material to create a video on my YouTube channel, and I came across exactly this problem.

I am unable to place an icon for my package, published in Azure DevOps Artifacts.

I've tried using different tags in csproj, different file formats, but nothing works.

I will leave my example of how I am publishing the package, using YAML Pipelines

name: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

trigger:
   branches:
     include:
     -main
     - feature/*

pool:
   vmImage: ubuntu-latest

steps:

- task: UseDotNet@2
   inputs:
     packageType: 'sdk'
     version: '8.0.x'

- task: DotNetCoreCLI@2
   displayName: Restore
   inputs:
     command: 'custom'
     projects: '**/*.csproj'
     custom: 'restore'

- task: DotNetCoreCLI@2
   displayName: Build
   inputs:
     command: 'custom'
     projects: '**/*.csproj'
     custom: 'build'
     arguments: '--no-restore'

- task: DotNetCoreCLI@2
   displayName: Pack
   inputs:
     command: 'pack'
     packagesToPack: '**/*.csproj'
     versioningScheme: 'off'

- task: NuGetCommand@2
   displayName: 'NuGet push'
   inputs:
     command: push
     packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
     publishVstsFeed: 'felipementel-packages'
     nuGetFeedType: 'internal'
     noCache: true
     allowPackageConflicts: true

and this is my csproj (without any icon references, as no tag worked)

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.8</Version>
<VersionSuffix>-alpha-1.0</VersionSuffix>
<Authors>Felipe P Augusto</Authors>
<Company>DEPLOY</Company>
<PackageTags>Microsoft .NET;Channel DEPLOY</PackageTags>
<Description>Example API and documentation too
It may contain a link, such as this example https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/README.md and https://github. com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md</Description>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<Content Include="FileAttachment.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<pack>true</pack>
</Content>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="AttachmentFile.txt" />
</ItemGroup>

</Project>

image

if anyone can help.

TheRealAyCe commented 6 months ago

@felipementel I don't think it's possible to display a custom icon in that menu at all.

LockTar commented 5 months ago

Hammer seems I'm not the only one with this problem. Hopefully this will be fixed ASAP

v-luzh commented 1 month ago

It still reproes on VS Main\35222.175 with implicit NuGet Client Dev\6.12.0.82.

donnie-msft commented 2 weeks ago

Providing a status update & plan outline:

  1. ➡️[PR in review (see screenshot)] Read icon from GPF when the icon is on the machine locally already (partial improvement): Attempt Loading package Icon from local folders to avoid accessing remote feeds for metadata by donnie-msft · Pull Request #6009 · NuGet/NuGet.Client (github.com)
  2. 🚧[On plate for September 2024] Show broken icon status indicator when the icon still isn't available PM UI Icon Status could be indicated with an Overlay on Default Icon · Issue #10122 · NuGet/Home (github.com)
  3. 💡[Needs design discussion] Hypothesis/trial needed: see if authenticating icon requests helps in any scenario to actually retrieve an icon remotely.
  4. Work with AzDo to determine if any changes can be made to improve how clients access icon from upstream sources.

Sample of improvement for PR in point # 1: image