@spinnaker/kayenta 0.0.0-2025.1-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.
- package/.editorconfig +9 -0
- package/.eslintrc.js +1 -0
- package/.huskyrc +5 -0
- package/.lintstagedrc.json +4 -0
- package/.prettierignore +4 -0
- package/.prettierrc.js +1 -0
- package/LICENSE.txt +203 -0
- package/README.md +81 -0
- package/__mocks__/styleMock.js +1 -0
- package/__mocks__/version.json +4 -0
- package/babel.config.js +3 -0
- package/build.gradle +67 -0
- package/build_scripts/checkLicenses.js +79 -0
- package/gradle.properties +0 -0
- package/jest.config.js +204 -0
- package/jest.setup.js +5 -0
- package/package.json +166 -0
- package/rollup-plugin-angularjs-template-loader.js +82 -0
- package/rollup.config.js +30 -0
- package/src/index.ts +2 -0
- package/src/kayenta/actions/creators.ts +163 -0
- package/src/kayenta/actions/index.ts +98 -0
- package/src/kayenta/canary.dataSource.bridge.ts +53 -0
- package/src/kayenta/canary.dataSource.stub.ts +64 -0
- package/src/kayenta/canary.help.ts +136 -0
- package/src/kayenta/canary.less +168 -0
- package/src/kayenta/canary.settings.ts +26 -0
- package/src/kayenta/canary.tsx +67 -0
- package/src/kayenta/components/canaryScore.component.less +77 -0
- package/src/kayenta/components/canaryScore.component.ts +12 -0
- package/src/kayenta/components/canaryScore.tsx +63 -0
- package/src/kayenta/components/canaryScores.component.ts +20 -0
- package/src/kayenta/components/canaryScores.less +22 -0
- package/src/kayenta/components/canaryScores.tsx +163 -0
- package/src/kayenta/components/loadStates.tsx +52 -0
- package/src/kayenta/domain/ICanaryConfig.ts +57 -0
- package/src/kayenta/domain/ICanaryConfigSummary.ts +7 -0
- package/src/kayenta/domain/ICanaryConfigUpdateResponse.ts +3 -0
- package/src/kayenta/domain/ICanaryExecutionStatusResult.ts +72 -0
- package/src/kayenta/domain/ICanaryJudgeResult.ts +51 -0
- package/src/kayenta/domain/ICanaryJudgeResultSummary.ts +5 -0
- package/src/kayenta/domain/ICanaryScoreThresholds.ts +4 -0
- package/src/kayenta/domain/IJudge.ts +5 -0
- package/src/kayenta/domain/IKayentaAccount.ts +14 -0
- package/src/kayenta/domain/IKayentaStageConfig.ts +58 -0
- package/src/kayenta/domain/IMetricSetPair.ts +17 -0
- package/src/kayenta/domain/IMetricsServiceMetadata.ts +2 -0
- package/src/kayenta/domain/ISetupCanaryStage.ts +11 -0
- package/src/kayenta/domain/MetricClassificationLabel.ts +8 -0
- package/src/kayenta/domain/ScoreClassificationLabel.ts +7 -0
- package/src/kayenta/domain/index.ts +15 -0
- package/src/kayenta/edit/changeMetricGroupModal.tsx +107 -0
- package/src/kayenta/edit/configDetail.tsx +31 -0
- package/src/kayenta/edit/configDetailActionButtons.tsx +24 -0
- package/src/kayenta/edit/configDetailHeader.tsx +104 -0
- package/src/kayenta/edit/configDetailLoadStates.tsx +36 -0
- package/src/kayenta/edit/configDetailLoader.tsx +60 -0
- package/src/kayenta/edit/configJson.less +42 -0
- package/src/kayenta/edit/configJsonModal.tsx +158 -0
- package/src/kayenta/edit/configList.less +7 -0
- package/src/kayenta/edit/configList.tsx +57 -0
- package/src/kayenta/edit/copyConfigButton.tsx +34 -0
- package/src/kayenta/edit/createConfigButton.tsx +34 -0
- package/src/kayenta/edit/deleteModal.tsx +87 -0
- package/src/kayenta/edit/edit.tsx +24 -0
- package/src/kayenta/edit/editMetricEffectSizes.tsx +186 -0
- package/src/kayenta/edit/editMetricModal.less +9 -0
- package/src/kayenta/edit/editMetricModal.spec.tsx +129 -0
- package/src/kayenta/edit/editMetricModal.tsx +294 -0
- package/src/kayenta/edit/editMetricValidation.spec.ts +63 -0
- package/src/kayenta/edit/editMetricValidation.ts +50 -0
- package/src/kayenta/edit/filterTemplateSelector.less +15 -0
- package/src/kayenta/edit/filterTemplateSelector.spec.tsx +106 -0
- package/src/kayenta/edit/filterTemplateSelector.tsx +194 -0
- package/src/kayenta/edit/filterTemplatesValidation.spec.ts +108 -0
- package/src/kayenta/edit/filterTemplatesValidation.ts +95 -0
- package/src/kayenta/edit/footer.less +30 -0
- package/src/kayenta/edit/footer.tsx +12 -0
- package/src/kayenta/edit/groupName.tsx +80 -0
- package/src/kayenta/edit/groupTabs.tsx +106 -0
- package/src/kayenta/edit/groupWeight.tsx +80 -0
- package/src/kayenta/edit/groupWeights.tsx +38 -0
- package/src/kayenta/edit/inlineTemplateEditor.spec.tsx +42 -0
- package/src/kayenta/edit/inlineTemplateEditor.tsx +61 -0
- package/src/kayenta/edit/judgeSelect.tsx +82 -0
- package/src/kayenta/edit/metricConfigurerDelegator.tsx +30 -0
- package/src/kayenta/edit/metricList.less +21 -0
- package/src/kayenta/edit/metricList.tsx +215 -0
- package/src/kayenta/edit/metricStoreSelector.tsx +66 -0
- package/src/kayenta/edit/nameAndDescription.tsx +90 -0
- package/src/kayenta/edit/openConfigJsonModalButton.tsx +33 -0
- package/src/kayenta/edit/openDeleteModalButton.tsx +50 -0
- package/src/kayenta/edit/ownedBy.tsx +34 -0
- package/src/kayenta/edit/save.tsx +19 -0
- package/src/kayenta/edit/saveConfigButton.tsx +65 -0
- package/src/kayenta/edit/saveConfigError.tsx +59 -0
- package/src/kayenta/edit/scoring.tsx +35 -0
- package/src/kayenta/edit/selectConfig.tsx +10 -0
- package/src/kayenta/edit/validationErrors.tsx +39 -0
- package/src/kayenta/index.ts +6 -0
- package/src/kayenta/layout/addNewButton.tsx +20 -0
- package/src/kayenta/layout/centeredDetail.tsx +13 -0
- package/src/kayenta/layout/deleteButton.tsx +11 -0
- package/src/kayenta/layout/disableable.tsx +87 -0
- package/src/kayenta/layout/formList.tsx +26 -0
- package/src/kayenta/layout/formRow.tsx +36 -0
- package/src/kayenta/layout/formattedDate.tsx +14 -0
- package/src/kayenta/layout/index.ts +2 -0
- package/src/kayenta/layout/keyValueList.less +20 -0
- package/src/kayenta/layout/keyValueList.tsx +114 -0
- package/src/kayenta/layout/list.less +9 -0
- package/src/kayenta/layout/list.spec.tsx +83 -0
- package/src/kayenta/layout/list.tsx +73 -0
- package/src/kayenta/layout/listDetail.tsx +33 -0
- package/src/kayenta/layout/radioChoice.tsx +29 -0
- package/src/kayenta/layout/styleguide.tsx +16 -0
- package/src/kayenta/layout/table/index.ts +5 -0
- package/src/kayenta/layout/table/nativeTable.tsx +51 -0
- package/src/kayenta/layout/table/nativeTableHeader.tsx +26 -0
- package/src/kayenta/layout/table/table.tsx +56 -0
- package/src/kayenta/layout/table/tableColumn.ts +7 -0
- package/src/kayenta/layout/table/tableHeader.tsx +23 -0
- package/src/kayenta/layout/tabs.tsx +26 -0
- package/src/kayenta/layout/titledSection.less +16 -0
- package/src/kayenta/layout/titledSection.tsx +20 -0
- package/src/kayenta/layout/titledSubsection.less +11 -0
- package/src/kayenta/layout/titledSubsection.tsx +22 -0
- package/src/kayenta/manualAnalysis/ManualAnalysisModal.tsx +716 -0
- package/src/kayenta/metricStore/atlas/atlasMetricConfigurer.tsx +130 -0
- package/src/kayenta/metricStore/atlas/index.ts +8 -0
- package/src/kayenta/metricStore/datadog/domain/IDatadogMetricDescriptor.ts +5 -0
- package/src/kayenta/metricStore/datadog/index.ts +9 -0
- package/src/kayenta/metricStore/datadog/metricConfigurer.tsx +90 -0
- package/src/kayenta/metricStore/datadog/metricTypeSelector.spec.tsx +59 -0
- package/src/kayenta/metricStore/datadog/metricTypeSelector.tsx +73 -0
- package/src/kayenta/metricStore/graphite/domain/IGraphiteMetricDescriptor.ts +5 -0
- package/src/kayenta/metricStore/graphite/index.ts +8 -0
- package/src/kayenta/metricStore/graphite/metricConfigurer.tsx +54 -0
- package/src/kayenta/metricStore/graphite/metricTypeSelector.tsx +80 -0
- package/src/kayenta/metricStore/graphite/typeahead.less +3 -0
- package/src/kayenta/metricStore/index.ts +8 -0
- package/src/kayenta/metricStore/metricStoreConfig.service.ts +12 -0
- package/src/kayenta/metricStore/newrelic/domain/INewRelicMetricDescriptor.ts +5 -0
- package/src/kayenta/metricStore/newrelic/index.ts +8 -0
- package/src/kayenta/metricStore/newrelic/metricConfigurer.tsx +58 -0
- package/src/kayenta/metricStore/prometheus/domain/IPrometheusCanaryMetricSetQueryConfig.ts +14 -0
- package/src/kayenta/metricStore/prometheus/domain/IPrometheusMetricDescriptor.ts +5 -0
- package/src/kayenta/metricStore/prometheus/index.ts +12 -0
- package/src/kayenta/metricStore/prometheus/metricConfigurer.tsx +157 -0
- package/src/kayenta/metricStore/prometheus/metricTypeSelector.less +5 -0
- package/src/kayenta/metricStore/prometheus/metricTypeSelector.spec.tsx +62 -0
- package/src/kayenta/metricStore/prometheus/metricTypeSelector.tsx +144 -0
- package/src/kayenta/metricStore/prometheus/queryTypeSelectors.spec.ts +61 -0
- package/src/kayenta/metricStore/prometheus/queryTypeSelectors.ts +38 -0
- package/src/kayenta/metricStore/signalfx/domain/ISignalFxCanaryMetricSetQueryConfig.ts +7 -0
- package/src/kayenta/metricStore/signalfx/index.ts +8 -0
- package/src/kayenta/metricStore/signalfx/metricConfigurer.less +10 -0
- package/src/kayenta/metricStore/signalfx/metricConfigurer.tsx +187 -0
- package/src/kayenta/metricStore/stackdriver/domain/IStackdriverCanaryMetricSetQueryConfig.ts +9 -0
- package/src/kayenta/metricStore/stackdriver/domain/IStackdriverMetricDescriptor.ts +17 -0
- package/src/kayenta/metricStore/stackdriver/index.ts +12 -0
- package/src/kayenta/metricStore/stackdriver/metricConfigurer.tsx +144 -0
- package/src/kayenta/metricStore/stackdriver/metricTypeSelector.spec.tsx +92 -0
- package/src/kayenta/metricStore/stackdriver/metricTypeSelector.tsx +113 -0
- package/src/kayenta/middleware/actionInterceptor.ts +29 -0
- package/src/kayenta/middleware/asyncDispatch.ts +37 -0
- package/src/kayenta/middleware/epics.ts +211 -0
- package/src/kayenta/middleware/index.ts +3 -0
- package/src/kayenta/navigation/canary.states.stub.ts +28 -0
- package/src/kayenta/navigation/canary.states.ts +182 -0
- package/src/kayenta/reducers/app.ts +56 -0
- package/src/kayenta/reducers/asyncRequest.ts +5 -0
- package/src/kayenta/reducers/data.ts +169 -0
- package/src/kayenta/reducers/editingTemplate.ts +54 -0
- package/src/kayenta/reducers/group.ts +82 -0
- package/src/kayenta/reducers/index.ts +245 -0
- package/src/kayenta/reducers/prometheusMetricConfig.spec.ts +33 -0
- package/src/kayenta/reducers/prometheusMetricConfig.ts +56 -0
- package/src/kayenta/reducers/selectedConfig.spec.ts +190 -0
- package/src/kayenta/reducers/selectedConfig.ts +566 -0
- package/src/kayenta/reducers/selectedRun.ts +101 -0
- package/src/kayenta/reducers/signalFxMetricConfig.ts +36 -0
- package/src/kayenta/reducers/stackdriverMetricConfig.spec.ts +33 -0
- package/src/kayenta/reducers/stackdriverMetricConfig.ts +41 -0
- package/src/kayenta/reducers/templates.spec.ts +192 -0
- package/src/kayenta/reducers/validators.ts +118 -0
- package/src/kayenta/report/detail/allMetricResultsHeader.tsx +32 -0
- package/src/kayenta/report/detail/clickableHeader.tsx +21 -0
- package/src/kayenta/report/detail/colors.ts +47 -0
- package/src/kayenta/report/detail/detail.less +16 -0
- package/src/kayenta/report/detail/detail.tsx +48 -0
- package/src/kayenta/report/detail/detailLoader.tsx +55 -0
- package/src/kayenta/report/detail/graph/graph.tsx +37 -0
- package/src/kayenta/report/detail/graph/metricSetPairGraph.service.ts +35 -0
- package/src/kayenta/report/detail/graph/semiotic/boxplot.less +45 -0
- package/src/kayenta/report/detail/graph/semiotic/boxplot.tsx +283 -0
- package/src/kayenta/report/detail/graph/semiotic/chartHeader.tsx +19 -0
- package/src/kayenta/report/detail/graph/semiotic/chartLegend.less +26 -0
- package/src/kayenta/report/detail/graph/semiotic/chartLegend.tsx +42 -0
- package/src/kayenta/report/detail/graph/semiotic/circleIcon.tsx +16 -0
- package/src/kayenta/report/detail/graph/semiotic/config.less +5 -0
- package/src/kayenta/report/detail/graph/semiotic/config.ts +38 -0
- package/src/kayenta/report/detail/graph/semiotic/customAxisTickLabel.tsx +17 -0
- package/src/kayenta/report/detail/graph/semiotic/declarations/labella.d.ts +16 -0
- package/src/kayenta/report/detail/graph/semiotic/declarations/react-container-dimensions.d.ts +3 -0
- package/src/kayenta/report/detail/graph/semiotic/declarations/semiotic.d.ts +160 -0
- package/src/kayenta/report/detail/graph/semiotic/differenceArea.less +17 -0
- package/src/kayenta/report/detail/graph/semiotic/differenceArea.tsx +186 -0
- package/src/kayenta/report/detail/graph/semiotic/histogram.less +22 -0
- package/src/kayenta/report/detail/graph/semiotic/histogram.tsx +251 -0
- package/src/kayenta/report/detail/graph/semiotic/index.tsx +19 -0
- package/src/kayenta/report/detail/graph/semiotic/noValidDataSign.less +5 -0
- package/src/kayenta/report/detail/graph/semiotic/noValidDataSign.tsx +10 -0
- package/src/kayenta/report/detail/graph/semiotic/secondaryTSXAxis.less +6 -0
- package/src/kayenta/report/detail/graph/semiotic/secondaryTSXAxis.tsx +58 -0
- package/src/kayenta/report/detail/graph/semiotic/semiotic.service.ts +32 -0
- package/src/kayenta/report/detail/graph/semiotic/semioticGraph.less +53 -0
- package/src/kayenta/report/detail/graph/semiotic/semioticGraph.tsx +49 -0
- package/src/kayenta/report/detail/graph/semiotic/timeSeries.less +42 -0
- package/src/kayenta/report/detail/graph/semiotic/timeSeries.tsx +473 -0
- package/src/kayenta/report/detail/graph/semiotic/tooltip.tsx +55 -0
- package/src/kayenta/report/detail/graph/semiotic/utils.ts +90 -0
- package/src/kayenta/report/detail/graphTypeSelector.less +4 -0
- package/src/kayenta/report/detail/graphTypeSelector.tsx +50 -0
- package/src/kayenta/report/detail/groupScores.tsx +68 -0
- package/src/kayenta/report/detail/header.less +70 -0
- package/src/kayenta/report/detail/header.tsx +39 -0
- package/src/kayenta/report/detail/headerArrow.tsx +13 -0
- package/src/kayenta/report/detail/loadStates.tsx +31 -0
- package/src/kayenta/report/detail/metricResultActions.less +29 -0
- package/src/kayenta/report/detail/metricResultActions.tsx +87 -0
- package/src/kayenta/report/detail/metricResultClassification.tsx +22 -0
- package/src/kayenta/report/detail/metricResultDetail.tsx +20 -0
- package/src/kayenta/report/detail/metricResultDetailLayout.tsx +19 -0
- package/src/kayenta/report/detail/metricResultDeviation.tsx +25 -0
- package/src/kayenta/report/detail/metricResultStats.less +9 -0
- package/src/kayenta/report/detail/metricResultStats.tsx +120 -0
- package/src/kayenta/report/detail/metricResults.less +12 -0
- package/src/kayenta/report/detail/metricResults.tsx +52 -0
- package/src/kayenta/report/detail/metricResultsClassificationFilters.tsx +65 -0
- package/src/kayenta/report/detail/metricResultsColumns.tsx +27 -0
- package/src/kayenta/report/detail/metricResultsList.less +44 -0
- package/src/kayenta/report/detail/metricResultsList.tsx +120 -0
- package/src/kayenta/report/detail/metricSetPairLoadStates.tsx +22 -0
- package/src/kayenta/report/detail/multipleResultsTable.tsx +81 -0
- package/src/kayenta/report/detail/reportException.tsx +57 -0
- package/src/kayenta/report/detail/reportExplanation.less +12 -0
- package/src/kayenta/report/detail/reportExplanation.tsx +32 -0
- package/src/kayenta/report/detail/reportMetadata.tsx +167 -0
- package/src/kayenta/report/detail/reportScores.less +47 -0
- package/src/kayenta/report/detail/reportScores.tsx +80 -0
- package/src/kayenta/report/detail/score.tsx +33 -0
- package/src/kayenta/report/detail/sourceLinks.tsx +69 -0
- package/src/kayenta/report/list/configLink.tsx +32 -0
- package/src/kayenta/report/list/executionList.less +7 -0
- package/src/kayenta/report/list/loadStates.tsx +32 -0
- package/src/kayenta/report/list/pipelineLink.tsx +15 -0
- package/src/kayenta/report/list/reportLink.tsx +33 -0
- package/src/kayenta/report/list/table.tsx +309 -0
- package/src/kayenta/report/report.tsx +11 -0
- package/src/kayenta/selectors/filterTemplatesSelectors.ts +87 -0
- package/src/kayenta/selectors/index.ts +62 -0
- package/src/kayenta/service/canaryConfig.service.ts +122 -0
- package/src/kayenta/service/canaryRun.service.ts +60 -0
- package/src/kayenta/service/delegateFactory.ts +24 -0
- package/src/kayenta/service/metricsServiceMetadata.service.ts +9 -0
- package/src/kayenta/stages/kayentaStage/AnalysisType.spec.tsx +47 -0
- package/src/kayenta/stages/kayentaStage/AnalysisType.tsx +49 -0
- package/src/kayenta/stages/kayentaStage/CanaryExecutionLabel.tsx +26 -0
- package/src/kayenta/stages/kayentaStage/analysisType.component.ts +12 -0
- package/src/kayenta/stages/kayentaStage/canaryRunSummaries.component.ts +12 -0
- package/src/kayenta/stages/kayentaStage/canaryRunSummaries.less +5 -0
- package/src/kayenta/stages/kayentaStage/canaryRunSummaries.tsx +136 -0
- package/src/kayenta/stages/kayentaStage/forAnalysisType.component.ts +45 -0
- package/src/kayenta/stages/kayentaStage/kayentaStage.controller.ts +789 -0
- package/src/kayenta/stages/kayentaStage/kayentaStage.html +528 -0
- package/src/kayenta/stages/kayentaStage/kayentaStage.less +5 -0
- package/src/kayenta/stages/kayentaStage/kayentaStage.transformer.ts +179 -0
- package/src/kayenta/stages/kayentaStage/kayentaStage.ts +221 -0
- package/src/kayenta/stages/kayentaStage/kayentaStageConfigSection.component.ts +21 -0
- package/src/kayenta/stages/kayentaStage/kayentaStageExecutionDetails.controller.ts +88 -0
- package/src/kayenta/stages/kayentaStage/kayentaStageExecutionDetails.html +114 -0
- package/src/kayenta/stages/kayentaStage/kayentaStageExecutionDetails.less +6 -0
- package/src/kayenta/stages/kayentaStage/stageTypes.ts +5 -0
- package/src/kayenta/utils/duration.spec.ts +69 -0
- package/src/kayenta/utils/duration.ts +48 -0
- package/src/lazy.ts +29 -0
- package/src/stub.ts +60 -0
- package/tsconfig.json +11 -0
package/jest.config.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* For a detailed explanation regarding each configuration property and type check, visit:
|
|
3
|
+
* https://jestjs.io/docs/en/configuration.html
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const esModules = ['@spinnaker/presentation'];
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
// All imported modules in your tests should be mocked automatically
|
|
10
|
+
// automock: false,
|
|
11
|
+
|
|
12
|
+
// Stop running tests after `n` failures
|
|
13
|
+
// bail: 0,
|
|
14
|
+
|
|
15
|
+
// The directory where Jest should store its cached dependency information
|
|
16
|
+
// cacheDirectory: "/private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/jest_dy",
|
|
17
|
+
|
|
18
|
+
// Automatically clear mock calls and instances between every test
|
|
19
|
+
// clearMocks: false,
|
|
20
|
+
|
|
21
|
+
// Indicates whether the coverage information should be collected while executing the test
|
|
22
|
+
// collectCoverage: false,
|
|
23
|
+
|
|
24
|
+
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
|
25
|
+
// collectCoverageFrom: undefined,
|
|
26
|
+
|
|
27
|
+
// The directory where Jest should output its coverage files
|
|
28
|
+
// coverageDirectory: undefined,
|
|
29
|
+
|
|
30
|
+
// An array of regexp pattern strings used to skip coverage collection
|
|
31
|
+
// coveragePathIgnorePatterns: [
|
|
32
|
+
// "/node_modules/"
|
|
33
|
+
// ],
|
|
34
|
+
|
|
35
|
+
// Indicates which provider should be used to instrument code for coverage
|
|
36
|
+
// coverageProvider: "v8",
|
|
37
|
+
|
|
38
|
+
// A list of reporter names that Jest uses when writing coverage reports
|
|
39
|
+
// coverageReporters: [
|
|
40
|
+
// "json",
|
|
41
|
+
// "text",
|
|
42
|
+
// "lcov",
|
|
43
|
+
// "clover"
|
|
44
|
+
// ],
|
|
45
|
+
|
|
46
|
+
// An object that configures minimum threshold enforcement for coverage results
|
|
47
|
+
// coverageThreshold: undefined,
|
|
48
|
+
|
|
49
|
+
// A path to a custom dependency extractor
|
|
50
|
+
// dependencyExtractor: undefined,
|
|
51
|
+
|
|
52
|
+
// Make calling deprecated APIs throw helpful error messages
|
|
53
|
+
// errorOnDeprecated: false,
|
|
54
|
+
|
|
55
|
+
// Force coverage collection from ignored files using an array of glob patterns
|
|
56
|
+
// forceCoverageMatch: [],
|
|
57
|
+
|
|
58
|
+
// A path to a module which exports an async function that is triggered once before all test suites
|
|
59
|
+
// globalSetup: undefined,
|
|
60
|
+
|
|
61
|
+
// A path to a module which exports an async function that is triggered once after all test suites
|
|
62
|
+
// globalTeardown: undefined,
|
|
63
|
+
|
|
64
|
+
// A set of global variables that need to be available in all test environments
|
|
65
|
+
// globals: {},
|
|
66
|
+
|
|
67
|
+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
|
68
|
+
// maxWorkers: "50%",
|
|
69
|
+
|
|
70
|
+
// An array of directory names to be searched recursively up from the requiring module's location
|
|
71
|
+
// moduleDirectories: [
|
|
72
|
+
// "node_modules"
|
|
73
|
+
// ],
|
|
74
|
+
|
|
75
|
+
// An array of file extensions your modules use
|
|
76
|
+
// moduleFileExtensions: [
|
|
77
|
+
// "js",
|
|
78
|
+
// "json",
|
|
79
|
+
// "jsx",
|
|
80
|
+
// "ts",
|
|
81
|
+
// "tsx",
|
|
82
|
+
// "node"
|
|
83
|
+
// ],
|
|
84
|
+
|
|
85
|
+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
|
86
|
+
// moduleNameMapper: {},
|
|
87
|
+
moduleNameMapper: {
|
|
88
|
+
'kayenta/(.*)': '<rootDir>/src/kayenta/$1',
|
|
89
|
+
'root/version.json': '<rootDir>/__mocks__/version.json',
|
|
90
|
+
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
|
|
91
|
+
'@spinnaker/presentation': '<rootDir>/node_modules/@spinnaker/presentation/dist',
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
95
|
+
// modulePathIgnorePatterns: [],
|
|
96
|
+
|
|
97
|
+
// Activates notifications for test results
|
|
98
|
+
// notify: false,
|
|
99
|
+
|
|
100
|
+
// An enum that specifies notification mode. Requires { notify: true }
|
|
101
|
+
// notifyMode: "failure-change",
|
|
102
|
+
|
|
103
|
+
// A preset that is used as a base for Jest's configuration
|
|
104
|
+
// preset: undefined,
|
|
105
|
+
|
|
106
|
+
// Run tests from one or more projects
|
|
107
|
+
// projects: undefined,
|
|
108
|
+
|
|
109
|
+
// Use this configuration option to add custom reporters to Jest
|
|
110
|
+
// reporters: undefined,
|
|
111
|
+
|
|
112
|
+
// Automatically reset mock state between every test
|
|
113
|
+
// resetMocks: false,
|
|
114
|
+
|
|
115
|
+
// Reset the module registry before running each individual test
|
|
116
|
+
// resetModules: false,
|
|
117
|
+
|
|
118
|
+
// A path to a custom resolver
|
|
119
|
+
// resolver: undefined,
|
|
120
|
+
|
|
121
|
+
// Automatically restore mock state between every test
|
|
122
|
+
// restoreMocks: false,
|
|
123
|
+
|
|
124
|
+
// The root directory that Jest should scan for tests and modules within
|
|
125
|
+
// rootDir: undefined,
|
|
126
|
+
|
|
127
|
+
// A list of paths to directories that Jest should use to search for files in
|
|
128
|
+
// roots: [
|
|
129
|
+
// "<rootDir>"
|
|
130
|
+
// ],
|
|
131
|
+
|
|
132
|
+
// Allows you to use a custom runner instead of Jest's default test runner
|
|
133
|
+
// runner: "jest-runner",
|
|
134
|
+
|
|
135
|
+
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
136
|
+
// setupFiles: [],
|
|
137
|
+
setupFiles: ['<rootDir>/jest.setup.js'],
|
|
138
|
+
|
|
139
|
+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
140
|
+
// setupFilesAfterEnv: [],
|
|
141
|
+
|
|
142
|
+
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
|
143
|
+
// slowTestThreshold: 5,
|
|
144
|
+
|
|
145
|
+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
|
146
|
+
// snapshotSerializers: [],
|
|
147
|
+
|
|
148
|
+
// The test environment that will be used for testing
|
|
149
|
+
// testEnvironment: "jest-environment-jsdom",
|
|
150
|
+
|
|
151
|
+
// Options that will be passed to the testEnvironment
|
|
152
|
+
// testEnvironmentOptions: {},
|
|
153
|
+
|
|
154
|
+
// Adds a location field to test results
|
|
155
|
+
// testLocationInResults: false,
|
|
156
|
+
|
|
157
|
+
// The glob patterns Jest uses to detect test files
|
|
158
|
+
// testMatch: [
|
|
159
|
+
// "**/__tests__/**/*.[jt]s?(x)",
|
|
160
|
+
// "**/?(*.)+(spec|test).[tj]s?(x)"
|
|
161
|
+
// ],
|
|
162
|
+
|
|
163
|
+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
|
164
|
+
// testPathIgnorePatterns: [
|
|
165
|
+
// "/node_modules/"
|
|
166
|
+
// ],
|
|
167
|
+
|
|
168
|
+
// The regexp pattern or array of patterns that Jest uses to detect test files
|
|
169
|
+
// testRegex: [],
|
|
170
|
+
|
|
171
|
+
// This option allows the use of a custom results processor
|
|
172
|
+
// testResultsProcessor: undefined,
|
|
173
|
+
|
|
174
|
+
// This option allows use of a custom test runner
|
|
175
|
+
// testRunner: "jasmine2",
|
|
176
|
+
|
|
177
|
+
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
|
|
178
|
+
// testURL: "http://localhost",
|
|
179
|
+
|
|
180
|
+
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
|
181
|
+
// timers: "real",
|
|
182
|
+
|
|
183
|
+
// A map from regular expressions to paths to transformers
|
|
184
|
+
// transform: undefined,
|
|
185
|
+
|
|
186
|
+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
|
187
|
+
transformIgnorePatterns: [`/node_modules/(?!${esModules.join('|')})`],
|
|
188
|
+
// transformIgnorePatterns: [
|
|
189
|
+
// "/node_modules/",
|
|
190
|
+
// "\\.pnp\\.[^\\/]+$"
|
|
191
|
+
// ],
|
|
192
|
+
|
|
193
|
+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
194
|
+
// unmockedModulePathPatterns: undefined,
|
|
195
|
+
|
|
196
|
+
// Indicates whether each individual test should be reported during the run
|
|
197
|
+
// verbose: undefined,
|
|
198
|
+
|
|
199
|
+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
|
200
|
+
// watchPathIgnorePatterns: [],
|
|
201
|
+
|
|
202
|
+
// Whether to use watchman for file crawling
|
|
203
|
+
// watchman: true,
|
|
204
|
+
};
|
package/jest.setup.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@spinnaker/kayenta",
|
|
3
|
+
"version": "0.0.0-2025.1-0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/spinnaker/deck-kayenta.git"
|
|
8
|
+
},
|
|
9
|
+
"module": "build/dist/index.js",
|
|
10
|
+
"typings": "build/dist/index.d.ts",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20.19.4",
|
|
13
|
+
"npm": ">=10.8.2",
|
|
14
|
+
"yarn": ">=1.21.1"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "npm run clean && NODE_ENV=production rollup -c",
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --runInBand",
|
|
20
|
+
"prepublishOnly": "npm run build",
|
|
21
|
+
"format": "prettier --write 'src/**/*.{ts,tsx,less}'",
|
|
22
|
+
"clean": "npx shx rm -rf build",
|
|
23
|
+
"lint": "eslint --ext js,jsx,ts,tsx src",
|
|
24
|
+
"develop": "npm run clean && run-p watch proxy",
|
|
25
|
+
"postinstall": "check-plugin && check-peer-dependencies || true",
|
|
26
|
+
"prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx,html,css,less,json}'",
|
|
27
|
+
"prettier:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx,html,css,less,json}'",
|
|
28
|
+
"proxy": "dev-proxy",
|
|
29
|
+
"watch": "rollup -c -w --no-watch.clearScreen"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@uirouter/core": "6.0.4",
|
|
33
|
+
"@uirouter/react": "1.0.2",
|
|
34
|
+
"@uirouter/react-hybrid": "1.0.2",
|
|
35
|
+
"angular-ui-bootstrap": "^2.5.0",
|
|
36
|
+
"ansi_up": "^5.0.0",
|
|
37
|
+
"bootstrap": "3.4.1",
|
|
38
|
+
"class-autobind-decorator": "^2.2.1",
|
|
39
|
+
"human-readable-ids": "^1.0.4",
|
|
40
|
+
"lodash": "4.17.21",
|
|
41
|
+
"lodash-decorators": "4.5.0",
|
|
42
|
+
"lodash-es": "4.17.21",
|
|
43
|
+
"memoize-one": "^4.0.2",
|
|
44
|
+
"ngimport": "^0.6.0",
|
|
45
|
+
"react": "~16.14.0",
|
|
46
|
+
"react-ace": "^6.1.4",
|
|
47
|
+
"react-bootstrap": "^0.32.1",
|
|
48
|
+
"react-bootstrap-typeahead": "^3.2.4",
|
|
49
|
+
"react-container-dimensions": "^1.4.1",
|
|
50
|
+
"react-day-picker": "^7.3.0",
|
|
51
|
+
"react-dom": "~16.14.0",
|
|
52
|
+
"react-ga": "^2.4.1",
|
|
53
|
+
"react-redux": "^5.0.7",
|
|
54
|
+
"react-sortable-hoc": "^0.6.8",
|
|
55
|
+
"react-spring": "^8.0.27",
|
|
56
|
+
"react-tether": "^1.0.5",
|
|
57
|
+
"react-tooltip": "^3.10.0",
|
|
58
|
+
"react-ultimate-pagination": "^1.2.0",
|
|
59
|
+
"react-virtualized-select": "^3.1.3",
|
|
60
|
+
"recoil": "^0.0.10",
|
|
61
|
+
"redux": "^3.7.2",
|
|
62
|
+
"redux-actions": "^2.2.1",
|
|
63
|
+
"redux-logger": "^3.0.6",
|
|
64
|
+
"redux-observable": "^0.14.1",
|
|
65
|
+
"reselect": "^3.0.1",
|
|
66
|
+
"rxjs": "^5.4.2",
|
|
67
|
+
"semiotic": "1.20.6",
|
|
68
|
+
"spel2js": "^0.2.6",
|
|
69
|
+
"ui-select": "^0.19.6"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@apollo/client": "^3.3.15",
|
|
73
|
+
"@babel/preset-env": "^7.13.12",
|
|
74
|
+
"@babel/preset-react": "^7.13.13",
|
|
75
|
+
"@babel/preset-typescript": "^7.13.0",
|
|
76
|
+
"@rollup/plugin-commonjs": "18.0.0",
|
|
77
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
78
|
+
"@rollup/plugin-node-resolve": "11.2.1",
|
|
79
|
+
"@rollup/plugin-replace": "^2.4.2",
|
|
80
|
+
"@rollup/plugin-typescript": "8.2.1",
|
|
81
|
+
"@rollup/plugin-url": "6.0.0",
|
|
82
|
+
"@spinnaker/core": "0.0.571",
|
|
83
|
+
"@spinnaker/eslint-plugin": "1.0.13",
|
|
84
|
+
"@spinnaker/pluginsdk": "0.0.30",
|
|
85
|
+
"@spinnaker/pluginsdk-peerdeps": "0.0.14",
|
|
86
|
+
"@spinnaker/presentation": "0.0.4",
|
|
87
|
+
"@types/angular": "1.6.26",
|
|
88
|
+
"@types/angular-mocks": "1.5.10",
|
|
89
|
+
"@types/angular-ui-bootstrap": "^0.13.41",
|
|
90
|
+
"@types/classnames": "^2.2.0",
|
|
91
|
+
"@types/d3-array": "^2.0.0",
|
|
92
|
+
"@types/d3-format": "^1.3.1",
|
|
93
|
+
"@types/d3-scale": "^2.1.1",
|
|
94
|
+
"@types/d3-shape": "^1.3.1",
|
|
95
|
+
"@types/enzyme": "^3.10.3",
|
|
96
|
+
"@types/enzyme-redux": "^0.2.1",
|
|
97
|
+
"@types/jest": "^26.0.22",
|
|
98
|
+
"@types/lodash": "^4.14.64",
|
|
99
|
+
"@types/luxon": "1.11.1",
|
|
100
|
+
"@types/marked": "^0.0.28",
|
|
101
|
+
"@types/node": "7.0.5",
|
|
102
|
+
"@types/prop-types": "^15.5.2",
|
|
103
|
+
"@types/react": "~16.8.0",
|
|
104
|
+
"@types/react-bootstrap": "^0.32.5",
|
|
105
|
+
"@types/react-bootstrap-typeahead": "^3.2.1",
|
|
106
|
+
"@types/react-dom": "~16.8.0",
|
|
107
|
+
"@types/react-redux": "^5.0.15",
|
|
108
|
+
"@types/react-select": "^1.2.4",
|
|
109
|
+
"@types/react-tooltip": "^3.9.2",
|
|
110
|
+
"@types/redux-actions": "^2.2.0",
|
|
111
|
+
"@types/redux-logger": "^3.0.3",
|
|
112
|
+
"@types/redux-test-utils": "^0.2.0",
|
|
113
|
+
"@typescript-eslint/eslint-plugin": "4.4.0",
|
|
114
|
+
"@typescript-eslint/parser": "4.4.0",
|
|
115
|
+
"@uirouter/rx": "0.6.5",
|
|
116
|
+
"angular-messages": "1.6.10",
|
|
117
|
+
"angular-sanitize": "1.6.10",
|
|
118
|
+
"angular-spinner": "^1.0.1",
|
|
119
|
+
"angular-ui-sortable": "^0.17.0",
|
|
120
|
+
"angular2react": "^3.0.2",
|
|
121
|
+
"angulartics": "^1.1.2",
|
|
122
|
+
"angulartics-google-analytics": "^0.2.0",
|
|
123
|
+
"bufferutil": "4.0.2",
|
|
124
|
+
"cachefactory": "^3.0.0",
|
|
125
|
+
"clipboard": "^1.5.12",
|
|
126
|
+
"commonmark": "^0.28.1",
|
|
127
|
+
"date-fns": "^1.30.1",
|
|
128
|
+
"dompurify": "^2.0.17",
|
|
129
|
+
"enzyme": "^3.10.0",
|
|
130
|
+
"enzyme-adapter-react-16": "1.15.1",
|
|
131
|
+
"enzyme-redux": "^0.2.1",
|
|
132
|
+
"eslint": "7.10.0",
|
|
133
|
+
"eslint-config-prettier": "6.12.0",
|
|
134
|
+
"eslint-plugin-react-hooks": "4.1.2",
|
|
135
|
+
"graphql": "^15.5.0",
|
|
136
|
+
"jest": "^26.6.3",
|
|
137
|
+
"jquery": "3.5.1",
|
|
138
|
+
"jquery-textcomplete": "1.6.1",
|
|
139
|
+
"jquery-ui": "1.13.2",
|
|
140
|
+
"js-worker-search": "^1.2.1",
|
|
141
|
+
"license-checker": "^15.0.0",
|
|
142
|
+
"luxon": "1.28.1",
|
|
143
|
+
"npm-run-all": "4.1.5",
|
|
144
|
+
"prettier": "2.1.2",
|
|
145
|
+
"pretty-quick": "3.1.0",
|
|
146
|
+
"prop-types": "15.6.1",
|
|
147
|
+
"react-toastify": "^7.0.4",
|
|
148
|
+
"react2angular": "^3.2.1",
|
|
149
|
+
"redux-test-utils": "^0.3.0",
|
|
150
|
+
"rollup": "2.45.2",
|
|
151
|
+
"rollup-plugin-external-globals": "0.6.1",
|
|
152
|
+
"rollup-plugin-less": "1.1.3",
|
|
153
|
+
"rollup-plugin-postcss": "3.1.8",
|
|
154
|
+
"rollup-plugin-terser": "7.0.2",
|
|
155
|
+
"rollup-plugin-visualizer": "5.4.1",
|
|
156
|
+
"shx": "0.3.3",
|
|
157
|
+
"typescript": "^4.0.0",
|
|
158
|
+
"utf-8-validate": "5.0.3"
|
|
159
|
+
},
|
|
160
|
+
"optionalDependencies": {
|
|
161
|
+
"fsevents": "2.3.3"
|
|
162
|
+
},
|
|
163
|
+
"publishConfig": {
|
|
164
|
+
"registry": "https://registry.npmjs.org"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
import MagicString from 'magic-string';
|
|
4
|
+
|
|
5
|
+
// This rollup plugin finds AngularJS templates and loads them into the $templateCache
|
|
6
|
+
// This is a rollup replacement for the ngtemplate-loader webpack loader
|
|
7
|
+
export default function angularJsTemplateLoader(options = {}) {
|
|
8
|
+
function isSourceMapEnabled() {
|
|
9
|
+
return options.sourceMap !== false && options.sourcemap !== false;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
transform(originalCode, id) {
|
|
14
|
+
let code = originalCode;
|
|
15
|
+
|
|
16
|
+
// look for things like templateUrl: require('./template.html')
|
|
17
|
+
if (!code.includes('Url: require')) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!fs.existsSync(id)) {
|
|
22
|
+
throw new Error('Unable to load AngularJS template; could not find source file ' + id);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Find the directory the JS source file is in
|
|
26
|
+
const baseDir = fs.lstatSync(id).isDirectory() ? id : path.dirname(id);
|
|
27
|
+
const templateRegex = /Url: require\(['"]([^'"]+\.html)['"]\)/g;
|
|
28
|
+
|
|
29
|
+
let match = templateRegex.exec(code);
|
|
30
|
+
if (!match) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let magicString = new MagicString(code);
|
|
35
|
+
|
|
36
|
+
while (match) {
|
|
37
|
+
// i.e., './template.html'
|
|
38
|
+
const templatePath = match[1];
|
|
39
|
+
// Absolute path to the actual template.html file
|
|
40
|
+
const contentPath = path.resolve(baseDir, templatePath);
|
|
41
|
+
if (!fs.existsSync(contentPath)) {
|
|
42
|
+
throw new Error('Unable to load AngularJS template; could not find template file ' + contentPath);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const startIdx = match.index;
|
|
46
|
+
const endIdx = startIdx + match[0].length;
|
|
47
|
+
|
|
48
|
+
// read the contents of template.html
|
|
49
|
+
const content = fs.readFileSync(contentPath, { encoding: 'UTF8' }).replace(/`/g, '\\`');
|
|
50
|
+
|
|
51
|
+
// Replace: templateUrl: require('./template.html')
|
|
52
|
+
// With: templateUrl: './template.html'
|
|
53
|
+
magicString.overwrite(startIdx, endIdx, `Url: '${templatePath}'`);
|
|
54
|
+
|
|
55
|
+
// Append a run block that adds the HTML content into the $templateCache (used by angularjs when loading templates)
|
|
56
|
+
magicString.append(`
|
|
57
|
+
|
|
58
|
+
/*********************************************************************
|
|
59
|
+
* angularjs-template-loader rollup plugin -- ${templatePath} start *
|
|
60
|
+
********************************************************************/
|
|
61
|
+
|
|
62
|
+
window.angular.module('ng').run(['$templateCache', function(templateCache) {
|
|
63
|
+
templateCache.put('${templatePath}',
|
|
64
|
+
\`${content}\`)
|
|
65
|
+
}]);
|
|
66
|
+
|
|
67
|
+
/*********************************************************************
|
|
68
|
+
* angularjs-template-loader rollup plugin -- ${templatePath} end *
|
|
69
|
+
********************************************************************/
|
|
70
|
+
`);
|
|
71
|
+
// look for another match
|
|
72
|
+
match = templateRegex.exec(code);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isSourceMapEnabled()) {
|
|
76
|
+
return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) };
|
|
77
|
+
} else {
|
|
78
|
+
return { code: magicString.toString() };
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This rollup config uses the pluginsdk config as a base but this is not a plugin
|
|
2
|
+
|
|
3
|
+
import angularJsTemplateLoader from './rollup-plugin-angularjs-template-loader';
|
|
4
|
+
const basePluginConfig = require('@spinnaker/pluginsdk/pluginconfig/rollup.config');
|
|
5
|
+
|
|
6
|
+
basePluginConfig.plugins = basePluginConfig.plugins.filter((x) => x.name !== 'rollup-plugin-external-globals');
|
|
7
|
+
basePluginConfig.plugins.push(angularJsTemplateLoader({ sourceMap: true }));
|
|
8
|
+
|
|
9
|
+
const externals = [
|
|
10
|
+
'angular',
|
|
11
|
+
'@spinnaker/core',
|
|
12
|
+
'@uirouter/react',
|
|
13
|
+
'@uirouter/core',
|
|
14
|
+
'formik',
|
|
15
|
+
'lodash',
|
|
16
|
+
'luxon',
|
|
17
|
+
'prop-types',
|
|
18
|
+
'react',
|
|
19
|
+
'react-bootstrap',
|
|
20
|
+
'react-select',
|
|
21
|
+
'react-dom',
|
|
22
|
+
'semiotic',
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
basePluginConfig.input = 'src/index.ts';
|
|
26
|
+
basePluginConfig.external = function (id) {
|
|
27
|
+
return externals.includes(id);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default basePluginConfig;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICanaryConfig,
|
|
3
|
+
ICanaryConfigSummary,
|
|
4
|
+
ICanaryExecutionStatusResult,
|
|
5
|
+
ICanaryMetricConfig,
|
|
6
|
+
ICanaryMetricEffectSizeConfig,
|
|
7
|
+
IJudge,
|
|
8
|
+
IKayentaAccount,
|
|
9
|
+
IMetricSetPair,
|
|
10
|
+
IMetricsServiceMetadata,
|
|
11
|
+
MetricClassificationLabel,
|
|
12
|
+
} from 'kayenta/domain';
|
|
13
|
+
import { ConfigJsonModalTabState } from 'kayenta/edit/configJsonModal';
|
|
14
|
+
import { IUpdateListPayload } from 'kayenta/layout/list';
|
|
15
|
+
import { GraphType } from 'kayenta/report/detail/graph/metricSetPairGraph.service';
|
|
16
|
+
import { Action } from 'redux';
|
|
17
|
+
import { createAction } from 'redux-actions';
|
|
18
|
+
|
|
19
|
+
import * as Actions from './index';
|
|
20
|
+
import { IUpdateKeyValueListPayload } from '../layout/keyValueList';
|
|
21
|
+
import { IPrometheusCanaryMetricSetQueryConfig } from '../metricStore/prometheus/domain/IPrometheusCanaryMetricSetQueryConfig';
|
|
22
|
+
import { IStackdriverCanaryMetricSetQueryConfig } from '../metricStore/stackdriver/domain/IStackdriverCanaryMetricSetQueryConfig';
|
|
23
|
+
|
|
24
|
+
export interface IKayentaAction<T> extends Action {
|
|
25
|
+
payload: T;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const toggleMetricClassificationFilter = createAction<{ classification: MetricClassificationLabel }>(
|
|
29
|
+
Actions.TOGGLE_METRIC_CLASSIFICATION_FILTER,
|
|
30
|
+
);
|
|
31
|
+
export const setExecutionsCount = createAction<{ count: number }>(Actions.SET_EXECUTIONS_COUNT);
|
|
32
|
+
export const openDeleteConfigModal = createAction(Actions.DELETE_CONFIG_MODAL_OPEN);
|
|
33
|
+
export const closeDeleteConfigModal = createAction(Actions.DELETE_CONFIG_MODAL_CLOSE);
|
|
34
|
+
export const deleteConfig = createAction(Actions.DELETE_CONFIG_REQUEST);
|
|
35
|
+
export const closeConfigJsonModal = createAction(Actions.CONFIG_JSON_MODAL_CLOSE);
|
|
36
|
+
export const openConfigJsonModal = createAction(Actions.CONFIG_JSON_MODAL_OPEN);
|
|
37
|
+
export const editMetricCancel = createAction(Actions.EDIT_METRIC_CANCEL);
|
|
38
|
+
export const editMetricConfirm = createAction(Actions.EDIT_METRIC_CONFIRM);
|
|
39
|
+
export const updateMetricDirection = createAction<{ id: string; direction: string }>(Actions.UPDATE_METRIC_DIRECTION);
|
|
40
|
+
export const updateMetricNanStrategy = createAction<{ id: string; strategy: string }>(
|
|
41
|
+
Actions.UPDATE_METRIC_NAN_STRATEGY,
|
|
42
|
+
);
|
|
43
|
+
export const updateMetricOutlierStrategy = createAction<{ id: string; strategy: string }>(
|
|
44
|
+
Actions.UPDATE_METRIC_OUTLIER_STRATEGY,
|
|
45
|
+
);
|
|
46
|
+
export const updateMetricCriticality = createAction<{ id: string; critical: boolean }>(
|
|
47
|
+
Actions.UPDATE_METRIC_CRITICALITY,
|
|
48
|
+
);
|
|
49
|
+
export const updateMetricDataRequired = createAction<{ id: string; mustHaveData: boolean }>(
|
|
50
|
+
Actions.UPDATE_METRIC_DATA_REQUIRED,
|
|
51
|
+
);
|
|
52
|
+
export const updateEffectSize = createAction<{ id: string; value: ICanaryMetricEffectSizeConfig }>(
|
|
53
|
+
Actions.UPDATE_EFFECT_SIZE,
|
|
54
|
+
);
|
|
55
|
+
export const updateMetricGroup = createAction<{ id: string; group: string }>(Actions.UPDATE_METRIC_GROUP);
|
|
56
|
+
export const addGroup = createAction(Actions.ADD_GROUP);
|
|
57
|
+
export const saveConfig = createAction(Actions.SAVE_CONFIG_REQUEST);
|
|
58
|
+
export const dismissSaveConfigError = createAction(Actions.DISMISS_SAVE_CONFIG_ERROR);
|
|
59
|
+
export const setConfigJsonModalTabState = createAction<{ state: ConfigJsonModalTabState }>(
|
|
60
|
+
Actions.SET_CONFIG_JSON_MODAL_TAB_STATE,
|
|
61
|
+
);
|
|
62
|
+
export const setConfigJson = createAction<{ json: string }>(Actions.SET_CONFIG_JSON);
|
|
63
|
+
export const deleteConfigSuccess = createAction(Actions.DELETE_CONFIG_SUCCESS);
|
|
64
|
+
export const loadConfigRequest = createAction<{ id: string }>(Actions.LOAD_CONFIG_REQUEST);
|
|
65
|
+
export const saveConfigSuccess = createAction<{ id: string }>(Actions.SAVE_CONFIG_SUCCESS);
|
|
66
|
+
export const selectConfig = createAction<{ config: ICanaryConfig }>(Actions.SELECT_CONFIG);
|
|
67
|
+
export const clearSelectedConfig = createAction(Actions.CLEAR_SELECTED_CONFIG);
|
|
68
|
+
export const renameMetric = createAction<{ id: string; name: string }>(Actions.RENAME_METRIC);
|
|
69
|
+
export const selectGroup = createAction<{ name: string }>(Actions.SELECT_GROUP);
|
|
70
|
+
export const updateGroupWeight = createAction<{ group: string; weight: number }>(Actions.UPDATE_GROUP_WEIGHT);
|
|
71
|
+
export const selectJudgeName = createAction<{ judge: { name: string } }>(Actions.SELECT_JUDGE_NAME);
|
|
72
|
+
export const editMetricBegin = createAction<{ id: string }>(Actions.EDIT_METRIC_BEGIN);
|
|
73
|
+
export const removeMetric = createAction<{ id: string }>(Actions.REMOVE_METRIC);
|
|
74
|
+
export const addMetric = createAction<{ metric: ICanaryMetricConfig }>(Actions.ADD_METRIC);
|
|
75
|
+
export const updateConfigName = createAction<{ name: string }>(Actions.UPDATE_CONFIG_NAME);
|
|
76
|
+
export const updateConfigDescription = createAction<{ description: string }>(Actions.UPDATE_CONFIG_DESCRIPTION);
|
|
77
|
+
export const saveConfigFailure = createAction<{ error: Error }>(Actions.SAVE_CONFIG_FAILURE);
|
|
78
|
+
export const deleteConfigFailure = createAction<{ error: Error }>(Actions.DELETE_CONFIG_FAILURE);
|
|
79
|
+
export const updateConfigSummaries = createAction<{ configSummaries: ICanaryConfigSummary[] }>(
|
|
80
|
+
Actions.UPDATE_CONFIG_SUMMARIES,
|
|
81
|
+
);
|
|
82
|
+
export const updateJudges = createAction<{ judges: IJudge[] }>(Actions.UPDATE_JUDGES);
|
|
83
|
+
export const loadConfigSuccess = createAction<{ config: ICanaryConfig }>(Actions.LOAD_CONFIG_SUCCESS);
|
|
84
|
+
export const loadConfigFailure = createAction<{ error: Error }>(Actions.LOAD_CONFIG_FAILURE);
|
|
85
|
+
export const copySelectedConfig = createAction(Actions.COPY_SELECTED_CONFIG);
|
|
86
|
+
export const createNewConfig = createAction(Actions.CREATE_NEW_CONFIG);
|
|
87
|
+
export const editGroupBegin = createAction<{ group: string }>(Actions.EDIT_GROUP_BEGIN);
|
|
88
|
+
export const editGroupUpdate = createAction<{ edit: string }>(Actions.EDIT_GROUP_UPDATE);
|
|
89
|
+
export const editGroupConfirm = createAction<{ group: string; edit: string }>(Actions.EDIT_GROUP_CONFIRM);
|
|
90
|
+
export const changeMetricGroupSelect = createAction<{ group: string }>(Actions.CHANGE_METRIC_GROUP_SELECT);
|
|
91
|
+
export const changeMetricGroupConfirm = createAction<{ metricId: string }>(Actions.CHANGE_METRIC_GROUP_CONFIRM);
|
|
92
|
+
export const loadRunRequest = createAction<{ configId: string; runId: string }>(Actions.LOAD_RUN_REQUEST);
|
|
93
|
+
export const loadRunSuccess = createAction<{ run: ICanaryExecutionStatusResult }>(Actions.LOAD_RUN_SUCCESS);
|
|
94
|
+
export const loadRunFailure = createAction<{ error: Error }>(Actions.LOAD_RUN_FAILURE);
|
|
95
|
+
export const selectReportMetricGroup = createAction<{ group: string }>(Actions.SELECT_REPORT_METRIC_GROUP);
|
|
96
|
+
export const selectReportMetric = createAction<{ metricId: string }>(Actions.SELECT_REPORT_METRIC);
|
|
97
|
+
export const loadMetricSetPairRequest = createAction<{ pairId: string }>(Actions.LOAD_METRIC_SET_PAIR_REQUEST);
|
|
98
|
+
export const loadMetricSetPairSuccess = createAction<{ metricSetPair: IMetricSetPair }>(
|
|
99
|
+
Actions.LOAD_METRIC_SET_PAIR_SUCCESS,
|
|
100
|
+
);
|
|
101
|
+
export const loadMetricSetPairFailure = createAction<{ error: Error }>(Actions.LOAD_METRIC_SET_PAIR_FAILURE);
|
|
102
|
+
export const addTemplate = createAction(Actions.ADD_TEMPLATE);
|
|
103
|
+
export const editTemplateBegin = createAction<{ name: string; value: string }>(Actions.EDIT_TEMPLATE_BEGIN);
|
|
104
|
+
export const editTemplateConfirm = createAction(Actions.EDIT_TEMPLATE_CONFIRM);
|
|
105
|
+
export const editTemplateCancel = createAction(Actions.EDIT_TEMPLATE_CANCEL);
|
|
106
|
+
export const editTemplateName = createAction<{ name: string }>(Actions.EDIT_TEMPLATE_NAME);
|
|
107
|
+
export const editTemplateValue = createAction<{ value: string }>(Actions.EDIT_TEMPLATE_VALUE);
|
|
108
|
+
export const editInlineTemplate = createAction<{ value: string }>(Actions.EDIT_INLINE_TEMPLATE);
|
|
109
|
+
export const updatePrometheusLabelBindings = createAction<IUpdateListPayload>(Actions.UPDATE_PROMETHEUS_LABEL_BINDINGS);
|
|
110
|
+
export const updatePrometheusGroupBy = createAction<IUpdateListPayload>(Actions.UPDATE_PROMETHEUS_GROUP_BY_FIELDS);
|
|
111
|
+
export const updatePrometheusMetricQueryField = createAction<{
|
|
112
|
+
field: keyof IPrometheusCanaryMetricSetQueryConfig;
|
|
113
|
+
value: IPrometheusCanaryMetricSetQueryConfig[keyof IPrometheusCanaryMetricSetQueryConfig];
|
|
114
|
+
}>(Actions.UPDATE_PROMETHEUS_METRIC_QUERY_FIELD);
|
|
115
|
+
export const updateStackdriverGroupBy = createAction<IUpdateListPayload>(Actions.UPDATE_STACKDRIVER_GROUP_BY_FIELDS);
|
|
116
|
+
export const deleteTemplate = createAction<{ name: string }>(Actions.DELETE_TEMPLATE);
|
|
117
|
+
export const selectTemplate = createAction<{ name: string }>(Actions.SELECT_TEMPLATE);
|
|
118
|
+
export const changeMetricGroup = createAction<{ id: string }>(Actions.CHANGE_METRIC_GROUP);
|
|
119
|
+
export const loadMetricsServiceMetadataRequest = createAction<{ filter: string; metricsAccountName: string }>(
|
|
120
|
+
Actions.LOAD_METRICS_SERVICE_METADATA_REQUEST,
|
|
121
|
+
);
|
|
122
|
+
export const loadMetricsServiceMetadataSuccess = createAction<{ data: IMetricsServiceMetadata }>(
|
|
123
|
+
Actions.LOAD_METRICS_SERVICE_METADATA_SUCCESS,
|
|
124
|
+
);
|
|
125
|
+
export const loadMetricsServiceMetadataFailure = createAction<{ error: Error }>(
|
|
126
|
+
Actions.LOAD_METRICS_SERVICE_METADATA_FAILURE,
|
|
127
|
+
);
|
|
128
|
+
export const updatePrometheusMetricDescriptorFilter = createAction<{ filter: string; metricsAccountName: string }>(
|
|
129
|
+
Actions.UPDATE_PROMETHEUS_METRIC_DESCRIPTOR_FILTER,
|
|
130
|
+
);
|
|
131
|
+
export const updateGraphiteMetricDescriptorFilter = createAction<{ filter: string }>(
|
|
132
|
+
Actions.UPDATE_GRAPHITE_METRIC_DESCRIPTOR_FILTER,
|
|
133
|
+
);
|
|
134
|
+
export const updateStackdriverMetricDescriptorFilter = createAction<{ filter: string }>(
|
|
135
|
+
Actions.UPDATE_STACKDRIVER_METRIC_DESCRIPTOR_FILTER,
|
|
136
|
+
);
|
|
137
|
+
export const updateDatadogMetricDescriptorFilter = createAction<{ filter: string }>(
|
|
138
|
+
Actions.UPDATE_DATADOG_METRIC_DESCRIPTOR_FILTER,
|
|
139
|
+
);
|
|
140
|
+
export const updateStackdriverMetricResourceField = createAction<{
|
|
141
|
+
field: keyof IStackdriverCanaryMetricSetQueryConfig;
|
|
142
|
+
value: IStackdriverCanaryMetricSetQueryConfig[keyof IStackdriverCanaryMetricSetQueryConfig];
|
|
143
|
+
}>(Actions.UPDATE_STACKDRIVER_METRIC_QUERY_FIELD);
|
|
144
|
+
export const updateDatadogMetricName = createAction<{ metricName: string }>(Actions.UPDATE_DATADOG_METRIC_NAME);
|
|
145
|
+
export const updateNewRelicSelect = createAction<{ select: string }>(Actions.UPDATE_NEWRELIC_SELECT);
|
|
146
|
+
export const loadExecutionsRequest = createAction(Actions.LOAD_EXECUTIONS_REQUEST);
|
|
147
|
+
export const loadExecutionsFailure = createAction<{ error: Error }>(Actions.LOAD_EXECUTIONS_FAILURE);
|
|
148
|
+
export const loadExecutionsSuccess = createAction<{ executions: ICanaryExecutionStatusResult[] }>(
|
|
149
|
+
Actions.LOAD_EXECUTIONS_SUCCESS,
|
|
150
|
+
);
|
|
151
|
+
export const selectGraphType = createAction<{ type: GraphType }>(Actions.SELECT_GRAPH_TYPE);
|
|
152
|
+
export const loadKayentaAccountsRequest = createAction(Actions.LOAD_KAYENTA_ACCOUNTS_REQUEST);
|
|
153
|
+
export const loadKayentaAccountsSuccess = createAction<{ accounts: IKayentaAccount[] }>(
|
|
154
|
+
Actions.LOAD_KAYENTA_ACCOUNTS_SUCCESS,
|
|
155
|
+
);
|
|
156
|
+
export const loadKayentaAccountsFailure = createAction<{ error: Error }>(Actions.LOAD_KAYENTA_ACCOUNTS_FAILURE);
|
|
157
|
+
export const selectMetricStore = createAction<{ store: string }>(Actions.SELECT_METRIC_STORE);
|
|
158
|
+
export const updateSignalFxMetricName = createAction<{ metricName: string }>(Actions.UPDATE_SIGNAL_FX_METRIC_NAME);
|
|
159
|
+
export const updateSignalFxAggregationMethod = createAction<{ aggregationMethod: string }>(
|
|
160
|
+
Actions.UPDATE_SIGNAL_FX_AGGREGATION_METHOD,
|
|
161
|
+
);
|
|
162
|
+
export const updateSignalFxQueryPairs = createAction<IUpdateKeyValueListPayload>(Actions.UPDATE_SIGNAL_FX_QUERY_PAIRS);
|
|
163
|
+
export const updateGraphiteMetricName = createAction<{ metricName: string }>(Actions.UPDATE_GRAPHITE_METRIC_NAME);
|