diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index e72c9bc..759189f 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -23,19 +23,20 @@ jobs: versionSuffix: ${{ github.ref == 'refs/heads/develop' && 'pre-' || 'ci-' }}${{github.RUN_NUMBER }} steps: - name: Checkout repository - uses: actions/checkout@v1 - - name: Setup .NET Core @ Latest - uses: actions/setup-dotnet@v1 + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 with: + dotnet-version: '7.0.x' source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - + - name: Restore run: dotnet restore - name: Build (Release version) if: ${{ github.ref == 'refs/heads/main' }} - run: dotnet build --no-restore --configuration $env:buildConfiguration + run: dotnet build --no-restore --configuration $env:buildConfiguration - name: Build (Pre-Release version) if: ${{ github.ref != 'refs/heads/main' }} run: dotnet build --no-restore --configuration $env:buildConfiguration --version-suffix $env:versionSuffix diff --git a/.github/workflows/ci-service.yml b/.github/workflows/ci-service.yml index b46d7c5..f28a1f5 100644 --- a/.github/workflows/ci-service.yml +++ b/.github/workflows/ci-service.yml @@ -10,7 +10,7 @@ on: # - 'src/EPiServer.Search.IndexingService/**' # - 'test/EPiServer.Search.IndexingService.Test/**' # - 'docker-compose.yml' - + jobs: build_test_pack: name: Build, test & push image @@ -23,9 +23,11 @@ jobs: IMAGE_NAME: ${{ github.repository }} steps: - name: Checkout repository - uses: actions/checkout@v1 - - name: Setup .NET Core @ Latest - uses: actions/setup-dotnet@v1 + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0.x' - name: Restore run: dotnet restore - name: Test diff --git a/.gitignore b/.gitignore index 3cde79f..ff4cc4f 100644 --- a/.gitignore +++ b/.gitignore @@ -179,4 +179,5 @@ EPiServer.Search.Cms.zip sample/AlloyMvcTemplate/App_Data/** sample/AlloyMvcTemplate/App_Code/** /nupkgs -/modules \ No newline at end of file +/modules +.idea diff --git a/Directory.Build.props b/Directory.Build.props index bc92b93..5b74807 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,9 +2,8 @@ - net5.0 - 9.0 - true + net6.0 + latest false true true diff --git a/build/dependencies.props b/build/dependencies.props index 08a3170..4d54213 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,14 +1,15 @@ - 12.5.0 - [12.5.0,13) + [12.17.1,13) + [12.13.1,13) + [12.17.1,13) 4.8.0-beta00015 - + - - + + diff --git a/build/version.props b/build/version.props index f6263bd..b3322a2 100644 --- a/build/version.props +++ b/build/version.props @@ -1,8 +1,8 @@ - 10.0.0 + 10.1.0 - \ No newline at end of file + diff --git a/docker-compose.yml b/docker-compose.yml index 1a575ca..d61c7ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,17 +4,17 @@ services: search: build: dockerfile: ./src/EPiServer.Search.IndexingService/Search.Dockerfile - context: . + context: . environment: ASPNETCORE_URLS: http://*:80 ASPNETCORE_ENVIRONMENT: Production - + ports: - 5000:80 image: episerver.search.indexingservice:latest - container_name: EPiServer.Search.IndexingService + container_name: EPiServer.Search.IndexingService volumes: - shared-folder:/app/App_Data volumes: - shared-folder: \ No newline at end of file + shared-folder: diff --git a/global.json b/global.json index 4ba0352..36e1a9e 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "6.0.100", - "architecture": "x64", - "rollForward": "minor" + "version": "7.0.0", + "rollForward": "latestMajor", + "allowPrerelease": false } -} +} \ No newline at end of file diff --git a/sample/AlloyMvcTemplate/AlloyMvcTemplates.csproj b/sample/AlloyMvcTemplate/AlloyMvcTemplates.csproj index 43e26c1..7996936 100644 --- a/sample/AlloyMvcTemplate/AlloyMvcTemplates.csproj +++ b/sample/AlloyMvcTemplate/AlloyMvcTemplates.csproj @@ -1,15 +1,14 @@ - - net6.0 + net7.0 NU5100 - - - + + + diff --git a/src/EPiServer.Search.Cms/EPiServer.Search.Cms.csproj b/src/EPiServer.Search.Cms/EPiServer.Search.Cms.csproj index 28f84c7..0754c17 100644 --- a/src/EPiServer.Search.Cms/EPiServer.Search.Cms.csproj +++ b/src/EPiServer.Search.Cms/EPiServer.Search.Cms.csproj @@ -2,7 +2,6 @@ net6.0 - diff --git a/src/EPiServer.Search.Cms/Job/IndexingJob.cs b/src/EPiServer.Search.Cms/Job/IndexingJob.cs index 9c4f1c7..f536f92 100644 --- a/src/EPiServer.Search.Cms/Job/IndexingJob.cs +++ b/src/EPiServer.Search.Cms/Job/IndexingJob.cs @@ -1,3 +1,5 @@ +using System; +using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.PlugIn; using EPiServer.ServiceLocation; @@ -31,7 +33,11 @@ public IndexingJob(IIndexingJobService indexingJobService) /// /// Executes the specified context. /// - public override string Execute() => _indexingJobService.Start(OnStatusChanged); + public override string Execute() + { + using var contentCacheScope = new ContentCacheScope { SlidingExpiration = TimeSpan.Zero }; + return _indexingJobService.Start(OnStatusChanged); + } /// /// Stops the indexing job. diff --git a/src/EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj b/src/EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj index 9672a41..aa17496 100644 --- a/src/EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj +++ b/src/EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj @@ -1,13 +1,13 @@  - net6.0 + net7.0 - - - - + + + + diff --git a/src/EPiServer.Search.IndexingService/Search.Dockerfile b/src/EPiServer.Search.IndexingService/Search.Dockerfile index a77e906..9839872 100644 --- a/src/EPiServer.Search.IndexingService/Search.Dockerfile +++ b/src/EPiServer.Search.IndexingService/Search.Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS base WORKDIR /app EXPOSE 8000 -FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build +FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim AS build WORKDIR /src COPY ["src/EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj", "EPiServer.Search.IndexingService/"] RUN dotnet restore "EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj" @@ -11,7 +11,7 @@ COPY ["src/EPiServer.Search.IndexingService/", "EPiServer.Search.IndexingService RUN dotnet build "EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj" -c Release -o /app/build FROM build AS publish -RUN dotnet publish "EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj" -c Release -o /app/publish +RUN dotnet publish "EPiServer.Search.IndexingService/EPiServer.Search.IndexingService.csproj" -c Release -o /app/publish --framework net7.0 FROM base AS final WORKDIR /app diff --git a/test/EPiServer.Search.Cms.Test/Core/ContentSearchHandlerTests.cs b/test/EPiServer.Search.Cms.Test/Core/ContentSearchHandlerTests.cs index 6527fc0..938f63a 100644 --- a/test/EPiServer.Search.Cms.Test/Core/ContentSearchHandlerTests.cs +++ b/test/EPiServer.Search.Cms.Test/Core/ContentSearchHandlerTests.cs @@ -100,7 +100,7 @@ public void Dispose() public void UpdateItem_WhenContentIsProvided_ShouldUseContentGuidAndLanguageAsId() { var sharedBlockCreator = new SharedBlockFactory(null, new ConstructorParameterResolver(), - new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver())))); + new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver()))), _contentTypeRepositoryMock.Object); _testSubject.ServiceActive = true; var block = sharedBlockCreator.CreateSharedBlock(typeof(BlockData)); @@ -119,7 +119,7 @@ public void UpdateItem_WhenContentIsProvided_ShouldUseContentGuidAndLanguageAsId public void UpdateItem_WhenContentIsProvided_ShouldUseNameAsTitle() { var sharedBlockCreator = new SharedBlockFactory(null, new ConstructorParameterResolver(), - new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver())))); + new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver()))), _contentTypeRepositoryMock.Object); _testSubject.ServiceActive = true; var block = sharedBlockCreator.CreateSharedBlock(typeof(BlockData)); @@ -427,7 +427,7 @@ public void GetSearchResult_WhenQueryIsExecuted_ShouldUseSuppliedExpression() public void GetSearchResult_WhenQueryIsExecuted_ContentQueryShouldBeAdded() { var sharedBlockCreator = new SharedBlockFactory(null, new ConstructorParameterResolver(), - new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver())))); + new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver()))), _contentTypeRepositoryMock.Object); var content = sharedBlockCreator.CreateSharedBlock(typeof(BlockData)); content.ContentLink = new ContentReference(1); _contentRepositoryMock.Setup(r => r.Get(It.IsAny())).Returns(content); @@ -456,7 +456,7 @@ public void GetSearchResult_WhenQueryIsExecuted_CurrentUserShouldBeAddedToAcl() .Callback((q, p, o) => { q.AddUser(p.Identity.Name); }); var sharedBlockCreator = new SharedBlockFactory(null, new ConstructorParameterResolver(), - new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver())))); + new ServiceLocation.ServiceAccessor(() => new ContentDataInterceptor(new ContentDataInterceptorHandler(new ConstructorParameterResolver()))), _contentTypeRepositoryMock.Object); var content = sharedBlockCreator.CreateSharedBlock(typeof(BlockData)); content.ContentLink = new ContentReference(1); _contentRepositoryMock.Setup(r => r.Get(It.IsAny())).Returns(content); diff --git a/test/EPiServer.Search.Cms.Test/EPiServer.Search.Cms.Test.csproj b/test/EPiServer.Search.Cms.Test/EPiServer.Search.Cms.Test.csproj index 191ed2e..8219588 100644 --- a/test/EPiServer.Search.Cms.Test/EPiServer.Search.Cms.Test.csproj +++ b/test/EPiServer.Search.Cms.Test/EPiServer.Search.Cms.Test.csproj @@ -7,14 +7,14 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/EPiServer.Search.IndexingService.Test/EPiServer.Search.IndexingService.Test.csproj b/test/EPiServer.Search.IndexingService.Test/EPiServer.Search.IndexingService.Test.csproj index 7319a5c..438b99b 100644 --- a/test/EPiServer.Search.IndexingService.Test/EPiServer.Search.IndexingService.Test.csproj +++ b/test/EPiServer.Search.IndexingService.Test/EPiServer.Search.IndexingService.Test.csproj @@ -1,21 +1,21 @@ - net6.0 + net7.0 false - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all