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

Upgrade Quartz and some warning fixes #5949

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>

<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
sfmskywalker marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);CS0162;CS1591</NoWarn>
<!-- IL trimming warnings -->
<NoWarn>$(NoWarn);IL2026;IL2046;IL2057;IL2067;IL2070;IL2072;IL2075;IL2087;IL2091</NoWarn>
sfmskywalker marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
<PropertyGroup>
<ElsaStudioVersion>3.3.0-preview.470</ElsaStudioVersion>
Expand Down
6 changes: 2 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@
<PackageVersion Include="Proto.Persistence.SqlServer" Version="1.6.0" />
<PackageVersion Include="Proto.Remote" Version="1.6.0" />
<PackageVersion Include="pythonnet" Version="3.0.3" />
<PackageVersion Include="Quartz" Version="3.11.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.11.0" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.11.0" />
<PackageVersion Include="Quartz.Serialization.Json" Version="3.11.0" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.13.0" />
<PackageVersion Include="Quartz.Serialization.Json" Version="3.13.0" />
sfmskywalker marked this conversation as resolved.
Show resolved Hide resolved
<PackageVersion Include="Refit" Version="7.1.2" />
<PackageVersion Include="Refit.HttpClientFactory" Version="7.0.0" />
<PackageVersion Include="Scrutor" Version="4.2.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ public static class PropertyBagExtensions
/// <param name="key">The key of the value to retrieve.</param>
/// <param name="defaultValue">A function that returns the default value to be returned if the key does not exist in the PropertyBag.</param>
/// <returns>The value associated with the key, or the default value if the key does not exist.</returns>
public static T TryGetValueOrDefault<T>(this PropertyBag propertyBag, string key, Func<T> defaultValue)
public static T? TryGetValueOrDefault<T>(this PropertyBag propertyBag, string key, Func<T> defaultValue)
{
if (!propertyBag.TryGetValue(key, out var value))
return defaultValue();

var json = value.ToString();

if (string.IsNullOrWhiteSpace(json))
return defaultValue();

return JsonSerializer.Deserialize<T>(json);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class DefaultFormattersFeature(IModule module) : FeatureBase(module)
{
public override void Configure()
{
module.Services.AddSingleton<IFormatter, JsonFormatter>();
Module.Services.AddSingleton<IFormatter, JsonFormatter>();
}
}
2 changes: 1 addition & 1 deletion src/modules/Elsa.Common/Results/TenantResolutionResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Elsa.Common.Results;
/// <summary>
/// Represents the result of a tenant resolution.
/// </summary>
/// <param name="Tenant">The resolved tenant.</param>
/// <param name="TenantId">The resolved tenant.</param>
public record TenantResolutionResult(string? TenantId)
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Elsa.Common/Serialization/JsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public string Serialize(object value)

/// <inheritdoc />
[RequiresUnreferencedCode("The type is not known at compile time.")]
public string Serialize(object value, Type type)
public string Serialize(object? value, Type type)
{
var options = GetOptions();
return JsonSerializer.Serialize(value, type, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public TDbContext CreateDbContext(string[] args)

ConfigureBuilder(builder, connectionString);

return (TDbContext)Activator.CreateInstance(typeof(TDbContext), builder.Options, serviceProvider);
return (TDbContext)Activator.CreateInstance(typeof(TDbContext), builder.Options, serviceProvider)!;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override Migration CreateMigration(TypeInfo migrationClass, string active

if (hasCtorWithSchema && _context is IElsaDbContextSchema schema)
{
var instance = (Migration)Activator.CreateInstance(migrationClass.AsType(), schema);
var instance = (Migration)Activator.CreateInstance(migrationClass.AsType(), schema)!;
instance.ActiveProvider = activeProvider;
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Elsa.Extensions;
public static class ExpressionOptionsExtensions
{
/// <summary>
/// Register type <see cref="T"/> with the specified alias.
/// Register type <typeparamref name="T"/> with the specified alias.
/// </summary>
public static void AddTypeAlias<T>(this ExpressionOptions options) => options.RegisterTypeAlias(typeof(T), typeof(T).Name);
public static void AddTypeAlias<T>(this ExpressionOptions options, string alias) => options.RegisterTypeAlias(typeof(T), alias);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static IServiceCollection AddExpressionDescriptorProvider<T>(this IServic
}

/// <summary>
/// Register type <see cref="T"/> with the specified alias.
/// Register type <typeparamref name="T"/> with the specified alias.
/// </summary>
/// <param name="module">The module.</param>
/// <param name="alias">The alias.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Elsa.Expressions.Extensions;
public static class WellKnowTypeRegistryExtensions
{
/// <summary>
/// Register type <see cref="T"/> with the specified alias.
/// Register type <typeparamref name="T"/> with the specified alias.
/// </summary>
public static void RegisterType<T>(this IWellKnownTypeRegistry registry, string alias) => registry.RegisterType(typeof(T), alias);

Expand Down
1 change: 0 additions & 1 deletion src/modules/Elsa.Expressions/Models/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public Expression(string type, object? value)
/// Creates an expression that represents a delegate.
/// </summary>
/// <param name="value">The delegate.</param>
/// <typeparam name="T">The return type of the delegate.</typeparam>
/// <returns>An expression that represents a delegate.</returns>
public static Expression DelegateExpression(Func<ExpressionExecutionContext, ValueTask<object?>> value) => new()
{
Expand Down
2 changes: 0 additions & 2 deletions src/modules/Elsa.Quartz/Elsa.Quartz.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Quartz" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" />
<PackageReference Include="Quartz.Extensions.Hosting" />
sfmskywalker marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

Expand Down
3 changes: 0 additions & 3 deletions src/modules/Elsa.Quartz/Features/QuartzFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public override void Apply()

private static void ConfigureQuartzInternal(IServiceCollectionQuartzConfigurator quartz, Action<IServiceCollectionQuartzConfigurator>? configureQuartz)
{
quartz.UseMicrosoftDependencyInjectionJobFactory();
sfmskywalker marked this conversation as resolved.
Show resolved Hide resolved
quartz.UseSimpleTypeLoader();
quartz.UseInMemoryStore();
configureQuartz?.Invoke(quartz);
}
}
2 changes: 1 addition & 1 deletion src/modules/Elsa.Tenants/Extensions/ModuleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Elsa.Tenants.Extensions;
public static class ModuleExtensions
{
/// <summary>
/// Installs & configures the <see cref="TenantsFeature"/> feature.
/// Installs and configures the <see cref="TenantsFeature"/> feature.
/// </summary>
public static IModule UseTenants(this IModule module, Action<TenantsFeature>? configure = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ public async Task SetWorkflowGraphAsync(WorkflowGraph workflowGraph)
public Diff<Bookmark> BookmarksDiff => Diff.For(OriginalBookmarks, Bookmarks);

/// <summary>
/// A dictionary of inputs provided at the start of the current workflow execution.
/// A dictionary of inputs provided at the start of the current workflow execution.
/// </summary>
public IDictionary<string, object> Input { get; set; }

/// A dictionary of outputs provided by the current workflow execution.
Expand Down Expand Up @@ -398,6 +399,7 @@ internal void RemoveCompletionCallbacks(IEnumerable<ActivityCompletionCallbackEn

/// <summary>
/// Returns the <see cref="ActivityNode"/> with the specified activity ID from the workflow graph.
/// </summary>
public ActivityNode? FindNodeById(string nodeId) => NodeIdLookup.TryGetValue(nodeId, out var node) ? node : default;

/// Returns the <see cref="ActivityNode"/> with the specified hash of the activity node ID from the workflow graph.
Expand Down
Loading