diff --git a/.github/labeler.yml b/.github/labeler.yml
index 738b727317..2dded9549b 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -1,4 +1,7 @@
ui-angular:
+ - npm/ng-packs/*
- npm/ng-packs/**/*
+ - templates/app/angular/*
- templates/app/angular/**/*
+ - templates/module/angular/*
- templates/module/angular/**/*
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index e70e966d4a..2796d177d1 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -1,17 +1,12 @@
-name: "Pull Request Labeler"
+name: Pull request labeler
on:
- pull_request:
- paths:
- - npm/ng-packs/**/*
- - templates/app/angular/**/*
- - templates/module/angular/**/*
- branches:
- - master
- - dev
+ schedule:
+ - cron: '0 */1 * * *'
jobs:
labeler:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- - uses: actions/labeler@v2
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ - uses: paulfantom/periodic-labeler@master
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_REPOSITORY: ${{ github.repository }}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
index 46f3d32d6a..37a9f54748 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
+++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
@@ -19,6 +19,8 @@
+
+
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
index 36dc044177..a47a865617 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
@@ -54,6 +54,12 @@ namespace Volo.Abp.Cli.Commands
private async Task InstallSuiteAsync()
{
var nugetIndexUrl = await GetNuGetIndexUrlAsync();
+
+ if (nugetIndexUrl == null)
+ {
+ return;
+ }
+
var result = CmdHelper.RunCmd("dotnet tool install " + SuitePackageName + " --add-source " + nugetIndexUrl + " -g");
if (result == 0)
@@ -66,6 +72,12 @@ namespace Volo.Abp.Cli.Commands
private async Task UpdateSuiteAsync()
{
var nugetIndexUrl = await GetNuGetIndexUrlAsync();
+
+ if (nugetIndexUrl == null)
+ {
+ return;
+ }
+
CmdHelper.RunCmd("dotnet tool update " + SuitePackageName + " --add-source " + nugetIndexUrl + " -g");
}
@@ -95,8 +107,8 @@ namespace Volo.Abp.Cli.Commands
private async Task GetNuGetIndexUrlAsync()
{
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
- if (apiKeyResult == null ||
- string.IsNullOrEmpty(apiKeyResult.ApiKey))
+
+ if (apiKeyResult == null || string.IsNullOrEmpty(apiKeyResult.ApiKey))
{
Logger.LogError("Couldn't retrieve your NuGet API key!");
Logger.LogWarning(File.Exists(CliPaths.AccessToken)
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs
index c8f221b73c..1b9539d012 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/AbpIoApiKeyService.cs
@@ -1,5 +1,12 @@
using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Http;
using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
+using Polly;
+using Polly.Extensions.Http;
using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.ProjectBuilding;
using Volo.Abp.DependencyInjection;
@@ -10,22 +17,45 @@ namespace Volo.Abp.Cli.Licensing
public class AbpIoApiKeyService : IApiKeyService, ITransientDependency
{
protected IJsonSerializer JsonSerializer { get; }
-
protected IRemoteServiceExceptionHandler RemoteServiceExceptionHandler { get; }
+ private readonly ILogger _logger;
- public AbpIoApiKeyService(IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler)
+ public AbpIoApiKeyService(IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, ILogger logger)
{
JsonSerializer = jsonSerializer;
RemoteServiceExceptionHandler = remoteServiceExceptionHandler;
+ _logger = logger;
}
public async Task GetApiKeyOrNullAsync()
{
using (var client = new CliHttpClient())
{
- var url = $"{CliUrls.WwwAbpIo}api/license/api-key";
-
- var response = await client.GetAsync(url);
+ var response = await HttpPolicyExtensions
+ .HandleTransientHttpError()
+ .OrResult(msg => !msg.IsSuccessStatusCode)
+ .WaitAndRetryAsync(new[]
+ {
+ TimeSpan.FromSeconds(1),
+ TimeSpan.FromSeconds(3),
+ TimeSpan.FromSeconds(7)
+ },
+ (responseMessage, timeSpan, retryCount, context) =>
+ {
+ if (responseMessage.Exception != null)
+ {
+ _logger.LogWarning(
+ $"{retryCount}. request attempt failed with an error: \"{responseMessage.Exception.Message}\". " +
+ $"Waiting {timeSpan.TotalSeconds} secs for the next try...");
+ }
+ else if (responseMessage.Result != null)
+ {
+ _logger.LogWarning(
+ $"{retryCount}. request attempt failed with {responseMessage.Result.StatusCode}-{responseMessage.Result.ReasonPhrase}. " +
+ $"Waiting {timeSpan.TotalSeconds} secs for the next try...");
+ }
+ })
+ .ExecuteAsync(async () => await client.GetAsync($"{CliUrls.WwwAbpIo}api/license/api-key"));
if (!response.IsSuccessStatusCode)
{
diff --git a/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts b/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts
index bcd226c941..a07b613b44 100644
--- a/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts
+++ b/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts
@@ -50,14 +50,7 @@ export class ConfigPlugin implements NgxsPlugin {
}
function transformRoutes(routes: Routes = [], wrappers: ABP.FullRoute[] = []): any {
- // TODO: remove in v1
- const oldAbpRoutes: ABP.FullRoute[] = routes
- .filter(route => {
- return snq(() => route.data.routes.routes.find(r => r.path === route.path), false);
- })
- .reduce((acc, val) => [...acc, ...val.data.routes.routes], []);
- // tslint:disable-next-line: deprecation
- const abpRoutes = [...getAbpRoutes(), ...oldAbpRoutes];
+ const abpRoutes = [...getAbpRoutes()];
wrappers = abpRoutes.filter(ar => ar.wrapper);
const transformed = [] as ABP.FullRoute[];
@@ -89,8 +82,7 @@ function transformRoutes(routes: Routes = [], wrappers: ABP.FullRoute[] = []): a
function setUrls(routes: ABP.FullRoute[], parentUrl?: string): ABP.FullRoute[] {
if (parentUrl) {
- // this if block using for only recursive call
-
+ // recursive block
return routes.map(route => ({
...route,
url: `${parentUrl}/${route.path}`,