Skip to content

Commit

Permalink
Merge branch 'release/3.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieranties committed Feb 21, 2022
2 parents c343d7c + 6fe88bb commit b6f8258
Show file tree
Hide file tree
Showing 25 changed files with 439 additions and 101 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningsAsErrors>CS0105;CS0108;CS0109;CS0114;CS0162;CS0168;CS0169;CS0219;CS0252;CS0414;CS0472;CS0649;CS0652;CS1717;CS1998;CS4014;xUnit1013;MSB3245;MSB3270,NU1602</WarningsAsErrors>
<!--
NU5105 : Semver 2 package version
NU5105 : Semver 2 package version
-->
<NoWarn>$(NoWarn);NU5105</NoWarn>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -19,7 +19,7 @@
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+').Value)</AssemblyVersion>
<FileVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+.\d+').Value)</FileVersion>
<Company>CluedIn ApS</Company>
<Copyright>Copyright (c) 2020 $(Company). All rights reserved.</Copyright>
<Copyright>Copyright (c) 2021 $(Company). All rights reserved.</Copyright>
<Product>CluedIn</Product>
<AssemblyTitle>$(MSBuildProjectName)</AssemblyTitle>
<AssemblyName>$(Product).$(AssemblyTitle)</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
<Warning Code="CIQ1006" Text="`Copyright` must be provided for packable projects." Condition="'$(Copyright)' == ''"/>
</Target>

</Project>
</Project>
25 changes: 16 additions & 9 deletions ExternalSearch.Providers.VatLayer.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29503.13
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B2A52533-7FBF-41FE-A0AF-874FC54300B2}"
EndProject
Expand Down Expand Up @@ -46,22 +46,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Git", "Git", "{17EE3C8D-BAE
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.Providers.VatLayer", "src\ExternalSearch.Providers.VatLayer.csproj", "{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.VatLayer.Integration.Tests", "test\integration\ExternalSearch.VatLayer.Integration.Tests\ExternalSearch.VatLayer.Integration.Tests.csproj", "{DD79FB4E-FB22-41D7-8544-E2947EE6E99C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.VatLayer.Unit.Tests", "test\unit\ExternalSearch.VatLayer.Unit.Tests\ExternalSearch.VatLayer.Unit.Tests.csproj", "{195D0932-EA29-40BF-BBCE-26F7906504B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExternalSearch.Providers.VatLayer", "src\ExternalSearch.Providers.VatLayer\ExternalSearch.Providers.VatLayer.csproj", "{9FD65D12-0D5B-46B7-AE96-1502E4A45E30}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Provider.ExternalSearch.Providers.VatLayer", "src\ExternalSearch.Providers.VatLayer.Provider\Provider.ExternalSearch.Providers.VatLayer.csproj", "{D2B36432-79F7-41AD-90A8-CF34F2E07A33}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541}.Release|Any CPU.Build.0 = Release|Any CPU
{DD79FB4E-FB22-41D7-8544-E2947EE6E99C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD79FB4E-FB22-41D7-8544-E2947EE6E99C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD79FB4E-FB22-41D7-8544-E2947EE6E99C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -70,6 +68,14 @@ Global
{195D0932-EA29-40BF-BBCE-26F7906504B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{195D0932-EA29-40BF-BBCE-26F7906504B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{195D0932-EA29-40BF-BBCE-26F7906504B9}.Release|Any CPU.Build.0 = Release|Any CPU
{9FD65D12-0D5B-46B7-AE96-1502E4A45E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FD65D12-0D5B-46B7-AE96-1502E4A45E30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FD65D12-0D5B-46B7-AE96-1502E4A45E30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FD65D12-0D5B-46B7-AE96-1502E4A45E30}.Release|Any CPU.Build.0 = Release|Any CPU
{D2B36432-79F7-41AD-90A8-CF34F2E07A33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2B36432-79F7-41AD-90A8-CF34F2E07A33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2B36432-79F7-41AD-90A8-CF34F2E07A33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2B36432-79F7-41AD-90A8-CF34F2E07A33}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -82,9 +88,10 @@ Global
{02641789-0D38-4DBB-9288-23592CF55D25} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{2C3AECCF-DCB5-4ED7-8B7B-8F373EDE3A5E} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{17EE3C8D-BAE4-481A-B9CC-1BE878E86124} = {9BD54E81-D9C8-4419-82B8-8EE6CC7E2647}
{BD49FBC7-7E7B-410C-BBB4-F3B0E3293541} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{DD79FB4E-FB22-41D7-8544-E2947EE6E99C} = {DBD1964B-DBD9-4C70-96CA-391C34B3D75F}
{195D0932-EA29-40BF-BBCE-26F7906504B9} = {A32B6852-82C7-4107-8C68-AE9232289E09}
{9FD65D12-0D5B-46B7-AE96-1502E4A45E30} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{D2B36432-79F7-41AD-90A8-CF34F2E07A33} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A61CB42-80C5-4A83-AC3E-DA41FC875525}
Expand Down
16 changes: 6 additions & 10 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
mode: ContinuousDeployment
next-version: 3.2
branches:
master:
mode: ContinuousDelivery
pull-request:
tag: pr
increment: None
develop:
tag: alpha1
# GitVersion.yml
mode: ContinuousDelivery
next-version: 3.3
branches: {}
ignore:
sha: []
15 changes: 6 additions & 9 deletions Packages.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup Label="Dependency Versions">
<_ComponentHost>2.0.0</_ComponentHost>
<_AutoFixture>4.11.0</_AutoFixture>
<_CluedIn>3.2.0-*</_CluedIn>
<_CluedIn>3.3.0-*</_CluedIn>
</PropertyGroup>

<ItemGroup>
<!--
Specified versions for dependencies in test projects
Expand All @@ -23,21 +23,18 @@
<PackageReference Update="Shouldly" Version="3.0.2" />
<PackageReference Update="CluedIn.Testing.Base" Version="$(_CluedIn)" />
</ItemGroup>

<ItemGroup>
<!--
Specified versions for dependencies across the solution
MUST SPECIFY IN CSPROJ AS <PackageReference Name="<depName>" />
-->
<!-- <PackageReference Update="ComponentHost" Version="$(_ComponentHost)" />-->
<!-- <PackageReference Update="CluedIn.Crawling" Version="$(_CluedIn)" />-->
<PackageReference Update="ComponentHost" Version="$(_ComponentHost)" />
<!-- <PackageReference Update="CluedIn.Crawling" Version="$(_CluedIn)" />-->
<PackageReference Update="CluedIn.Core" Version="$(_CluedIn)" />
<!-- <PackageReference Update="CluedIn.Core.Agent" Version="$(_CluedIn)" />-->
<!-- <PackageReference Update="CluedIn.Core.Agent" Version="$(_CluedIn)" />-->
<PackageReference Update="CluedIn.ExternalSearch" Version="$(_CluedIn)" />

</ItemGroup>

<ItemGroup Label="Global tools">
<!--
Automatically added to each project with :
Expand All @@ -48,4 +45,4 @@
-->
<!-- <GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" /> -->
</ItemGroup>
</Project>
</Project>
11 changes: 2 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ variables:

steps:

# Configure NuGet
- pwsh: |
@('develop','release','AzurePipelines') | ForEach-Object{
dotnet nuget update source $_ -p $env:NUGET_KEY -u VssSessionToken --configfile nuget.config
}
condition: and(succeeded(), variables['nuget.key'])
displayName: 'Add api token to access nuget artifacts'
env:
NUGET_KEY: $(nuget.key)
- task: NuGetAuthenticate@0
displayName: 'Authenticate with nuget'

- template: crawler.build.yml@templates
2 changes: 2 additions & 0 deletions docs/3.3.0-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Features
- Implemented Provider Model
20 changes: 0 additions & 20 deletions src/Directory.Build.props

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">


<ItemGroup>
<PackageReference Include="CluedIn.Core" />
<PackageReference Include="ComponentHost" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ExternalSearch.Providers.VatLayer\ExternalSearch.Providers.VatLayer.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Reflection;
using Castle.MicroKernel.Registration;
using CluedIn.Core;
using CluedIn.Core.Providers;
using CluedIn.Core.Server;
using ComponentHost;
using Constants = CluedIn.ExternalSearch.Providers.VatLayer.Constants;

namespace CluedIn.Provider.VatLayer
{
[Component(Constants.ComponentName, "Providers", ComponentType.Service, ServerComponents.ProviderWebApi, Components.Server, Components.DataStores, Isolation = ComponentIsolation.NotIsolated)]
public sealed class VatLayerProviderProviderComponent : ServiceApplicationComponent<IServer>
{
/**********************************************************************************************************
* CONSTRUCTOR
**********************************************************************************************************/

/// <summary>
/// Initializes a new instance of the <see cref="VatLayerProviderProviderComponent" /> class.
/// </summary>
/// <param name="componentInfo">The component information.</param>
public VatLayerProviderProviderComponent(ComponentInfo componentInfo) : base(componentInfo)
{
// Dev. Note: Potential for compiler warning here ... CA2214: Do not call overridable methods in constructors
// this class has been sealed to prevent the CA2214 waring being raised by the compiler
Container.Register(Component.For<VatLayerProviderProviderComponent>().Instance(this));
}

/**********************************************************************************************************
* METHODS
**********************************************************************************************************/

/// <summary>Starts this instance.</summary>
public override void Start()
{
var asm = Assembly.GetAssembly(typeof(VatLayerProviderProviderComponent));
Container.Register(Types.FromAssembly(asm).BasedOn<IProvider>().WithServiceFromInterface().If(t => !t.IsAbstract).LifestyleSingleton());

State = ServiceState.Started;
}

/// <summary>Stops this instance.</summary>
public override void Stop()
{
if (State == ServiceState.Stopped)
return;

State = ServiceState.Stopped;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CluedIn.Core;
using CluedIn.Core.Crawling;
using CluedIn.Core.Data.Relational;
using CluedIn.Core.ExternalSearch;
using CluedIn.Core.Providers;
using CluedIn.Core.Webhooks;
using CluedIn.ExternalSearch;
using CluedIn.ExternalSearch.Providers.VatLayer;
using CluedIn.Providers.Models;
using Constants = CluedIn.ExternalSearch.Providers.VatLayer.Constants;

namespace CluedIn.Provider.VatLayer
{
public class VatLayerSearchProviderProvider : ProviderBase, IExtendedProviderMetadata, IExternalSearchProviderProvider
{
public IExternalSearchProvider ExternalSearchProvider { get; }

public VatLayerSearchProviderProvider([System.Diagnostics.CodeAnalysis.NotNull] ApplicationContext appContext) : base(appContext, GetMetaData())
{
ExternalSearchProvider = appContext.Container.ResolveAll<IExternalSearchProvider>().Single(n => n.Id == Constants.ProviderId);
}

private static IProviderMetadata GetMetaData()
{
return new ProviderMetadata
{
Id = Constants.ProviderId,
Name = Constants.ProviderName,
ComponentName = Constants.ComponentName,
AuthTypes = new List<string>(),
SupportsConfiguration = true,
SupportsAutomaticWebhookCreation = false,
SupportsWebHooks = false,
Type = "Enricher"
};
}

public override async Task<CrawlJobData> GetCrawlJobData(ProviderUpdateContext context, IDictionary<string, object> configuration, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));

var result = new VatLayerExternalSearchJobData(configuration);

return await Task.FromResult(result);
}

public override Task<bool> TestAuthentication(ProviderUpdateContext context, IDictionary<string, object> configuration, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
return Task.FromResult(true);
}

public override Task<ExpectedStatistics> FetchUnSyncedEntityStatistics(Core.ExecutionContext context, IDictionary<string, object> configuration, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
throw new NotImplementedException();
}


public override async Task<IDictionary<string, object>> GetHelperConfiguration(ProviderUpdateContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
if (jobData is VatLayerExternalSearchJobData result)
{
return await Task.FromResult(result.ToDictionary());
}

throw new InvalidOperationException($"Unexpected data type for {nameof(VatLayerExternalSearchJobData)}, {jobData.GetType()}");
}

public override Task<IDictionary<string, object>> GetHelperConfiguration(ProviderUpdateContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId, string folderId)
{
return GetHelperConfiguration(context, jobData, organizationId, userId, providerDefinitionId);
}

public override Task<AccountInformation> GetAccountInformation(Core.ExecutionContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
return Task.FromResult(new AccountInformation(providerDefinitionId.ToString(), providerDefinitionId.ToString()));
}

public override string Schedule(DateTimeOffset relativeDateTime, bool webHooksEnabled)
{
return $"{relativeDateTime.Minute} 0/23 * * *";
}

public override Task<IEnumerable<WebHookSignature>> CreateWebHook(Core.ExecutionContext context, CrawlJobData jobData, IWebhookDefinition webhookDefinition, IDictionary<string, object> config)
{
throw new NotImplementedException();
}

public override Task<IEnumerable<WebhookDefinition>> GetWebHooks(Core.ExecutionContext context)
{
throw new NotImplementedException();
}

public override Task DeleteWebHook(Core.ExecutionContext context, CrawlJobData jobData, IWebhookDefinition webhookDefinition)
{
throw new NotImplementedException();
}

public override Task<CrawlLimit> GetRemainingApiAllowance(Core.ExecutionContext context, CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
if (jobData == null) throw new ArgumentNullException(nameof(jobData));
return Task.FromResult(new CrawlLimit(-1, TimeSpan.Zero));
}

public override IEnumerable<string> WebhookManagementEndpoints(IEnumerable<string> ids)
{
throw new NotImplementedException();
}

public string Icon { get; } = Constants.Icon;
public string Domain { get; } = Constants.Domain;
public string About { get; } = Constants.About;
public AuthMethods AuthMethods { get; } = Constants.AuthMethods;
public IEnumerable<Control> Properties { get; } = Constants.Properties;
public Guide Guide { get; } = Constants.Guide;
public new IntegrationType Type { get; } = Constants.IntegrationType;
}
}
Loading

0 comments on commit b6f8258

Please sign in to comment.