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

Add support for the repository property in .nuspec #2071

Open
SquelchPlop opened this issue Jun 21, 2020 · 1 comment
Open

Add support for the repository property in .nuspec #2071

SquelchPlop opened this issue Jun 21, 2020 · 1 comment

Comments

@SquelchPlop
Copy link

Support for a repository property in NuGet .nuspec files was added a while back, with the idea being that this would make tracking both the project's website (using the existing projectUrl property) and the package's source code (using the new repository property) clearer.

Chocolatey already had the packageSourceUrl property to achieve this.

However, some package repositories, such as GitHub Packages, will now not allow packages to be uploaded without the repository property being set in the .nuspec file:

WARNING: No destination repository detected. Ensure the source project has a 'RepositoryUrl' property defined. If you're using a nuspec file, ensure that it has a repository element with the required 'type' and 'url' attributes.

I believe this leaves 4 options:

  1. Add support in choco pack for the repository property alongside the existing packageSourceUrl property.
  • Backwards-compatible, and allows GitHub Packages to be used as an package repository.
  • Will lead to duplicated properties if used (i.e. the repository property and the packageSourceUrl property would be set to the same value).
  1. Automatically transform the existing packageSourceUrl property into the repository property in choco pack's generated .nuspec.
  • Not backwards-compatible, will cause existing tools that depend on packageSourceUrl to break.
  • Cleaner than option 1 - no duplicate properties.
  1. Require the repository property to be used in .nuspec files rather than the packageSourceUrl property.
  • Not backwards-compatible, publishers will have to update their .nuspec files.
  • Existing tools that depend on packageSourceUrl will have to check for the repository property first, then fallback to using the packageSourceUrl.
  1. Do nothing
  • Prevents GitHub Packages and possibly other package repositories that use the current .nuspec specification from being used.
  • Divergence between NuGet .nuspec files and Chocolatey .nuspec files. Whilst they are different tools, given that Chocolatey leverages NuGet package repositories, I think as much compatibility as possible should be the goal?

Happy to contribute, but I think this requires input from others before making PRs and changes.

@ferventcoder
Copy link
Member

This feels like it has overlap in #508, maybe even depends on that aspect. Like GitHub repositories only support NuGet v3, not NuGet v2, which Chocolatey would need at this time.

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

No branches or pull requests

2 participants