Skip to content

Commit

Permalink
Merge branch 'master' into refactor_async_code
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 committed Feb 21, 2024
2 parents a40a057 + a30f1e3 commit 5c664f9
Show file tree
Hide file tree
Showing 55 changed files with 9,095 additions and 206 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/dynamo_api_break.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: API Break Analysis

on:
pull_request:
types:
- opened
- synchronize

jobs:
analyze:
runs-on: windows-latest

steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
repository: DynamoDS/Dynamo

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Setup msbuild
uses: microsoft/[email protected]

- name: Install dependencies for windows runtime
run: |
dotnet restore ${{ github.workspace }}\Dynamo\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64
- name: Build and analyze
run: |
Write-Output "***Continue with the build, Good luck developer!***"
msbuild ${{ github.workspace }}\Dynamo\src\Dynamo.All.sln /p:Configuration=Release /warnAsError:RS0016 /p:PublicApiAnalyzers=true
2 changes: 1 addition & 1 deletion .github/workflows/generate_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
- name: Generate changelog
id: generate_changelog
uses: metcalfc/[email protected].0
uses: metcalfc/[email protected].1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ github.event.inputs.head-ref }}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Dynamo

[![Build DynamoAll.sln net6.0](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all_net6.0.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all_net6.0.yml)
[![Build DynamoAll.sln net8.0](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all_net8.0.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all_net8.0.yml)
[![Build DynamoCore.sln net6.0 windows](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_net6.0_windows.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_net6.0_windows.yml)
[![Build DynamoCore.sln net6.0 linux](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_net6.0_linux.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_net6.0_linux.yml)
[![Build DynamoAll.sln net8.0](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_all.yml)
[![Build DynamoCore.sln core windows](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_windows.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_windows.yml)
[![Build DynamoCore.sln linux](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_linux.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/build_dynamo_core_linux.yml)

[![DynamoCoreRuntime](https://img.shields.io/github/v/release/DynamoDS/Dynamo?logo=github&label=DynamoCoreRuntime)](https://github.com/DynamoDS/Dynamo/releases/latest)
[![Nuget](https://img.shields.io/nuget/v/DynamoVisualProgramming.Core?logo=nuget)](https://www.nuget.org/packages/DynamoVisualProgramming.Core)
Expand Down
1 change: 0 additions & 1 deletion src/DynamoApplications/StartupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public static void PreloadShapeManager(ref string geometryFactoryPath, ref strin
var versions = new[]
{
new Version(230,0,0),
new Version(229,0,0),
};

var preloader = new Preloader(rootFolder, versions);
Expand Down
26 changes: 23 additions & 3 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public int NodeSearchTagSizeLimit
/// This property is not serialized and is assigned IronPythonResolveTargetVersion's value
/// if found at deserialize time.
/// </summary>
internal Version ironPythonResolveTargetVersion = new Version(3, 0, 0);
internal Version ironPythonResolveTargetVersion = new Version(3, 2, 0);

/// <summary>
/// The Version of the IronPython package that Dynamo will download when it is found as missing in graphs.
Expand Down Expand Up @@ -1141,14 +1141,34 @@ internal static string GetDefaultPythonEngine()
return defaultPythonEngine;
}

/// <summary>
/// Initialize namespaces to exclude from Library based on conditions
/// </summary>
internal void InitializeNamespacesToExcludeFromLibrary()
{
if (!NamespacesToExcludeFromLibrarySpecified)
{
NamespacesToExcludeFromLibrary.Add(
NamespacesToExcludeFromLibrary = new List<string>()
{
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline",
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.Panel"
};
NamespacesToExcludeFromLibrarySpecified = true;
}
}

/// <summary>
/// Update namespaces to exclude from Library based on feature flags
/// </summary>
internal void UpdateNamespacesToExcludeFromLibrary()
{
// When the experiment toggle is disabled by feature flag, include the TSpline namespace from the library OOTB.
if (!DynamoModel.FeatureFlags?.CheckFeatureFlag("IsTSplineNodesExperimentToggleVisible", false) ?? false)
{
NamespacesToExcludeFromLibrary.Remove(
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline"
);
NamespacesToExcludeFromLibrarySpecified = true;
return;
}
}

Expand Down
23 changes: 11 additions & 12 deletions src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<Compile Remove="Graph\ConnectorPinModel.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<!--The System.Drawing package is only included in DynamoCore (and not in all projects that have image resources) for simplicity-->
Expand All @@ -28,14 +32,13 @@
<ItemGroup Label="Common dependencies">
<PackageReference Include="Autodesk.IDSDK" Version="1.1.8" />
<PackageReference Include="Greg" Version="3.0.0.3175" />
<PackageReference Include="DynamoVisualProgramming.LibG_229_0_0" Version="3.0.0.3331" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.3421" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.4074" GeneratePathProperty="true" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" CopyXML="true" />
<PackageReference Include="RestSharp" Version="108.0.1" CopyXML="true" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
<PackageReference Include="DynamoVisualProgramming.Analytics" Version="4.2.0.3534" />
<PackageReference Include="DynamoVisualProgramming.Analytics" Version="4.2.1.4086" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Engine\GraphLayout\GraphLayout.csproj">
Expand Down Expand Up @@ -109,17 +112,15 @@

<Target Name="BeforeBuildOps" BeforeTargets="Build">
<PropertyGroup>
<LibGProtoGeometryLibGLocale>$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\libg_locale</LibGProtoGeometryLibGLocale>
<LibGProtoGeometryLibGLocale>$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\libg_locale</LibGProtoGeometryLibGLocale>
</PropertyGroup>
<ItemGroup>
<LibGInterface Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\LibG.Interface.dll" />
<LibGProtoGeometryDLL Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\ProtoGeometry.dll" />
<LibGProtoGeometryXML Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\ProtoGeometry.XML" />
<LibG229Deps Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\asm_deps.csproj" />
<LibGInterface Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\LibG.Interface.dll" />
<LibGProtoGeometryDLL Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\ProtoGeometry.dll" />
<LibGProtoGeometryXML Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\ProtoGeometry.XML" />
<LibG230Deps Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\asm_deps.csproj" />
<LibGProtoGeometryUICulture Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\$(UICulture)\*" />
<LibGProtoGeometryUICulture Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\$(UICulture)\*" />
<LibG230 Include="$(PkgDynamoVisualProgramming_LibG_230_0_0)\tools\netstandard2.0\$(LibGOsToken)\LibG_230_0_0\*" />
<LibG229 Include="$(PkgDynamoVisualProgramming_LibG_229_0_0)\tools\netstandard2.0\$(LibGOsToken)\LibG_229_0_0\*" />
<SampleFiles Include="$(SolutionDir)..\doc\distrib\Samples\**\*.*" />
<NodeHelpMDFiles Include="$(SolutionDir)..\doc\distrib\NodeHelpFiles\**\*.md" />
<NodeHelpDYNFiles Include="$(SolutionDir)..\doc\distrib\NodeHelpFiles\**\*.dyn" />
Expand Down Expand Up @@ -149,11 +150,9 @@
<Copy SourceFiles="@(LibGProtoGeometryXml)" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="@(LibGProtoGeometryXml)" DestinationFolder="$(OutputPath)\$(UICulture)" />
<Copy SourceFiles="@(LibGProtoGeometryUICulture)" DestinationFolder="$(OutputPath)\$(UICulture)" />
<Copy Condition="$(Platform.Contains('Linux'))" SourceFiles="@(LibG229Deps)" DestinationFolder="$(OutputPath)libg_229_0_0\asm_deps\" />
<Copy Condition="$(Platform.Contains('Linux'))" SourceFiles="@(LibG230Deps)" DestinationFolder="$(OutputPath)libg_230_0_0\asm_deps\" />
<Exec Command="$(PowerShellCommand) -ExecutionPolicy ByPass -Command Copy-Item -Path $(LibGProtoGeometryLibGLocale) -Destination $(OutputPath) -Recurse -Force" />
<Copy SourceFiles="@(LibG230)" DestinationFolder="$(OutputPath)libg_230_0_0\" />
<Copy SourceFiles="@(LibG229)" DestinationFolder="$(OutputPath)libg_229_0_0\" />
<Copy SourceFiles="@(SampleFiles)" DestinationFolder="$(OutputPath)samples\%(RecursiveDir)" />
<Copy SourceFiles="@(LocalizedResources)" DestinationFolder="$(OutputPath)%(RecursiveDir)" />
<Copy SourceFiles="$(ProjectDir)\BuiltInAndOperators\Operators.xml" DestinationFolder="$(OutputPath)\$(UICulture)" />
Expand Down
14 changes: 13 additions & 1 deletion src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
using Dynamo.Selection;
using Dynamo.Utilities;
using DynamoServices;
using DynamoUtilities;
using Greg;
using Lucene.Net.Documents;
using Lucene.Net.Index;
Expand Down Expand Up @@ -718,7 +719,7 @@ protected DynamoModel(IStartConfiguration config)
{
//this will kill the CLI process after cacheing the flags in Dynamo process.
using (FeatureFlags =
new DynamoUtilities.DynamoFeatureFlagsManager(
new DynamoFeatureFlagsManager(
AnalyticsService.GetUserIDForSession(),
mainThreadSyncContext,
IsTestMode))
Expand All @@ -730,6 +731,7 @@ protected DynamoModel(IStartConfiguration config)
}
catch (Exception e) { Logger.LogError($"could not start feature flags manager {e}"); };
});
DynamoFeatureFlagsManager.FlagsRetrieved += HandleFeatureFlags;
}

// TBD: Do we need settings migrator for service mode? If we config the docker correctly, this could be skipped I think
Expand Down Expand Up @@ -977,6 +979,15 @@ protected DynamoModel(IStartConfiguration config)
DynamoReady(new ReadyParams(this));
}

/// <summary>
/// When feature flags received, handle them and make changes
/// </summary>
private void HandleFeatureFlags()
{
PreferenceSettings.UpdateNamespacesToExcludeFromLibrary();
return;
}

private void HandleAnalytics()
{
if (IsTestMode)
Expand Down Expand Up @@ -1369,6 +1380,7 @@ public void Dispose()
LibraryServices.LibraryLoaded -= LibraryLoaded;

EngineController.VMLibrariesReset -= ReloadDummyNodes;
DynamoFeatureFlagsManager.FlagsRetrieved -= HandleFeatureFlags;

Logger.Dispose();

Expand Down
1 change: 1 addition & 0 deletions src/DynamoCore/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 5c664f9

Please sign in to comment.