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

Refactor update-dependencies to support additional scenarios #469

Merged
merged 2 commits into from
Apr 9, 2018

Conversation

MichaelSimons
Copy link
Member

  • Add support for reading local build info file.
  • Add support for 2.0 sdk scenarios where the sdk version does not align with the dockerfile version folder layout. Runtime version info is used to find Dockerfiles now.
  • Add support for reading checksums from https://dotnetcli.blob.core.windows.net/dotnet/checksums if not found in https://dotnetclichecksums.blob.core.windows.net

@dotnet-bot skip ci please

Copy link
Member

@dagood dagood left a comment

Choose a reason for hiding this comment

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

Looks reasonable, a few suggestions.

private static readonly string s_varShaPattern =
$"[ \\$](?<{EnvNameGroupName}>(dotnet_|aspnetcore_)sha512)( )*=( )*'(?<{ValueGroupName}>[^'\\s]*)'";

private static readonly Regex s_downloadUrlRegex = new Regex($"({s_envDownloadUrlPattern})|{s_inlineUrlPattern}");
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunate that GitHub's code coloring doesn't like that s_varShaPattern string. 😕 Not sure what's exactly causing it to break.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had noticed that :(

Copy link
Member Author

Choose a reason for hiding this comment

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

If I don't put it on a separate line, the syntax coloring works...

Copy link
Member

Choose a reason for hiding this comment

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

Wow... that's pretty strange.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if this is by chance related to the same underlying cause as atom/language-csharp#113? Sounds like work is in play to get GH to use a more recent version of the grammar. Will monitor.

Copy link

Choose a reason for hiding this comment

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

FYI, GitHub has just released and that issue along with many others around C# syntax highlighting are fixed 🎉

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the heads up @kasper3!

downloadUrl = SubstituteEnvRef(downloadUrl, versionInfo.EnvName, versionInfo.Version);
sha = await GetDotNetCliChecksumsShaAsync(downloadUrl, versionInfo.EnvName)
?? await GetDotNetReleaseChecksumsShaAsync(downloadUrl, versionInfo.EnvName, versionInfo.Version);
sha = sha?.ToLower();
Copy link
Member

Choose a reason for hiding this comment

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

ToLowerInvariant?

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched

{
Trace.TraceInformation($"Failed to find `dotnetclichecksums` sha");
}
};
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary semicolon (and more later on other usings).

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed all

syntax.DefineParameter(
"build-info",
ref buildInfoUrl,
(value) => new Uri(value),
"URL of the build info to update the Dockerfiles with");
Copy link
Member

Choose a reason for hiding this comment

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

Worthwhile to call out here that file:// works?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion.

@MichaelSimons MichaelSimons merged commit 0e43d97 into dotnet:nightly Apr 9, 2018
@MichaelSimons MichaelSimons deleted the update-deps-tool branch April 9, 2018 21:45
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.

None yet

2 participants