-
Notifications
You must be signed in to change notification settings - Fork 467
Fix bug with installing .NET templates #4612
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d839b54
Trying cache template strat
aishwaryabh 9b497c9
release notes
aishwaryabh eaf042f
Reverting back to original template strat
aishwaryabh b309eb8
updating version props
aishwaryabh 7a04d2c
Updating release notes
aishwaryabh f99fe63
adding custom hive logic
aishwaryabh b61b8c6
addressing comments and adding unit tests
aishwaryabh 4e559a3
Update src/Cli/func/Helpers/DotnetHelpers.cs
aishwaryabh e4408dc
Update test/Cli/Func.UnitTests/HelperTests/DotnetHelpersTests.cs
aishwaryabh 51db56c
Update src/Cli/func/Helpers/DotnetHelpers.cs
aishwaryabh e1b88f5
fix formatting
aishwaryabh b5bb20b
moving tfm regex to its own file
aishwaryabh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,10 @@ | ||
| # Azure Functions CLI 4.2.1 | ||
| # Azure Functions CLI 4.2.2 | ||
|
|
||
| #### Host Version | ||
|
|
||
| - Host Version: 4.1041.200 | ||
| - In-Proc Host Version: 4.41.100 (4.841.100, 4.641.100) | ||
| - In-Proc Host Version: 4.41.100 (4.841.100, 4.641.100) | ||
|
|
||
| #### Changes | ||
|
|
||
| - Add support for .NET 10 isolated model (#4589) | ||
| - Update log streaming to support both connection string and instrumentation Key (#4586) | ||
| - Remove content of workers dir from minified versions (#4609) | ||
| - Fix .NET template install bug (#4612) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
|
||
| using Azure.Functions.Cli.Common; | ||
|
|
||
| namespace Azure.Functions.Cli.Helpers | ||
| { | ||
| // Partial class to hold E2E test related helpers | ||
| public static partial class DotnetHelpers | ||
| { | ||
| // Environment variable names to control custom hive usage in E2E tests | ||
| internal const string CustomHiveFlag = "FUNC_E2E_USE_CUSTOM_HIVE"; | ||
| internal const string CustomHiveRoot = "FUNC_E2E_HIVE_ROOT"; | ||
| internal const string CustomHiveKey = "FUNC_E2E_HIVE_KEY"; | ||
|
|
||
| private static bool UseCustomTemplateHive() => string.Equals(Environment.GetEnvironmentVariable(CustomHiveFlag), "1", StringComparison.Ordinal); | ||
|
|
||
| private static string GetHiveRoot() | ||
| { | ||
| string root = Environment.GetEnvironmentVariable(CustomHiveRoot); | ||
|
|
||
| if (!string.IsNullOrWhiteSpace(root)) | ||
| { | ||
| return root; | ||
| } | ||
|
|
||
| string coreToolsLocalDataPath = Utilities.EnsureCoreToolsLocalData(); | ||
| return Path.Combine(coreToolsLocalDataPath, "dotnet-templates-custom-hives"); | ||
| } | ||
|
|
||
| // By default, each worker runtime shares a hive. This can be overridden by setting the FUNC_E2E_HIVE_KEY | ||
| // environment variable to a custom value, which will cause a separate hive to be used. | ||
| private static string GetHivePath(WorkerRuntime workerRuntime) | ||
| { | ||
| string key = Environment.GetEnvironmentVariable(CustomHiveKey); | ||
| string leaf = !string.IsNullOrWhiteSpace(key) ? key : $"{workerRuntime.ToString().ToLowerInvariant()}-hive"; | ||
| return Path.Combine(GetHiveRoot(), leaf); | ||
| } | ||
|
|
||
| private static bool TryGetCustomHiveArg(WorkerRuntime workerRuntime, out string customHiveArg) | ||
| { | ||
| customHiveArg = string.Empty; | ||
|
|
||
| if (!UseCustomTemplateHive()) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| string hive = GetHivePath(workerRuntime); | ||
| FileSystemHelpers.EnsureDirectory(hive); | ||
|
|
||
| customHiveArg = $" --debug:custom-hive \"{hive}\""; | ||
| return true; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.