From 0aeed53bb8fb28aef7618dff08b6eff0bb85485b Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Wed, 23 Aug 2023 12:05:53 +0200 Subject: [PATCH 1/7] [link-adf:dev-eromano-AAE-12501-2][affected:*][ci:force] From 1fd91fe823a202ea5ca595b756709ba19dfd1f05 Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Mon, 4 Sep 2023 16:54:49 +0200 Subject: [PATCH 2/7] temporary continue workflow execution if unit tests fail to check if e2es pass --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 20f7d81381..62c8f88992 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -77,6 +77,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} unit-tests: + continue-on-error: true needs: [lint, build] name: "Unit tests: ${{ matrix.unit-tests.name }}" runs-on: ubuntu-latest From 03e4dcbfdb0eee5becac0fafa0e4f82cf349a752 Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Tue, 5 Sep 2023 15:14:47 +0200 Subject: [PATCH 3/7] [AAE-12502] Fix failed unit tests caused by https://github.com/Alfresco/alfresco-ng2-components/pull/8689 --- .../ms-office/src/aos-extension.service.spec.ts | 8 ++++++-- .../components/context-menu/context-menu.service.spec.ts | 9 +++++++-- .../document-base-page/document-base-page.spec.ts | 4 +++- .../src/lib/services/app.extension.service.spec.ts | 4 ++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/projects/aca-content/ms-office/src/aos-extension.service.spec.ts b/projects/aca-content/ms-office/src/aos-extension.service.spec.ts index 2dccd84951..3415f80eb8 100644 --- a/projects/aca-content/ms-office/src/aos-extension.service.spec.ts +++ b/projects/aca-content/ms-office/src/aos-extension.service.spec.ts @@ -24,9 +24,10 @@ import { TestBed } from '@angular/core/testing'; import { AosEditOnlineService } from './aos-extension.service'; -import { AppConfigService, AuthenticationService, LogService, NotificationService } from '@alfresco/adf-core'; +import { AppConfigService, AuthenticationService, LogService, NotificationService, RedirectAuthService } from '@alfresco/adf-core'; import { LibTestingModule } from '@alfresco/aca-shared'; import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { EMPTY } from 'rxjs'; describe('AosEditOnlineService', () => { let aosEditOnlineService: AosEditOnlineService; @@ -38,7 +39,10 @@ describe('AosEditOnlineService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LibTestingModule, MatSnackBarModule], - providers: [{ provide: LogService, useValue: { error() {} } }] + providers: [ + { provide: LogService, useValue: { error() {} } }, + { provide: RedirectAuthService, useValue: { onLogin: EMPTY } } + ] }); aosEditOnlineService = TestBed.inject(AosEditOnlineService); diff --git a/projects/aca-content/src/lib/components/context-menu/context-menu.service.spec.ts b/projects/aca-content/src/lib/components/context-menu/context-menu.service.spec.ts index dadaf3e4ab..a5858176c6 100644 --- a/projects/aca-content/src/lib/components/context-menu/context-menu.service.spec.ts +++ b/projects/aca-content/src/lib/components/context-menu/context-menu.service.spec.ts @@ -27,7 +27,7 @@ import { Overlay } from '@angular/cdk/overlay'; import { Injector } from '@angular/core'; import { Store } from '@ngrx/store'; import { of } from 'rxjs'; -import { CoreModule, UserPreferencesService } from '@alfresco/adf-core'; +import { AuthenticationService, CoreModule, UserPreferencesService } from '@alfresco/adf-core'; import { ContextMenuService } from './context-menu.service'; import { TranslateModule } from '@ngx-translate/core'; import { ContextMenuComponent } from './context-menu.component'; @@ -52,7 +52,12 @@ describe('ContextMenuService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent], - providers: [Overlay, { provide: Store, useValue: { select: () => of() } }, UserPreferencesService] + providers: [ + Overlay, + { provide: Store, useValue: { select: () => of() } }, + { provide: AuthenticationService, useValue: { getToken: () => 'fake token' } }, + UserPreferencesService + ] }); injector = TestBed.inject(Injector); diff --git a/projects/aca-shared/src/lib/components/document-base-page/document-base-page.spec.ts b/projects/aca-shared/src/lib/components/document-base-page/document-base-page.spec.ts index 47817c536d..4b38824ad3 100644 --- a/projects/aca-shared/src/lib/components/document-base-page/document-base-page.spec.ts +++ b/projects/aca-shared/src/lib/components/document-base-page/document-base-page.spec.ts @@ -32,7 +32,7 @@ import { Store, StoreModule } from '@ngrx/store'; import { Component, Injectable } from '@angular/core'; import { DiscoveryApiService, DocumentListComponent } from '@alfresco/adf-content-services'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; -import { MaterialModule, PipeModule } from '@alfresco/adf-core'; +import { AuthenticationService, MaterialModule, PipeModule } from '@alfresco/adf-core'; import { HttpClientModule } from '@angular/common/http'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -151,6 +151,7 @@ describe('PageComponent', () => { ) } }, + { provide: AuthenticationService, useValue: { getToken: () => 'fake token' } }, AppExtensionService ] }); @@ -315,6 +316,7 @@ describe('Info Drawer state', () => { ) } }, + { provide: AuthenticationService, useValue: { getToken: () => 'fake token' } }, provideMockStore({ initialState: { app: appState } }) diff --git a/projects/aca-shared/src/lib/services/app.extension.service.spec.ts b/projects/aca-shared/src/lib/services/app.extension.service.spec.ts index e934155d32..b778ebca7b 100644 --- a/projects/aca-shared/src/lib/services/app.extension.service.spec.ts +++ b/projects/aca-shared/src/lib/services/app.extension.service.spec.ts @@ -38,7 +38,7 @@ import { ExtensionConfig, NavBarGroupRef } from '@alfresco/adf-extensions'; -import { AppConfigService, LogService } from '@alfresco/adf-core'; +import { AppConfigService, AuthenticationService, LogService } from '@alfresco/adf-core'; import { provideMockStore } from '@ngrx/store/testing'; import { hasQuickShareEnabled } from '@alfresco/aca-shared/rules'; import { MatIconRegistry } from '@angular/material/icon'; @@ -56,7 +56,7 @@ describe('AppExtensionService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LibTestingModule], - providers: [provideMockStore({ initialState })] + providers: [{ provide: AuthenticationService, useValue: { getToken: () => 'fake token' } }, provideMockStore({ initialState })] }); iconRegistry = TestBed.inject(MatIconRegistry); From a90cb32493d65665d69f8402524adfe656cc597c Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Tue, 5 Sep 2023 15:33:59 +0200 Subject: [PATCH 4/7] Revert "temporary continue workflow execution if unit tests fail to check if e2es pass" This reverts commit 3cc4413664f4a7e9a9ba3a88d2acd62c20d3d36e. --- .github/workflows/pull-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 62c8f88992..20f7d81381 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -77,7 +77,6 @@ jobs: aws-region: ${{ env.AWS_REGION }} unit-tests: - continue-on-error: true needs: [lint, build] name: "Unit tests: ${{ matrix.unit-tests.name }}" runs-on: ubuntu-latest From 9d595c67e9ecbcc51aee8392b8aee3e43293789f Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Tue, 5 Sep 2023 15:35:14 +0200 Subject: [PATCH 5/7] [AAE-12502] Import AuthModule to fix BCs caused by https://github.com/Alfresco/alfresco-ng2-components/pull/8689 --- app/src/app/app.module.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/app/app.module.ts b/app/src/app/app.module.ts index 0f1fdb390e..6f1906c707 100644 --- a/app/src/app/app.module.ts +++ b/app/src/app/app.module.ts @@ -26,7 +26,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard } from '@alfresco/adf-core'; +import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard, AuthModule } from '@alfresco/adf-core'; import { AppService } from '@alfresco/aca-shared'; import { AppExtensionsModule } from './extensions.module'; @@ -102,7 +102,8 @@ registerLocaleData(localeSv); ShellModule.withRoutes({ shellChildren: [CONTENT_LAYOUT_ROUTES] }), - ContentServiceExtensionModule + ContentServiceExtensionModule, + AuthModule.forRoot({ useHash: true }) ], providers: [ { provide: AppService, useClass: AppService }, From 3abf4735cede2679176b9dfa2e1aaaa0e40bcb51 Mon Sep 17 00:00:00 2001 From: Amedeo Lepore Date: Mon, 11 Sep 2023 11:40:58 +0200 Subject: [PATCH 6/7] Exclude test C286473 that's failing becuase is running logout method of alfrescoApi instead running it by the authenticationService --- e2e/playwright/authentication/exclude.tests.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/playwright/authentication/exclude.tests.json b/e2e/playwright/authentication/exclude.tests.json index b8fb48b8af..dcb71c3847 100644 --- a/e2e/playwright/authentication/exclude.tests.json +++ b/e2e/playwright/authentication/exclude.tests.json @@ -1,3 +1,4 @@ { - "C213097" : "https://alfresco.atlassian.net/browse/ACS-5479" + "C213097" : "https://alfresco.atlassian.net/browse/ACS-5479", + "C286473": "https://alfresco.atlassian.net/browse/ACS-5996" } From 4a9851bc349bfd38aefa40ea73cc1b456528761d Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Tue, 12 Sep 2023 06:45:01 +0200 Subject: [PATCH 7/7] Update dependencies --- package-lock.json | 52 +++++++++++++++++++++++------------------------ package.json | 12 +++++------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3fefc6a207..f85266ebca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.3.0-6123510771", - "@alfresco/adf-core": "6.3.0-6123510771", - "@alfresco/adf-extensions": "6.3.0-6123510771", - "@alfresco/eslint-plugin-eslint-angular": "6.3.0-6123510771", + "@alfresco/adf-content-services": "6.3.0-6122593902", + "@alfresco/adf-core": "6.3.0-6122593902", + "@alfresco/adf-extensions": "6.3.0-6122593902", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-6122593902", "@alfresco/js-api": "6.3.0-1280", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -46,8 +46,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.3.0-6123510771", - "@alfresco/adf-testing": "6.3.0-6123510771", + "@alfresco/adf-cli": "6.3.0-6122593902", + "@alfresco/adf-testing": "6.3.0-6122593902", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -120,9 +120,9 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.3.0-6123510771.tgz", - "integrity": "sha512-8N7V6BLFoz/oliAo2eiLxIyRneyKDnSg1bvoiqydjtZd7WyGFy1vN5yekSmkxkavplA/J2FZtFMQT+bB3VIO+g==", + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.3.0-6122593902.tgz", + "integrity": "sha512-/1W5VgfyhkQK3gwrUjv0s3kipOU2ik04V4toX1tnvGgOBJqq3i/dBc/4MsOj9DFlyGWjEgO36HXiXYEBIyxKZQ==", "dev": true, "dependencies": { "@alfresco/js-api": ">=6.3.0-1271", @@ -140,14 +140,14 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.3.0-6123510771.tgz", - "integrity": "sha512-co0we9RsKx7IG/9Njtj+tzWP0o/D6TesUThjIqhyjVTEPDlPn0zuY+cpJx6l3HuXCEcGuJzDQ7i57YQ04DKx8w==", + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.3.0-6122593902.tgz", + "integrity": "sha512-poJKAC7wU7H5dQbXQuF7XQNmnKefwbq370jZxZ17BHyfYU5ykH1Q8vwZ5NZfiDzhksqSXSs9WO9mEPTYFD8SqQ==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.3.0-6123510771", + "@alfresco/adf-core": ">=6.3.0-6122593902", "@alfresco/js-api": ">=6.3.0-1271", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -164,9 +164,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.3.0-6123510771.tgz", - "integrity": "sha512-YDYIF4YYpiMXkye6ukj1UqT9etluqznM0NYS3yB2n0LcasimFs+Z7Y7JuAEpaJQwtfdwKkx14szCfxaj+ohb5A==", + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.3.0-6122593902.tgz", + "integrity": "sha512-v4x5LMBf/Wv1qE7Fkkk3yzr07lJD11apJwSt5aZQ+f1rtxSnyE+99TUCwkJ0heD3GBJw9hOZ0v3kFCBmIwoLAw==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -174,7 +174,7 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.3.0-6123510771", + "@alfresco/adf-extensions": ">=6.3.0-6122593902", "@alfresco/js-api": ">=6.3.0-1271", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -193,9 +193,9 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.3.0-6123510771.tgz", - "integrity": "sha512-o8UzyBjCHH6gaf1HmMhWDa48znCm/o6Xp3ws3gq5dFyLbLWkZDa0R3t2Ux/sHcVM8/gl/qNFzybW/MWCxWgKhQ==", + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.3.0-6122593902.tgz", + "integrity": "sha512-lwKVH1hSYMljMteg2bQQXmqFzjhrmBXirHCUmVM7lC1ErDJauDeKoMkF68ydjIXOqaLCQre0fgdHILGJ3RJPqQ==", "dependencies": { "tslib": "^2.3.0" }, @@ -206,9 +206,9 @@ } }, "node_modules/@alfresco/adf-testing": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.3.0-6123510771.tgz", - "integrity": "sha512-TzpUnf6y4rQTkHeZGqX6b7pWu4GMUV2EjyHwO/Bui2mkcGZQjYhPo1imG7xmiEZxr6WED/TOzQmLp21HeNg1bQ==", + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.3.0-6122593902.tgz", + "integrity": "sha512-8fqpuZpyPLY9W5bVJKyUvQHxsR4CqB/5CBJHih0hWaf1fbziVuMENQuz58hfyAP21hfb21p07j/fzrkDRBFp5A==", "dev": true, "dependencies": { "@alfresco/js-api": "6.3.0-1271", @@ -234,9 +234,9 @@ } }, "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.3.0-6123510771", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.3.0-6123510771.tgz", - "integrity": "sha512-zi03MXlo6uNbNTF1OA7Q5Q7v+YHr+rxjqclIzq/C2MUhXEnp7n6iGFXbnft3oZW1UVrcgYE7D0tgnEaGUkxOtg==" + "version": "6.3.0-6122593902", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.3.0-6122593902.tgz", + "integrity": "sha512-UIEjlvLjS053ef61+QPJXNU4bmYS8PTxZQeH6fXe4AXG/22/jYghkQbPkV40YkgO4rOytjaxkuYbBUFilHwwuA==" }, "node_modules/@alfresco/js-api": { "version": "6.3.0-1280", diff --git a/package.json b/package.json index 3d81f87cf7..762f76263e 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "6.3.0-6123510771", - "@alfresco/adf-core": "6.3.0-6123510771", - "@alfresco/adf-extensions": "6.3.0-6123510771", - "@alfresco/eslint-plugin-eslint-angular": "6.3.0-6123510771", + "@alfresco/adf-content-services": "6.3.0-6122593902", + "@alfresco/adf-core": "6.3.0-6122593902", + "@alfresco/adf-extensions": "6.3.0-6122593902", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-6122593902", "@alfresco/js-api": "6.3.0-1280", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -69,8 +69,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.3.0-6123510771", - "@alfresco/adf-testing": "6.3.0-6123510771", + "@alfresco/adf-cli": "6.3.0-6122593902", + "@alfresco/adf-testing": "6.3.0-6122593902", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2",