Skip to content

Commit

Permalink
(GH-1285) Default push to new or old w/warning
Browse files Browse the repository at this point in the history
When pushing larger packages, the original push url was subject to a
timeout of 100 seconds, a limitation of using Cloudflare. The error:
`Error publishing package. NuGet server returned 524: Origin Time-out"
when pushing through the Cloudflare infrastructure. Instead, convert to
a new default push url that is not subject to a timeout by Cloudflare.

To ensure this is not a breaking change, determine whether the old
apikey was set and use it with a warning to change it over to use the
new url.
  • Loading branch information
ferventcoder committed May 18, 2017
1 parent f508b68 commit 794f498
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ choco apikey
");

"chocolatey".Log().Info(ChocolateyLoggers.Important, "Connecting to Chocolatey.org");
"chocolatey".Log().Info(ChocolateyLoggers.Important, "Connecting to Chocolatey.org (Community Package Repository)");
"chocolatey".Log().Info(() => @"
In order to save your API key for {0},
log in (or register, confirm and then log in) to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ public virtual void handle_additional_argument_parsing(IList<string> unparsedArg
if (string.IsNullOrWhiteSpace(configuration.Sources))
{
configuration.Sources = ApplicationParameters.ChocolateyCommunityFeedPushSource;
var newSourceKey = _configSettingsService.get_api_key(configuration, null);

if (string.IsNullOrWhiteSpace(newSourceKey))
{
configuration.Sources = ApplicationParameters.ChocolateyCommunityFeedPushSourceOld;
var oldSourceKey = _configSettingsService.get_api_key(configuration, null);

if (string.IsNullOrWhiteSpace(oldSourceKey))
{
configuration.Sources = ApplicationParameters.ChocolateyCommunityFeedPushSource;
}
else
{
this.Log().Warn(ChocolateyLoggers.Important, @"ACTION: Please update your apikey to use
'{0}'
instead of
'{1}'.
The latter source url is now considered deprecated and will not be
checked as the default source in Chocolatey v1.0. For details, run
`choco apikey -?`".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource, ApplicationParameters.ChocolateyCommunityFeedPushSourceOld));
}
}
}

if (!string.IsNullOrWhiteSpace(configuration.Sources))
Expand Down

0 comments on commit 794f498

Please sign in to comment.