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 route to match older Nuget.Server uploads #62

Merged
merged 1 commit into from
Sep 4, 2018
Merged

Add route to match older Nuget.Server uploads #62

merged 1 commit into from
Sep 4, 2018

Conversation

ericcoleman
Copy link
Contributor

@ericcoleman ericcoleman commented Jun 1, 2018

Between NuGet.Server v2.8.50926.602 and NuGet.Server v3.1.2.0 the route to push a package was changed from /api/v2/packages to /nuget.

When using nuget.exe, if using the root url it will append api/v2/packages.
For example,

.\Nuget.exe push "{thing}.nupkg" -s http://localhost:40221 -Verbosity detailed
Pushing {package} 1.2.3 to 'http://localhost:40221'...
PUT http://localhost:40221/api/v2/package/

This change will allow users to continue to push packages to api/v2/packages so they don't have to edit their existing deployment scripts when doing a Nuget.Server upgrade.

Copy link
Contributor

@shishirx34 shishirx34 left a comment

Choose a reason for hiding this comment

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

Not sure why the upload route was changed from api/v2/package to root/ @joelverhagen - thoughts?

@ericcoleman
Copy link
Contributor Author

Hey just wanted to follow up on this PR. Any movement?

@chenriksson chenriksson requested review from chenriksson and removed request for chenriksson August 21, 2018 21:44
@chenriksson chenriksson self-assigned this Aug 21, 2018
@chenriksson
Copy link
Member

@ericcoleman Sorry for the delay! I'll put this on my agenda for this week and get back to you soon.

@chenriksson
Copy link
Member

@ericcoleman I've confirmed the CI gate passes, and will be testing soon. I hope to merge this tomorrow!

@chenriksson
Copy link
Member

@shishirx34 The route changed in v3.0.0, as part of the WCF to WebApi changes. Discussed offline with @joelverhagen and we don't see any concern with adding back the original upload route.

@chenriksson
Copy link
Member

Verified with build 39095

@Levente0xFFFF
Copy link

This change breaks our application. We cannot upgrade from NuGet.Server.V2 3.1.2 to 3.2.0 because of this change. This is a breaking change, so this package should be unlisted and re-released with version 4.0.0. See semver.org for details.

We are getting this exception when calling NuGetV2WebApiEnabler.UseNuGetV2WebApiFeed():

System.ArgumentException: 'A route named 'apiv2package_upload' is already in the route collection. Route names must be unique.
Parameter name: name'

We are hosting multiple NuGet feeds on the same web app and passing the routeName as a parameter.
Since this change hard codes the route name this is not possible anymore:

name: "apiv2package_upload",

All the above route registrations are taking the routeName parameter into consideration, but not this one.

@joelverhagen
Copy link
Member

@Levente0xFFFF, thanks for the report and we apologise for the inconvenience. Could you open a new GitHub issue so we can track this separately?

It seems like a straightforward fix would be to make this route optional. Do you think a bool parameter to this method would be sufficient to solve your problem?

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

Successfully merging this pull request may close these issues.

5 participants