@spinnaker/core 0.24.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/application/config/defaultTagFilter/DefaultTagFilterConfig.d.ts +27 -0
  3. package/dist/application/config/defaultTagFilter/defaultTagFilterConfig.component.d.ts +1 -0
  4. package/dist/config/settings.d.ts +1 -0
  5. package/dist/domain/IArtifact.d.ts +2 -0
  6. package/dist/domain/ITrigger.d.ts +5 -0
  7. package/dist/index.js +36 -36
  8. package/dist/index.js.map +1 -1
  9. package/dist/manifest/ManifestYaml.d.ts +10 -4
  10. package/dist/pipeline/config/stages/bakeManifest/ManifestRenderers.d.ts +2 -0
  11. package/dist/pipeline/config/stages/bakeManifest/helmfile/BakeHelmfileConfigForm.d.ts +18 -0
  12. package/dist/pipeline/config/stages/bakeManifest/utils/getBakedArtifacts.d.ts +4 -0
  13. package/dist/pipeline/config/stages/bakeManifest/utils/getContentReference.d.ts +1 -0
  14. package/dist/pipeline/config/triggers/artifacts/ArtifactService.d.ts +3 -0
  15. package/dist/pipeline/config/triggers/cdevents/CDEventsTrigger.d.ts +7 -0
  16. package/dist/pipeline/config/triggers/cdevents/cdevents.trigger.d.ts +1 -0
  17. package/dist/pipeline/config/triggers/index.d.ts +1 -0
  18. package/dist/pipeline/executions/Executions.d.ts +1 -0
  19. package/dist/pipeline/index.d.ts +2 -0
  20. package/dist/presentation/forms/inputs/NumberConcurrencyInput.d.ts +7 -0
  21. package/package.json +2 -2
  22. package/src/application/config/applicationConfig.controller.js +26 -0
  23. package/src/application/config/applicationConfig.view.html +9 -0
  24. package/src/application/config/defaultTagFilter/DefaultTagFilterConfig.spec.tsx +75 -0
  25. package/src/application/config/defaultTagFilter/DefaultTagFilterConfig.tsx +161 -0
  26. package/src/application/config/defaultTagFilter/defaultTagFilterConfig.component.ts +15 -0
  27. package/src/application/config/defaultTagFilter/defaultTagFilterConfig.less +8 -0
  28. package/src/artifact/ArtifactIconService.ts +1 -0
  29. package/src/artifact/ArtifactTypes.ts +1 -0
  30. package/src/config/settings.ts +1 -0
  31. package/src/domain/IArtifact.ts +3 -0
  32. package/src/domain/ITrigger.ts +4 -0
  33. package/src/help/help.contents.ts +10 -0
  34. package/src/manifest/ManifestYaml.tsx +29 -7
  35. package/src/pipeline/config/stages/bakeManifest/BakeManifestConfig.tsx +4 -1
  36. package/src/pipeline/config/stages/bakeManifest/BakeManifestDetailsTab.tsx +24 -12
  37. package/src/pipeline/config/stages/bakeManifest/BakeManifestStageForm.tsx +9 -2
  38. package/src/pipeline/config/stages/bakeManifest/ManifestRenderers.ts +2 -0
  39. package/src/pipeline/config/stages/bakeManifest/helmfile/BakeHelmfileConfigForm.spec.tsx +132 -0
  40. package/src/pipeline/config/stages/bakeManifest/helmfile/BakeHelmfileConfigForm.tsx +271 -0
  41. package/src/pipeline/config/stages/bakeManifest/utils/getBakedArtifacts.ts +13 -0
  42. package/src/pipeline/config/stages/bakeManifest/utils/getContentReference.ts +3 -0
  43. package/src/pipeline/config/triggers/artifacts/ArtifactService.ts +4 -0
  44. package/src/pipeline/config/triggers/cdevents/CDEventsTrigger.tsx +48 -0
  45. package/src/pipeline/config/triggers/cdevents/cdevents.trigger.ts +19 -0
  46. package/src/pipeline/config/triggers/index.ts +1 -0
  47. package/src/pipeline/create/CreatePipelineModal.tsx +1 -1
  48. package/src/pipeline/details/StageFailureMessage.tsx +10 -24
  49. package/src/pipeline/executions/Executions.tsx +13 -0
  50. package/src/pipeline/index.ts +2 -0
  51. package/src/pipeline/status/ExecutionCancellationReason.tsx +1 -1
  52. package/src/presentation/forms/inputs/NumberConcurrencyInput.tsx +29 -0
@@ -73,33 +73,19 @@ export class StageFailureMessage extends React.Component<IStageFailureMessagePro
73
73
  }
74
74
 
75
75
  public render() {
76
- const { message, messages, stage } = this.props;
76
+ const { message, messages } = this.props;
77
77
  const { isFailed, failedTask, failedExecutionId, failedStageName, failedStageId } = this.state;
78
78
 
79
- let stageMessages = message && !messages.length ? [message] : messages;
80
- if (stageMessages.length > 0) {
79
+ if (isFailed || failedTask || message || messages.length) {
81
80
  const exceptionTitle = isFailed ? (messages.length ? 'Exceptions' : 'Exception') : 'Warning';
82
-
83
- // expression evaluation warnings can get really long and hide actual failure messages, source
84
- // filter out expression evaluation failure messages if either:
85
- // - there was a stage failure (and failed expressions don't fail the stage)
86
- // - expression evaluation was explicitly disabled for the stage(as Orca still processes expressions and populates
87
- // warnings when evaluation is disabled disabled)
88
- const shouldFilterExpressionFailures =
89
- (isFailed && !stage.context?.failOnFailedExpressions) || stage.context?.skipExpressionEvaluation;
90
-
91
- if (shouldFilterExpressionFailures) {
92
- stageMessages = stageMessages.filter((m) => !m.startsWith('Failed to evaluate'));
93
-
94
- if (stageMessages.length === 0) {
95
- // no messages to be displayed after filtering
96
- return null;
97
- }
98
- }
99
-
100
- const displayMessages = stageMessages.map((m, i) => (
101
- <Markdown key={i} message={m || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
102
- ));
81
+ const displayMessages =
82
+ message || !messages.length ? (
83
+ <Markdown message={message || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
84
+ ) : (
85
+ messages.map((m, i) => (
86
+ <Markdown key={i} message={m || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
87
+ ))
88
+ );
103
89
 
104
90
  if (displayMessages) {
105
91
  return (
@@ -4,6 +4,7 @@ import React from 'react';
4
4
  import type { Subscription } from 'rxjs';
5
5
 
6
6
  import type { Application } from '../../application';
7
+ import type { IDefaultTagFilterConfig } from '../../application/config/defaultTagFilter/DefaultTagFilterConfig';
7
8
  import { CreatePipeline } from '../config/CreatePipeline';
8
9
  import { CreatePipelineButton } from '../create/CreatePipelineButton';
9
10
  import type { IExecution, IPipeline, IPipelineCommand } from '../../domain';
@@ -74,6 +75,16 @@ export class Executions extends React.Component<IExecutionsProps, IExecutionsSta
74
75
  }
75
76
  };
76
77
 
78
+ private loadDefaultFilters = (): void => {
79
+ const defaultTags = this.props.app.attributes.defaultFilteredTags;
80
+ if (defaultTags != null) {
81
+ this.props.app.attributes.defaultFilteredTags.forEach((defaultTag: IDefaultTagFilterConfig) => {
82
+ ExecutionState.filterModel.asFilterModel.sortFilter.tags[`${defaultTag.tagName}:${defaultTag.tagValue}`] = true;
83
+ });
84
+ this.updateExecutionGroups(true);
85
+ }
86
+ };
87
+
77
88
  private clearFilters = (): void => {
78
89
  ExecutionFilterService.clearFilters();
79
90
  this.updateExecutionGroups(true);
@@ -235,6 +246,8 @@ export class Executions extends React.Component<IExecutionsProps, IExecutionsSta
235
246
  () => this.dataInitializationFailure(),
236
247
  );
237
248
 
249
+ this.loadDefaultFilters();
250
+
238
251
  $q.all([app.executions.ready(), app.pipelineConfigs.ready()]).then(() => {
239
252
  this.updateExecutionGroups();
240
253
  const nameOrIdToStart = ReactInjector.$stateParams.startManualExecution;
@@ -23,3 +23,5 @@ export * from './manualExecution/TriggerTemplate';
23
23
  export * from './service/ExecutionsTransformer';
24
24
  export * from './service/execution.service';
25
25
  export * from './status/ArtifactList';
26
+ export * from './config/stages/bakeManifest/utils/getBakedArtifacts';
27
+ export * from './config/stages/bakeManifest/utils/getContentReference';
@@ -7,7 +7,7 @@ interface IExecutionCancellationReasonProps {
7
7
  }
8
8
 
9
9
  export function ExecutionCancellationReason({ cancellationReason }: IExecutionCancellationReasonProps) {
10
- const [isExpanded, setIsExpanded] = React.useState(false);
10
+ const [isExpanded, setIsExpanded] = React.useState(true);
11
11
  return (
12
12
  <>
13
13
  <div className="execution-cancellation-reason-button">
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+
3
+ import { useInternalValidator } from './hooks';
4
+ import type { IFormInputProps, OmitControlledInputPropsFrom } from './interface';
5
+ import { orEmptyString, validationClassName } from './utils';
6
+ import type { IValidator } from '../validation';
7
+ import { composeValidators, Validators } from '../validation';
8
+
9
+ interface INumberInputProps extends IFormInputProps, OmitControlledInputPropsFrom<React.InputHTMLAttributes<any>> {
10
+ inputClassName?: string;
11
+ }
12
+
13
+ const isNumber = (val: any): val is number => typeof val === 'number';
14
+
15
+ export function NumberConcurrencyInput(props: INumberInputProps) {
16
+ const { value, validation, inputClassName, ...otherProps } = props;
17
+
18
+ const minMaxValidator: IValidator = (val: any, label?: string) => {
19
+ const minValidator = isNumber(props.min) ? Validators.minValue(props.min) : undefined;
20
+ const maxValidator = isNumber(props.max) ? Validators.maxValue(props.max) : undefined;
21
+ const validator = composeValidators([minValidator, maxValidator]);
22
+ return validator ? validator(val, label) : null;
23
+ };
24
+
25
+ useInternalValidator(validation, minMaxValidator);
26
+
27
+ const className = `NumberInput form-control ${orEmptyString(inputClassName)} ${validationClassName(validation)}`;
28
+ return <input className={className} type="number" value={orEmptyString(value)} {...otherProps} />;
29
+ }