Skip to content

Commit

Permalink
Merge branch 'release/3.803.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed May 16, 2024
2 parents 487b16b + fe0604e commit 158b6cb
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 57 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.4
# https://virtocommerce.atlassian.net/browse/VCST-488
# v3.800.6
# https://virtocommerce.atlassian.net/browse/VCST-915
name: Module CI

on:
Expand All @@ -15,10 +15,10 @@ on:
- '**/cloudDeploy.json'
- samples/**
branches:
[master, dev]
[master, main, dev]
pull_request:
branches:
[master, dev]
[master, main, dev]
paths-ignore:
- 'docs/**'
- 'build/**'
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
java-version: '17'

- name: Set RELEASE_STATUS
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: |
echo "RELEASE_STATUS=true" >> $GITHUB_ENV
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.suffix }}" >> $GITHUB_ENV
fi;
- name: Add version suffix
if: ${{ github.ref != 'refs/heads/master' }}
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
uses: VirtoCommerce/vc-github-actions/add-version-suffix@master
with:
versionSuffix: ${{ env.VERSION_SUFFIX }}
Expand Down Expand Up @@ -128,11 +128,11 @@ jobs:
run: vc-build Compress -skip Clean+Restore+Compile+Test

- name: Publish Nuget
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
uses: VirtoCommerce/vc-github-actions/publish-nuget@master

- name: Publish to Blob
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main') }}
id: blobRelease
uses: VirtoCommerce/vc-github-actions/publish-blob-release@master
with:
Expand All @@ -157,7 +157,7 @@ jobs:
downloadComment: 'Artifact URL:'

- name: Publish Github Release
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
id: githubRelease
with:
changelog: ${{ steps.changelog.outputs.changelog }}
Expand All @@ -167,14 +167,14 @@ jobs:
- name: Set artifactUrl value
id: artifactUrl
run: |
if [ '${{ github.ref }}' = 'refs/heads/master' ]; then
if [ '${{ github.ref }}' = 'refs/heads/master' ] || [ '${{ github.ref }}' = 'refs/heads/main' ]; then
echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT
else
echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT
fi;
- name: Create deployment matrix
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'}}
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master
id: deployment-matrix
with:
Expand All @@ -192,13 +192,13 @@ jobs:
fi
- name: Setup Git Credentials
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }}
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
with:
githubToken: ${{ secrets.REPO_TOKEN }}

- name: Publish Manifest
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }}
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
uses: VirtoCommerce/vc-github-actions/publish-manifest@master
with:
packageUrl: ${{ steps.artifactUrl.outputs.download_url }}
Expand Down Expand Up @@ -241,7 +241,8 @@ jobs:
if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) ||
(github.event_name == 'workflow_dispatch')}}
needs: 'ci'
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.6

with:
katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon'
katalonRepoBranch: 'dev'
Expand All @@ -257,11 +258,9 @@ jobs:
katalonApiKey: ${{ secrets.KATALON_API_KEY }}

deploy-cloud:
if: ${{ ((github.ref == 'refs/heads/master') ||
(github.ref == 'refs/heads/dev')) &&
github.event_name == 'push' }}
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
needs: ci
uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.800.6
with:
releaseSource: module
moduleId: ${{ needs.ci.outputs.moduleId }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/module-release-hotfix.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.4
# https://virtocommerce.atlassian.net/browse/VCST-488
# v3.800.6
# https://virtocommerce.atlassian.net/browse/VCST-915
name: Release hotfix

on:
Expand All @@ -13,12 +13,12 @@ on:

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.6
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.6
with:
uploadPackage: 'true'
uploadDocker: 'false'
Expand Down Expand Up @@ -46,11 +46,12 @@ jobs:
publish-github-release:
needs:
[build, test, get-metadata]
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.6
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
changeLog: '${{ needs.get-metadata.outputs.changeLog }}'
incrementPatch: ${{ github.event.inputs.incrementPatch }}
makeLatest: 'false'

secrets:
envPAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-nugets.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.4
# https://virtocommerce.atlassian.net/browse/VCST-488
# v3.800.6
# https://virtocommerce.atlassian.net/browse/VCST-915
name: Publish nuget

on:
Expand All @@ -13,12 +13,12 @@ on:

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.6
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.6
with:
uploadPackage: 'true'
uploadDocker: 'false'
Expand All @@ -29,7 +29,7 @@ jobs:
publish-nuget:
needs:
[build, test]
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.6
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
forceGithub: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# v3.800.4
# https://virtocommerce.atlassian.net/browse/VCST-488
# v3.800.6
# https://virtocommerce.atlassian.net/browse/VCST-915
name: Release

on:
workflow_dispatch:

jobs:
release:
uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.800.4
uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.800.6
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.802.0</VersionPrefix>
<VersionPrefix>3.803.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.801.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.825.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<noWarn>NU5104</noWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-beta.2" />
<PackageReference Include="VirtoCommerce.Platform.Data.MySql" Version="3.825.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.SubscriptionModule.Data\VirtoCommerce.SubscriptionModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageReference Include="VirtoCommerce.Platform.Data.PostgreSql" Version="3.825.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.SubscriptionModule.Data\VirtoCommerce.SubscriptionModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="VirtoCommerce.Platform.Data.SqlServer" Version="3.825.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtoCommerce.SubscriptionModule.Data\VirtoCommerce.SubscriptionModule.Data.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -21,16 +22,20 @@ public class SendNotificationsSubscriptionChangedEventHandler : IEventHandler<Su
private readonly INotificationSearchService _notificationSearchService;
private readonly INotificationSender _notificationSender;
private readonly IStoreService _storeService;
private readonly UserManager<ApplicationUser> _userManager;
private readonly Func<UserManager<ApplicationUser>> _userManagerFactory;
private readonly IMemberService _memberService;

public SendNotificationsSubscriptionChangedEventHandler(INotificationSearchService notificationSearchService, INotificationSender notificationSender,
IStoreService storeService, UserManager<ApplicationUser> userManager, IMemberService memberService)
public SendNotificationsSubscriptionChangedEventHandler(
INotificationSearchService notificationSearchService,
INotificationSender notificationSender,
IStoreService storeService,
Func<UserManager<ApplicationUser>> userManagerFactory,
IMemberService memberService)
{
_notificationSearchService = notificationSearchService;
_notificationSender = notificationSender;
_storeService = storeService;
_userManager = userManager;
_userManagerFactory = userManagerFactory;
_memberService = memberService;
}

Expand Down Expand Up @@ -114,7 +119,8 @@ protected virtual Task<string> GetSubscriptionOrderEmailAsync(Subscription subsc
protected virtual async Task<string> GetCustomerEmailAsync(string customerId)
{
// try to find user
var user = await _userManager.FindByIdAsync(customerId);
using var userManager = _userManagerFactory();
var user = await userManager.FindByIdAsync(customerId);

// Try to find contact
var contact = await _memberService.GetByIdAsync(customerId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CustomerModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.NotificationsModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Platform.Data" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Platform.Data" Version="3.825.0" />
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.825.0" />
<PackageReference Include="VirtoCommerce.StoreModule.Core" Version="3.800.0" />
</ItemGroup>
</Project>
16 changes: 7 additions & 9 deletions src/VirtoCommerce.SubscriptionModule.Web/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using VirtoCommerce.NotificationsModule.Core.Services;
using VirtoCommerce.NotificationsModule.TemplateLoader.FileSystem;
using VirtoCommerce.OrdersModule.Core.Events;
using VirtoCommerce.Platform.Core.Bus;
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.Events;
using VirtoCommerce.Platform.Core.ExportImport;
using VirtoCommerce.Platform.Core.Modularity;
using VirtoCommerce.Platform.Core.Security;
Expand Down Expand Up @@ -71,8 +71,7 @@ public void Initialize(IServiceCollection serviceCollection)

serviceCollection.AddSingleton<CreateSubscriptionOrderChangedEventHandler>();
serviceCollection.AddSingleton<LogChangesSubscriptionChangedEventHandler>();
//Register as scoped because we use UserManager<> as dependency in this implementation
serviceCollection.AddScoped<SendNotificationsSubscriptionChangedEventHandler>();
serviceCollection.AddSingleton<SendNotificationsSubscriptionChangedEventHandler>();

serviceCollection.AddSingleton<SubscriptionExportImport>();

Expand All @@ -94,14 +93,13 @@ public void PostInitialize(IApplicationBuilder appBuilder)
settingsRegistrar.RegisterSettingsForType(ModuleConstants.Settings.StoreLevelSettings, nameof(Store));

//Registration welcome email notification.
var handlerRegistrar = appBuilder.ApplicationServices.GetRequiredService<IHandlerRegistrar>();
handlerRegistrar.RegisterHandler<OrderChangedEvent>(async (message, _) => await appBuilder.ApplicationServices.GetRequiredService<CreateSubscriptionOrderChangedEventHandler>().Handle(message));
handlerRegistrar.RegisterHandler<OrderChangedEvent>(async (message, _) => await appBuilder.ApplicationServices.GetRequiredService<LogChangesSubscriptionChangedEventHandler>().Handle(message));
handlerRegistrar.RegisterHandler<SubscriptionChangedEvent>(async (message, _) => await appBuilder.ApplicationServices.GetRequiredService<LogChangesSubscriptionChangedEventHandler>().Handle(message));
handlerRegistrar.RegisterHandler<SubscriptionChangedEvent>(async (message, _) => await appBuilder.ApplicationServices.CreateScope().ServiceProvider.GetRequiredService<SendNotificationsSubscriptionChangedEventHandler>().Handle(message));
appBuilder.RegisterEventHandler<OrderChangedEvent, CreateSubscriptionOrderChangedEventHandler>();
appBuilder.RegisterEventHandler<OrderChangedEvent, LogChangesSubscriptionChangedEventHandler>();
appBuilder.RegisterEventHandler<SubscriptionChangedEvent, LogChangesSubscriptionChangedEventHandler>();
appBuilder.RegisterEventHandler<SubscriptionChangedEvent, SendNotificationsSubscriptionChangedEventHandler>();

//Subscribe for subscription processing job configuration changes
handlerRegistrar.RegisterHandler<ObjectSettingChangedEvent>(async (message, _) => await appBuilder.ApplicationServices.GetService<ObjectSettingEntryChangedEventHandler>().Handle(message));
appBuilder.RegisterEventHandler<ObjectSettingChangedEvent, ObjectSettingEntryChangedEventHandler>();

//Schedule periodic subscription processing job
var jobsRunner = appBuilder.ApplicationServices.GetService<BackgroundJobsRunner>();
Expand Down
4 changes: 2 additions & 2 deletions src/VirtoCommerce.SubscriptionModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<id>VirtoCommerce.Subscription</id>
<version>3.802.0</version>
<version>3.803.0</version>
<version-tag />

<platformVersion>3.800.0</platformVersion>
<platformVersion>3.825.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Core" version="3.800.0" />
<dependency id="VirtoCommerce.Customer" version="3.800.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<noWarn>1591</noWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 158b6cb

Please sign in to comment.