Skip to content

Commit

Permalink
Merge pull request #378 from SUSE/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
richard-cox committed Jun 11, 2020
2 parents 566e233 + 1cacb5a commit 1f42e83
Show file tree
Hide file tree
Showing 774 changed files with 21,055 additions and 17,482 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ src/backend/*/vendor/
.v8flags*

*.bak
./secrets.yaml
/secrets.yaml
build/dev_config.json
e2e-reports/
.stratos-git-metadata.json
Expand Down
51 changes: 36 additions & 15 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"preserveSymlinks": true,
"outputPath": "dist",
"index": "src/frontend/packages/core/src/index.html",
Expand All @@ -35,6 +36,10 @@
},
"configurations": {
"production": {
"budgets": [{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -44,12 +49,10 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}
]
"fileReplacements": [{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}]
}
}
},
Expand Down Expand Up @@ -101,6 +104,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"preserveSymlinks": true,
"outputPath": "dist/core",
"index": "src/frontend/packages/core/src/index.html",
Expand All @@ -124,12 +128,14 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}
],
"budgets": [{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}],
"fileReplacements": [{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand Down Expand Up @@ -215,6 +221,11 @@
"options": {
"tsConfig": "src/frontend/packages/store/tsconfig.lib.json",
"project": "src/frontend/packages/store/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/store/tsconfig.lib.prod.json"
}
}
},
"test": {
Expand Down Expand Up @@ -253,6 +264,11 @@
"options": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.json",
"project": "src/frontend/packages/cloud-foundry/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.prod.json"
}
}
},
"test": {
Expand Down Expand Up @@ -291,6 +307,11 @@
"options": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.json",
"project": "src/frontend/packages/cf-autoscaler/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.prod.json"
}
}
},
"test": {
Expand Down Expand Up @@ -323,13 +344,13 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"defaultCollection": "@nrwl/angular"
"_defaultCollection": "@nrwl/angular"
}
}
}
10 changes: 0 additions & 10 deletions build/combine-coverage.js

This file was deleted.

8 changes: 7 additions & 1 deletion build/karma.conf.creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ module.exports = function (project) {
coverageIstanbulReporter: {
dir: path.join(repoRoot, 'coverage', project),
reports: ['html', 'lcovonly', 'json'],
fixWebpackSourcePaths: true
fixWebpackSourcePaths: true,
'report-config': {
json: {
// Collate all coverage-final files into a single dir for nyc to combine (it can't pick them out from `coverage`)
file: path.join('..', 'nyc', project + '-coverage-final.json')
}
},
},
reporters: ['spec', 'kjhtml', 'stratos'],
specReporter: {
Expand Down
85 changes: 42 additions & 43 deletions build/karma.test.reporter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

(function () {
'use strict';

Expand Down Expand Up @@ -75,7 +74,7 @@
fs.unlinkSync(this.summaryFile);
}

const all = this.runningTotals;
const all = this.runningTotals;

this.writeSummaryFile(`${this.bold}${this.cyan}================================================================================${this.reset}`);
this.writeSummaryFile(`${this.bold}${this.cyan}Test Summary${this.reset}`);
Expand Down Expand Up @@ -106,47 +105,47 @@

try {

this.writeFile(`${this.bold}${this.cyan}Test results for package ${this.bluebg} ${process.env.NG_TEST_SUITE} ${this.reset}`);
this.writeFile(`Total : ${this.bold}${this.cyan}${this.total}${this.reset}`)
this.writeFile(`Passed : ${this.bold}${this.cyan}${passed}${this.reset}`)
this.writeFile(`Failed : ${this.bold}${this.red}${this.failed.length}${this.reset}`)
this.writeFile(`Skipped : ${this.bold}${this.yellow}${this.skipped}${this.reset}`)

if (this.failed.length === 0) {
fs.appendFileSync(this.file, 'All tests passed\n')
} else {
this.writeFile('Test failures:');
this.failed.forEach(f => {
this.writeFile(`${this.red}${this.bold} - ${f.fullName}${this.reset}`);
const logs = f.log || [];
logs.forEach(l => fs.appendFileSync(this.file, `${this.grey} ${l}${this.reset}`));
// Add empty line
this.writeFile('');
});
}

// Update running totals JSON
this.runningTotals.total += this.total;
this.runningTotals.passed += passed;
this.runningTotals.failed += this.failed.length;
this.runningTotals.skipped += this.skipped;
fs.writeFileSync(this.jsonFile, JSON.stringify(this.runningTotals));

this.generateSummary();

// Write exit code
let newExitCode = this.exitCode;
if (result.exitCode > 0) {
newExitCode = result.exitCode
}

fs.writeFileSync(this.exitCodeFile, newExitCode.toString());

// Dump the summary for this test suite
var contents = fs.readFileSync(this.file, 'utf8');
console.log(contents);

} catch(e) {
this.writeFile(`${this.bold}${this.cyan}Test results for package ${this.bluebg} ${process.env.NG_TEST_SUITE} ${this.reset}`);
this.writeFile(`Total : ${this.bold}${this.cyan}${this.total}${this.reset}`)
this.writeFile(`Passed : ${this.bold}${this.cyan}${passed}${this.reset}`)
this.writeFile(`Failed : ${this.bold}${this.red}${this.failed.length}${this.reset}`)
this.writeFile(`Skipped : ${this.bold}${this.yellow}${this.skipped}${this.reset}`)

if (this.failed.length === 0) {
fs.appendFileSync(this.file, 'All tests passed\n')
} else {
this.writeFile('Test failures:');
this.failed.forEach(f => {
this.writeFile(`${this.red}${this.bold} - ${f.fullName}${this.reset}`);
const logs = f.log || [];
logs.forEach(l => fs.appendFileSync(this.file, `${this.grey} ${l}${this.reset}`));
// Add empty line
this.writeFile('');
});
}

// Update running totals JSON
this.runningTotals.total += this.total;
this.runningTotals.passed += passed;
this.runningTotals.failed += this.failed.length;
this.runningTotals.skipped += this.skipped;
fs.writeFileSync(this.jsonFile, JSON.stringify(this.runningTotals));

this.generateSummary();

// Write exit code
let newExitCode = this.exitCode;
if (result.exitCode > 0) {
newExitCode = result.exitCode
}

fs.writeFileSync(this.exitCodeFile, newExitCode.toString());

// Dump the summary for this test suite
var contents = fs.readFileSync(this.file, 'utf8');
console.log(contents);

} catch (e) {
console.log('ERROR while reporting test result');
console.log(e);
}
Expand Down
4 changes: 2 additions & 2 deletions custom-src/frontend/app/custom/custom-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const customRoutes: Routes = [
},
{
path: 'kubernetes',
loadChildren: './kubernetes/kubernetes.module#KubernetesModule',
loadChildren: () => import('./kubernetes/kubernetes.module').then(m => m.KubernetesModule),
data: {
stratosNavigation: {
text: 'Kubernetes',
Expand All @@ -34,7 +34,7 @@ const customRoutes: Routes = [
},
{
path: 'monocular',
loadChildren: './helm/helm.module#HelmModule',
loadChildren: () => import('./helm/helm.module').then(m => m.HelmModule),
data: {
reuseRoute: true,
stratosNavigation: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MatTextareaAutosize } from '@angular/material';
import { MatTextareaAutosize } from '@angular/material/input';
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { PaginationMonitorFactory } from 'frontend/packages/store/src/monitors/pagination-monitor.factory';
Expand All @@ -10,7 +10,7 @@ import { BehaviorSubject, combineLatest, Observable, of, Subscription } from 'rx
import { distinctUntilChanged, filter, first, map, pairwise, startWith, switchMap } from 'rxjs/operators';

import { AppState } from '../../../../../store/src/app-state';
import { entityCatalog } from '../../../../../store/src/entity-catalog/entity-catalog.service';
import { EntityMonitorFactory } from '../../../../../store/src/monitors/entity-monitor.factory.service';
import { EndpointsService } from '../../../core/endpoints.service';
import { safeUnsubscribe } from '../../../core/utils.service';
import { ConfirmationDialogConfig } from '../../../shared/components/confirmation-dialog.config';
Expand Down Expand Up @@ -64,7 +64,8 @@ export class CreateReleaseComponent implements OnInit, OnDestroy {
private store: Store<AppState>,
private httpClient: HttpClient,
private confirmDialog: ConfirmationDialogService,
private pmf: PaginationMonitorFactory
private pmf: PaginationMonitorFactory,
private emf: EntityMonitorFactory
) {
const chart = this.route.snapshot.params;
this.cancelUrl = `/monocular/charts/${chart.repo}/${chart.chartName}/${chart.version}`;
Expand Down Expand Up @@ -238,9 +239,7 @@ export class CreateReleaseComponent implements OnInit, OnDestroy {
this.details.controls.endpoint.value);
this.store.dispatch(action);

const namespaceEntityConfig = entityCatalog.getEntity(action);
const monitor = namespaceEntityConfig.getEntityMonitor(this.store, action.guid);
return monitor.entityRequest$.pipe(
return this.emf.create(action.guid, action).entityRequest$.pipe(
pairwise(),
filter(([oldVal, newVal]) => oldVal.creating && !newVal.creating),
map(([, newVal]) => newVal),
Expand Down Expand Up @@ -271,10 +270,8 @@ export class CreateReleaseComponent implements OnInit, OnDestroy {
const action = new HelmInstall(values);
this.store.dispatch(action);

const releaseEntityConfig = entityCatalog.getEntity(action);

// Wait for result of request
return releaseEntityConfig.getEntityMonitor(this.store, action.guid).entityRequest$.pipe(
return this.emf.create(action.guid, action).entityRequest$.pipe(
filter(state => !!state),
pairwise(),
filter(([oldVal, newVal]) => (oldVal.creating && !newVal.creating)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
StratosBaseCatalogEntity,
StratosCatalogEndpointEntity,
StratosCatalogEntity,
} from '../../../../store/src/entity-catalog/entity-catalog-entity';
} from '../../../../store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity';
import { StratosEndpointExtensionDefinition } from '../../../../store/src/entity-catalog/entity-catalog.types';
import { IFavoriteMetadata } from '../../../../store/src/types/user-favorites.types';
import {
Expand Down
2 changes: 1 addition & 1 deletion custom-src/frontend/app/custom/helm/helm-testing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

import { CATALOGUE_ENTITIES, EntityCatalogFeatureModule } from '../../../../store/src/entity-catalog.module';
import { entityCatalog, TestEntityCatalog } from '../../../../store/src/entity-catalog/entity-catalog.service';
import { entityCatalog, TestEntityCatalog } from '../../../../store/src/entity-catalog/entity-catalog';
import { createBasicStoreModule } from '../../../../store/testing/public-api';
import { generateStratosEntities } from '../../base-entity-types';
import { CoreModule } from '../../core/core.module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HttpClient } from '@angular/common/http';
import { Injectable, NgZone } from '@angular/core';
import { MatSnackBar } from '@angular/material';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { UnregisterEndpoint } from 'frontend/packages/store/src/actions/endpoint.actions';
import { entityCatalog } from 'frontend/packages/store/src/entity-catalog/entity-catalog.service';
import { entityCatalog } from 'frontend/packages/store/src/entity-catalog/entity-catalog';
import { endpointSchemaKey } from 'frontend/packages/store/src/helpers/entity-factory';
import { selectDeletionInfo } from 'frontend/packages/store/src/selectors/api.selectors';
import { of as observableOf } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import { MatIconRegistry, MatSnackBar } from '@angular/material';
import { MatIconRegistry } from '@angular/material/icon';
import { MatSnackBar } from '@angular/material/snack-bar';
import { DomSanitizer } from '@angular/platform-browser';

import { EndpointsService } from '../../../../../core/endpoints.service';
Expand Down
Loading

0 comments on commit 1f42e83

Please sign in to comment.