OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.36k stars 2.37k forks source link

Add "used by" button #5942

Closed Piedone closed 4 years ago

Piedone commented 4 years ago

GitHub can display a "used by" button to the left of the watch counter in the top right corner.

I don't see how this can be configured, however, it displays the same data which is visible as "dependents" here. As you can see, nothing is listed there, although since it supports NuGet pretty much all open-source Orchard extensions should show up.

There doesn't seem to be any official documentation on how this works but I've read elsewhere that it works with the nuspec file. I'll ask GH support about this.

agriffard commented 4 years ago

Indeed, the GitHub project doesn't list any packages: https://github.com/OrchardCMS/OrchardCore/network/dependents

while we know there are some projects that have a reference to packages. Ex: https://github.com/EtchUK/Etch.OrchardCore.Fields/blob/master/Etch.OrchardCore.Fields.csproj

We can compare with another project: https://github.com/PiranhaCMS/piranha.core/network/dependents

The difference could be that they have a Project property on their nuget packages pointing to the GitHub project: https://www.nuget.org/packages/Piranha.Manager and we don't: https://www.nuget.org/packages/OrchardCore.ContentFields

agriffard commented 4 years ago

image

image

Piedone commented 4 years ago

My hunch is that it has to do with a nuspec project: Orchard doesn't have one, Piranha does, so maybe that way GitHub can figure out what packages are built from a repo. Anyway, I'm waiting for their answer.

Piedone commented 4 years ago

And I didn't manage to get a reply in a month so I opened this too: https://github.community/t5/How-to-use-Git-and-GitHub/How-are-dependents-calculated/m-p/57797#M11983

agriffard commented 4 years ago

https://www.nuget.org/packages/OrchardCore.Application.Cms.Targets has 1 dependent repository.

sebastienros commented 4 years ago

I think it's based on project references that are one GH and that point to our nuget packages. Few users use the nuget packages (only rc1), even fewer publish their project (site) on GH.

Piedone commented 4 years ago

Maybe it's not just the package ID but also the version indeed. So projects that depend on OC packages published somewhere else than NuGet (like the dev feed) won't show up.

deanmarcussen commented 4 years ago

So my guess here, is that very few packages are depending on the OrchardCore nuget package directly. It's generally through the OrchardCore.Application.Cms.Targets which indirectly has the reference.

So maybe github is not reading the indirect reference?

Piedone commented 4 years ago

Probably. I'd like to get a firm answer from GitHub on how actually this works but I couldn't achieve this within 1.5 months.

Piedone commented 4 years ago

I got a reply from support and they've recalculated the dependencies. Now there are more packages listed but the list is truncated: image I'm again waiting for their reply but it seems that this feature is not really suited to handle a project like Orchard with dozens of packages.

Piedone commented 4 years ago

Now we're talking: image

The dropdown has a hard limit of 100 but the most important packages are there anyway (Module.Targets but not Theme.Targets, Cms.Targets). However, the "Used by" button will only use the OrchardCore package. I'm in touch with support about this but apparently this can't yet be changed or configured to show a cumulative number.

sebastienros commented 4 years ago

Awesome! would be great if we could set Module.Targets as the default one though.

Piedone commented 4 years ago

Nothing to be done here, eventually, GitHub will fix this or not. BTW the "Used by" button was superseded by such a section on the project homepage's right bar.