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

Merge main into dev #17

Merged
merged 25 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6855dad
Merge pull request #14 from EAVFW/dev
pksorensen Mar 22, 2024
5efa713
fix: fixed support for net.8 (had breaking change on create index)
pksorensen Apr 25, 2024
b6e64da
fix: removed deps on azure tables
pksorensen Apr 25, 2024
ae0625e
fix: cleaned up dependencies that is deprecated
pksorensen Apr 25, 2024
a4a0d7e
fix: fixed implementation for emit MigrationBuilderCreateIndex for .n…
pksorensen Apr 25, 2024
4ca454b
fix: added default of always secure cookie and option to disable
pksorensen Apr 29, 2024
773921c
Merge branch 'main' of https://github.com/EAVFW/EAVFramework
pksorensen Apr 29, 2024
cf5f714
fix: fixed type of second argument of sql command in emited code whic…
pksorensen May 15, 2024
651985a
feat: added a polylookup split into reference tables per reference en…
pksorensen May 27, 2024
2fc6f85
regression where inline should not skip the field
pksorensen May 27, 2024
24a2c31
added cascade on poly lookup such the n:n record is deleted automatic…
pksorensen May 28, 2024
5c55d89
updated create endpoint to transform incoming payload with poly looku…
pksorensen May 28, 2024
b0ddb97
Merge branch 'pks/polylookup-split' of https://github.com/EAVFW/EAVFr…
pksorensen May 28, 2024
6ad5203
resolution on test where attribute simple types not deserialiazble
pksorensen May 28, 2024
d984a55
fix: unit tests updated to run for .net8
pksorensen May 28, 2024
aa05f12
wonder why we have this hardcoded
pksorensen May 28, 2024
e9a6b48
Merge pull request #15 from EAVFW/pks/polylookup-split
pksorensen May 28, 2024
8ee6418
fix: locked version as it is breaking
pksorensen May 28, 2024
1903489
fix: updated deps
pksorensen May 29, 2024
2053be9
fix: support interfaces in LoadIfMissing helpers
pksorensen Jun 5, 2024
29f377a
locked down semantic release
pksorensen Jun 5, 2024
0fe50b3
fix: made the account url relative
pksorensen Jun 25, 2024
103de9b
feat: added entityref support
pksorensen Jun 25, 2024
d578dc0
fix: using pathbase in redirect to support proxy paths
pksorensen Jun 25, 2024
5844141
feat: added a mapper from logicalname to collectionname
pksorensen Jun 25, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build

on:
pull_request:
Expand Down Expand Up @@ -63,10 +63,10 @@ jobs:
run: dotnet build -o ../build/net6.0/ -f net6.0 -c Release --no-restore -m:1

- name: Restore NuGet packages
run: dotnet restore EAVFramework.sln -p:TargetFramework=netcoreapp3.1
run: dotnet restore EAVFramework.sln -p:TargetFramework=net8.0

- name: Build solution
run: dotnet build -o ../build/netcoreapp3.1/ -f netcoreapp3.1 -c Release --no-restore -m:1
run: dotnet build -o ../build/net8.0/ -f net8.0 -c Release --no-restore -m:1

- name: Archive build to artifacts
uses: actions/upload-artifact@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
node-version: '20'

- name: Add plugin for conventional commits
run: npm install conventional-changelog-conventionalcommits
run: npm install conventional-changelog-conventionalcommits@7.0.2
working-directory: ./.github/workflows

- name: Add plugin for executing bash commands
Expand All @@ -74,7 +74,7 @@ jobs:
GIT_AUTHOR_NAME: pksorensen
GIT_AUTHOR_EMAIL: [email protected]
run: |
echo "RELEASE_VERSION=$((npx semantic-release --dry-run).Where({ $_ -like '*Release note*' }) | Out-String | Select-String '[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-z]+[.][0-9]*)?' | % { $_.Matches } | % { $_.Value })" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE_VERSION=$((npx semantic-release@23.1.1 --dry-run).Where({ $_ -like '*Release note*' }) | Out-String | Select-String '[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-z]+[.][0-9]*)?' | % { $_.Matches } | % { $_.Value })" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Print release verison
run: echo ${env:RELEASE_VERSION}

Expand All @@ -95,4 +95,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: pksorensen
GIT_AUTHOR_EMAIL: [email protected]
run: npx semantic-release
run: npx semantic-release@23.1.1
54 changes: 51 additions & 3 deletions sdk/DTO/AttributeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ public override AttributeDefinitionBase Read(
return new AttributeStringDefinition { Value = reader.GetString() ?? "" };
case JsonTokenType.StartObject:
var node = JsonNode.Parse(ref reader);
var t = node.Deserialize<AttributeObjectDefinition>();
return t;

var t = node.Deserialize<AttributeObjectDefinition>(new JsonSerializerOptions { Converters={ new TypeDefinitionConverter()} });
return t;


default:
throw new Exception($"{reader.TokenType} is not supported as AttributeDefinition");
}
Expand Down Expand Up @@ -51,10 +54,12 @@ public class AttributeStringDefinition : AttributeDefinitionBase
{
public string Value { get; set; }
}


public class AttributeObjectDefinition : AttributeDefinitionBase
{
[JsonPropertyName("isPrimaryField")] public bool IsPrimaryField { get; set; }
[JsonPropertyName("logicalName")] public string LogicalName { get; set; }

[JsonPropertyName("moduleSource")] public string ModuleSource { get; set; }

Expand All @@ -69,9 +74,52 @@ public class AttributeObjectDefinition : AttributeDefinitionBase
public Dictionary<string, JsonElement> AdditionalFields { get; set; }
}

public class TypeDefinition

public class TypeDefinitionConverter : JsonConverter<TypeDefinition>
{
public override TypeDefinition Read(
ref Utf8JsonReader reader,
Type typeToConvert,
JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case JsonTokenType.String:
return new TypeDefinition { Type = reader.GetString() ?? "" };
case JsonTokenType.StartObject:
var node = JsonNode.Parse(ref reader);

var t = node.Deserialize<TypeDefinition>();
return t;


default:
throw new Exception($"{reader.TokenType} is not supported as AttributeDefinition");
}
}

public override void Write(Utf8JsonWriter writer, TypeDefinition value, JsonSerializerOptions options)
{
var jsonString = value switch
{
TypeDefinition attributeObjectDefinition =>
JsonSerializer.Serialize(attributeObjectDefinition),

_ => throw new ArgumentException($"{value.GetType()} is not supported")
};

var jsonNode = JsonNode.Parse(jsonString);
jsonNode?.WriteTo(writer, options);
}
}

// [JsonConverter(typeof(TypeDefinitionConverter))]

public class TypeDefinition
{
[JsonPropertyName("type")] public string Type { get; set; }

[JsonPropertyName("split")] public bool Split { get; set; }
[JsonPropertyName("referenceType")] public string ReferenceType { get; set; }

[JsonPropertyName("options")] public Dictionary<string, JsonElement> Options { get; set; }
Expand Down
32 changes: 27 additions & 5 deletions sdk/DTO/EntityDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace EAVFW.Extensions.Manifest.SDK
{
public class EntityDefinition
{
[JsonPropertyName("pluralName")] public string PluralName { get; set; }
[JsonPropertyName("description")] public string Description { get; set; }
[JsonPropertyName("attributes")] public Dictionary<string, AttributeDefinitionBase> Attributes { get; set; }
[JsonPropertyName("wizards")] public Dictionary<string, WizardDefinition> Wizards { get; set; }
[JsonProperty("pluralName")]
[JsonPropertyName("pluralName")]
public string PluralName { get; set; }

[JsonProperty("collectionSchemaName")]
[JsonPropertyName("collectionSchemaName")]
public string CollectionSchemaName { get; set; }

[JsonProperty("logicalName")]
[JsonPropertyName("logicalName")]
public string LogicalName { get; set; }


[JsonPropertyName("description")]
[JsonProperty("description")]
public string Description { get; set; }

[JsonPropertyName("attributes")]
[JsonProperty("attributes")]
public Dictionary<string, AttributeDefinitionBase> Attributes { get; set; }

[JsonPropertyName("wizards")]
[JsonProperty("wizards")]
public Dictionary<string, WizardDefinition> Wizards { get; set; }

/// <summary>
/// Exclusively used to capture non-spec items
/// </summary>
[JsonExtensionData]
[System.Text.Json.Serialization.JsonExtensionData]
[Newtonsoft.Json.JsonExtensionData]
public Dictionary<string, object> AdditionalFields { get; set; }
}
}
2 changes: 1 addition & 1 deletion sdk/DTO/MessageDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace EAVFW.Extensions.Manifest.SDK
{
public class MessageDefinition
{
[JsonPropertyName("title")] public string? Title { get; set; }
[JsonPropertyName("title")] public string Title { get; set; }
}
}
12 changes: 4 additions & 8 deletions sdk/DefaultManifestReplacementRunner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DotNETDevOps.JsonFunctions;
using DotNETDevOps.JsonFunctions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -211,14 +211,10 @@ public async Task RunReplacements(JToken jsonraw, string customizationprefix, IL
}
else
{
try
{

parentObj.Add(childProp);
q.Enqueue(childProp);
}catch(Exception ex)
{
throw;
}

}

// parentObj.Add(childProp.Name, childProp.Value);
Expand Down Expand Up @@ -284,7 +280,7 @@ public async Task RunReplacements(JToken jsonraw, string customizationprefix, IL
}

}
catch (Exception ex)
catch (Exception)
{
Console.WriteLine($"{entityPath}| {attributePath}");
throw;
Expand Down
4 changes: 2 additions & 2 deletions sdk/EAVFW.Extensions.Manifest.SDK.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>

Expand Down
Loading
Loading