diff --git a/internal/pkg/project/ignore/ignore.go b/internal/pkg/project/ignore/ignore.go index 731b9349b2..007dd50a84 100644 --- a/internal/pkg/project/ignore/ignore.go +++ b/internal/pkg/project/ignore/ignore.go @@ -3,11 +3,18 @@ package ignore import ( "strings" + "github.com/keboola/keboola-as-code/internal/pkg/model" "github.com/keboola/keboola-as-code/internal/pkg/utils/errors" + "github.com/keboola/keboola-sdk-go/v2/pkg/keboola" ) +// IgnoreConfigsOrRows applies ignore patterns and validates that no orchestrators reference ignored configs. +// Returns an error listing orchestrators that need to be explicitly added to .kbcignore. func (f *File) IgnoreConfigsOrRows() error { - return f.applyIgnoredPatterns() + if err := f.applyIgnoredPatterns(); err != nil { + return err + } + return f.validateOrchestratorDependencies() } // applyIgnoredPatterns parses the content for ignore patterns and applies them to configurations or rows. @@ -53,3 +60,121 @@ func (f *File) applyIgnorePattern(ignoreConfig string) error { return nil } + +// validateOrchestratorDependencies checks if any non-ignored configs with reverse dependencies +// (orchestrators, schedulers, input mappings, etc.) reference ignored configs. +// Returns an error instructing the user to explicitly add those dependent configs to .kbcignore. +func (f *File) validateOrchestratorDependencies() error { + errs := errors.NewMultiError() + + // Build map of ignored config IDs for quick lookup + ignoredConfigs := make(map[string]bool) + for _, cfg := range f.state.IgnoredConfigs() { + ignoredConfigs[cfg.ID.String()] = true + } + + // Relation types where the "owner" config (the one with the relation) depends on the "target" config + // If target is ignored, owner should also be ignored + reverseDependencyRelations := []model.RelationType{ + model.UsedInOrchestratorRelType, // Orchestrator tasks reference other configs + model.UsedInConfigInputMappingRelType, // Config input mappings reference source configs + model.UsedInRowInputMappingRelType, // Row input mappings reference source configs + model.SchedulerForRelType, // Schedulers reference target configs to run + } + + // Check each config for reverse dependency relations + for _, targetCfg := range f.state.Configs() { + // Skip if this config is not ignored (only care about ignored configs being referenced) + if !ignoredConfigs[targetCfg.ID.String()] { + continue + } + + // Check each reverse dependency relation type + for _, relType := range reverseDependencyRelations { + rels := targetCfg.Relations.GetByType(relType) + for _, r := range rels { + // Extract the dependent config ID from the relation + dependentConfigID := f.extractDependentConfigID(r) + if dependentConfigID == "" { + continue + } + + // Find the dependent config in the registry + dependentCfg := f.findConfigByID(targetCfg.BranchID, dependentConfigID) + if dependentCfg == nil { + continue + } + + // If dependent config is NOT ignored but references an ignored config, report error + if !dependentCfg.Ignore { + dependentPath := dependentCfg.Path() + if dependentPath == "" { + dependentPath = dependentCfg.ConfigKey.Desc() + } + targetPath := targetCfg.Path() + if targetPath == "" { + targetPath = targetCfg.ConfigKey.Desc() + } + + relTypeDesc := f.getRelationTypeDescription(relType) + errs.Append(errors.Errorf( + "%s %q references ignored config %q, please add it to .kbcignore:\n %s/%s", + relTypeDesc, + dependentPath, + targetPath, + dependentCfg.ComponentID, + dependentCfg.ID, + )) + } + } + } + } + + if errs.Len() > 0 { + return errors.PrefixError(errs, "configurations with dependencies reference ignored configurations") + } + return nil +} + +// extractDependentConfigID extracts the config ID of the dependent config from a relation. +// Returns empty string if the relation doesn't contain a config ID reference. +func (f *File) extractDependentConfigID(rel model.Relation) string { + switch r := rel.(type) { + case *model.UsedInOrchestratorRelation: + return r.ConfigID.String() + case *model.SchedulerForRelation: + return r.ConfigID.String() + case *model.UsedInConfigInputMappingRelation: + return r.UsedIn.ID.String() + case *model.UsedInRowInputMappingRelation: + return r.UsedIn.ConfigID.String() + default: + return "" + } +} + +// findConfigByID finds a config by ID within the same branch. +func (f *File) findConfigByID(branchID keboola.BranchID, configID string) *model.ConfigState { + for _, cfg := range f.state.Configs() { + if cfg.BranchID == branchID && cfg.ID.String() == configID { + return cfg + } + } + return nil +} + +// getRelationTypeDescription returns a human-readable description of the relation type. +func (f *File) getRelationTypeDescription(relType model.RelationType) string { + switch relType { + case model.UsedInOrchestratorRelType: + return "orchestrator" + case model.SchedulerForRelType: + return "scheduler" + case model.UsedInConfigInputMappingRelType: + return "config with input mapping" + case model.UsedInRowInputMappingRelType: + return "config row with input mapping" + default: + return "configuration" + } +} diff --git a/pkg/lib/operation/project/sync/pull/operation.go b/pkg/lib/operation/project/sync/pull/operation.go index 3204de6df3..ed4bcf3474 100644 --- a/pkg/lib/operation/project/sync/pull/operation.go +++ b/pkg/lib/operation/project/sync/pull/operation.go @@ -63,7 +63,7 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen return err } - ignoreConfigsAndRows(projectState) + IgnoreConfigsAndRows(projectState) } // Diff @@ -152,7 +152,9 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen return nil } -func ignoreConfigsAndRows(projectState *project.State) { +// IgnoreConfigsAndRows clears remote state of ignored configs/rows so they behave as absent. +// Exported to reuse in push operation as well. +func IgnoreConfigsAndRows(projectState *project.State) { for _, v := range projectState.IgnoredConfigRows() { v.SetRemoteState(nil) } diff --git a/pkg/lib/operation/project/sync/push/operation.go b/pkg/lib/operation/project/sync/push/operation.go index 39950fef66..fd0685e608 100644 --- a/pkg/lib/operation/project/sync/push/operation.go +++ b/pkg/lib/operation/project/sync/push/operation.go @@ -15,6 +15,7 @@ import ( "github.com/keboola/keboola-as-code/pkg/lib/operation/project/local/encrypt" "github.com/keboola/keboola-as-code/pkg/lib/operation/project/local/validate" createDiff "github.com/keboola/keboola-as-code/pkg/lib/operation/project/sync/diff/create" + pullop "github.com/keboola/keboola-as-code/pkg/lib/operation/project/sync/pull" ) type Options struct { @@ -76,6 +77,9 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen if err = file.IgnoreConfigsOrRows(); err != nil { return err } + + // Also propagate ignore to orchestrators referencing ignored configs + pullop.IgnoreConfigsAndRows(projectState) } // Diff diff --git a/test/cli/pull/ignore-configurations-orchestrator/README.md b/test/cli/pull/ignore-configurations-orchestrator/README.md new file mode 100644 index 0000000000..42d552983f --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/README.md @@ -0,0 +1,34 @@ +# Ignore Configurations Orchestrator - Pull Test + +## Purpose +This E2E test verifies that when a configuration is ignored via `.kbcignore`, +the system **validates** that no orchestrators reference that ignored configuration. +If an orchestrator references an ignored config, the operation fails with an error +instructing the user to explicitly add the orchestrator to `.kbcignore`. + +## Test Setup +- **Remote state**: Contains 3 configs: + 1. `ex-generic-v2/empty` - ignored via .kbcignore + 2. `ex-generic-v2/without-rows` - not ignored + 3. `keboola.orchestrator/orchestrator` - references the "empty" config in Task 1 + +- **Local state**: Empty (initial pull) +- **.kbcignore**: Contains pattern to ignore the "empty" config (but NOT the orchestrator) + +## Expected Behavior +- Pull operation **fails** with error code 1 +- Error message instructs user to add the orchestrator to `.kbcignore`: + ``` + Error: orchestrators reference ignored configurations: + - orchestrator "..." references ignored config "...", please add the orchestrator to .kbcignore: + keboola.orchestrator/ + ``` + +## Fix +User must explicitly add the orchestrator to `.kbcignore`: +``` +ex-generic-v2/%%TEST_BRANCH_MAIN_CONFIG_EMPTY_ID%% +keboola.orchestrator/%%TEST_BRANCH_MAIN_CONFIG_ORCHESTRATOR_ID%% +``` + +This ensures users are aware of orchestrator dependencies and make explicit ignore decisions. diff --git a/test/cli/pull/ignore-configurations-orchestrator/args b/test/cli/pull/ignore-configurations-orchestrator/args new file mode 100644 index 0000000000..b22db2abc5 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/args @@ -0,0 +1,2 @@ +pull --verbose --storage-api-token %%TEST_KBC_STORAGE_API_TOKEN%% + diff --git a/test/cli/pull/ignore-configurations-orchestrator/expected-code b/test/cli/pull/ignore-configurations-orchestrator/expected-code new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/expected-code @@ -0,0 +1 @@ +1 diff --git a/test/cli/pull/ignore-configurations-orchestrator/expected-stderr b/test/cli/pull/ignore-configurations-orchestrator/expected-stderr new file mode 100644 index 0000000000..d78d104bf0 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/expected-stderr @@ -0,0 +1,3 @@ +Error: configurations with dependencies reference ignored configurations: + - orchestrator %q references ignored config %q, please add it to .kbcignore: + keboola.orchestrator/%%_%% diff --git a/test/cli/pull/ignore-configurations-orchestrator/expected-stdout b/test/cli/pull/ignore-configurations-orchestrator/expected-stdout new file mode 100644 index 0000000000..f7de3b4907 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/expected-stdout @@ -0,0 +1,3 @@ +%A +DEBUG Project state has been successfully loaded. +%A diff --git a/test/cli/pull/ignore-configurations-orchestrator/in/.keboola/.kbcignore b/test/cli/pull/ignore-configurations-orchestrator/in/.keboola/.kbcignore new file mode 100644 index 0000000000..37c0f962d2 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/in/.keboola/.kbcignore @@ -0,0 +1,4 @@ +# Ignore the "empty" extractor config +# This should also cause the orchestrator that references it to be ignored +ex-generic-v2/%%TEST_BRANCH_MAIN_CONFIG_EMPTY_ID%% + diff --git a/test/cli/pull/ignore-configurations-orchestrator/in/description.md b/test/cli/pull/ignore-configurations-orchestrator/in/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/pull/ignore-configurations-orchestrator/initial-state.json b/test/cli/pull/ignore-configurations-orchestrator/initial-state.json new file mode 100644 index 0000000000..c10cd3d3f8 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/initial-state.json @@ -0,0 +1,23 @@ +{ + "allBranchesConfigs": [], + "branches": [ + { + "branch": { + "name": "Main", + "isDefault": true + }, + "configs": [ + "empty", + "without-rows", + "orchestrator" + ] + } + ], + "envs": { + "TEST_ORCHESTRATOR_TASK_1_COMPONENT_ID": "ex-generic-v2", + "TEST_ORCHESTRATOR_TASK_1_CONFIG_ID": "%%TEST_BRANCH_MAIN_CONFIG_EMPTY_ID%%", + "TEST_ORCHESTRATOR_TASK_2_COMPONENT_ID": "ex-generic-v2", + "TEST_ORCHESTRATOR_TASK_2_CONFIG_ID": "%%TEST_BRANCH_MAIN_CONFIG_WITHOUT_ROWS_ID%%" + } +} + diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/description.md b/test/cli/pull/ignore-configurations-orchestrator/out/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/main/description.md b/test/cli/pull/ignore-configurations-orchestrator/out/main/description.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/out/main/description.md @@ -0,0 +1 @@ + diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json new file mode 100644 index 0000000000..e7bf7fb680 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json @@ -0,0 +1,7 @@ +{ + "parameters": { + "api": { + "baseUrl": "https://jsonplaceholder.typicode.com" + } + } +} diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json new file mode 100644 index 0000000000..fb770b9775 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json @@ -0,0 +1,4 @@ +{ + "name": "without-rows", + "isDisabled": false +} diff --git a/test/cli/pull/ignore-configurations-orchestrator/out/main/meta.json b/test/cli/pull/ignore-configurations-orchestrator/out/main/meta.json new file mode 100644 index 0000000000..154a3ce050 --- /dev/null +++ b/test/cli/pull/ignore-configurations-orchestrator/out/main/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Main", + "isDefault": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/README.md b/test/cli/push/ignore-configurations-orchestrator/README.md new file mode 100644 index 0000000000..100418747c --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/README.md @@ -0,0 +1,34 @@ +# Ignore Configurations Orchestrator - Push Test + +## Purpose +This E2E test verifies that when a configuration is ignored via `.kbcignore`, +the system **validates** that no orchestrators reference that ignored configuration. +If an orchestrator references an ignored config, the operation fails with an error +instructing the user to explicitly add the orchestrator to `.kbcignore`. + +## Test Setup +- **Remote state**: Empty project +- **Local state**: Contains 3 configs: + 1. `ex-generic-v2/empty` - ignored via .kbcignore + 2. `ex-generic-v2/without-rows` - not ignored + 3. `keboola.orchestrator/orchestrator` - references the "empty" config in Task 1 + +- **.kbcignore**: Contains wildcard pattern to ignore the "empty" config (but NOT the orchestrator) + +## Expected Behavior +- Push operation **fails** with error code 1 +- Error message instructs user to add the orchestrator to `.kbcignore`: + ``` + Error: orchestrators reference ignored configurations: + - orchestrator "..." references ignored config "...", please add the orchestrator to .kbcignore: + keboola.orchestrator/ + ``` + +## Fix +User must explicitly add the orchestrator to `.kbcignore`: +``` +ex-generic-v2/%%_%% +keboola.orchestrator/%%_%% +``` + +This ensures users are aware of orchestrator dependencies and make explicit ignore decisions. diff --git a/test/cli/push/ignore-configurations-orchestrator/args b/test/cli/push/ignore-configurations-orchestrator/args new file mode 100644 index 0000000000..35d559d0a2 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/args @@ -0,0 +1,2 @@ +push --storage-api-token %%TEST_KBC_STORAGE_API_TOKEN%% + diff --git a/test/cli/push/ignore-configurations-orchestrator/expected-code b/test/cli/push/ignore-configurations-orchestrator/expected-code new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/expected-code @@ -0,0 +1 @@ +1 diff --git a/test/cli/push/ignore-configurations-orchestrator/expected-state.json b/test/cli/push/ignore-configurations-orchestrator/expected-state.json new file mode 100644 index 0000000000..12ef58ff24 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/expected-state.json @@ -0,0 +1,38 @@ +{ + "branches": [ + { + "id": "%%TEST_BRANCH_MAIN_ID%%", + "name": "Main", + "description": "", + "isDefault": true, + "metadata": {} + } + ], + "configurations": [ + { + "branchId": "%%TEST_BRANCH_MAIN_ID%%", + "componentId": "ex-generic-v2", + "id": "%%_%%", + "name": "without-rows", + "description": "", + "changeDescription": "", + "isDisabled": false, + "isDeleted": false, + "created": "%%_%%", + "version": 1, + "state": {}, + "currentVersion": { + "changeDescription": "", + "created": "%%_%%", + "creatorToken": { + "id": "%%_%%", + "description": "test" + }, + "version": 1, + "state": {} + }, + "configuration": {} + } + ] +} + diff --git a/test/cli/push/ignore-configurations-orchestrator/expected-stderr b/test/cli/push/ignore-configurations-orchestrator/expected-stderr new file mode 100644 index 0000000000..d78d104bf0 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/expected-stderr @@ -0,0 +1,3 @@ +Error: configurations with dependencies reference ignored configurations: + - orchestrator %q references ignored config %q, please add it to .kbcignore: + keboola.orchestrator/%%_%% diff --git a/test/cli/push/ignore-configurations-orchestrator/expected-stdout b/test/cli/push/ignore-configurations-orchestrator/expected-stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/push/ignore-configurations-orchestrator/in/.keboola/.kbcignore b/test/cli/push/ignore-configurations-orchestrator/in/.keboola/.kbcignore new file mode 100644 index 0000000000..81017d732a --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/.keboola/.kbcignore @@ -0,0 +1,3 @@ +# Ignore the "empty" extractor config +# This should also cause the orchestrator that references it to be ignored during push +ex-generic-v2/%%_%% diff --git a/test/cli/push/ignore-configurations-orchestrator/in/description.md b/test/cli/push/ignore-configurations-orchestrator/in/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/description.md b/test/cli/push/ignore-configurations-orchestrator/in/main/description.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/description.md @@ -0,0 +1 @@ + diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/config.json b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/config.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/config.json @@ -0,0 +1 @@ +{} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/description.md b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/meta.json b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/meta.json new file mode 100644 index 0000000000..eb2c70d865 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/empty/meta.json @@ -0,0 +1,4 @@ +{ + "name": "empty", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/config.json b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/config.json new file mode 100644 index 0000000000..e7bf7fb680 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/config.json @@ -0,0 +1,7 @@ +{ + "parameters": { + "api": { + "baseUrl": "https://jsonplaceholder.typicode.com" + } + } +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/description.md b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/meta.json b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/meta.json new file mode 100644 index 0000000000..fb770b9775 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/extractor/ex-generic-v2/without-rows/meta.json @@ -0,0 +1,4 @@ +{ + "name": "without-rows", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/meta.json b/test/cli/push/ignore-configurations-orchestrator/in/main/meta.json new file mode 100644 index 0000000000..154a3ce050 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Main", + "isDefault": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/config.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/config.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/config.json @@ -0,0 +1 @@ +{} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/description.md b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/meta.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/meta.json new file mode 100644 index 0000000000..da1706b7cf --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/meta.json @@ -0,0 +1,4 @@ +{ + "name": "orchestrator", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/.gitkeep b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json new file mode 100644 index 0000000000..a0e994a9bb --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json @@ -0,0 +1,9 @@ +{ + "name": "Task 1", + "enabled": true, + "task": { + "mode": "run", + "configPath": "extractor/ex-generic-v2/empty" + }, + "continueOnFailure": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json new file mode 100644 index 0000000000..fc22a34a95 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json @@ -0,0 +1,12 @@ +{ + "name": "Task 4 - configData", + "enabled": false, + "task": { + "mode": "run", + "configData": { + "params": "value" + }, + "componentId": "ex-generic-v2" + }, + "continueOnFailure": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json new file mode 100644 index 0000000000..ae18024114 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json @@ -0,0 +1,4 @@ +{ + "name": "Phase 1", + "dependsOn": [] +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json new file mode 100644 index 0000000000..4eeed635aa --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json @@ -0,0 +1,9 @@ +{ + "name": "Task 2", + "enabled": true, + "task": { + "mode": "run", + "configPath": "extractor/ex-generic-v2/without-rows" + }, + "continueOnFailure": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json new file mode 100644 index 0000000000..74d54574c4 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json @@ -0,0 +1,10 @@ +{ + "name": "Task 3 - disabled", + "enabled": false, + "task": { + "configId": "", + "mode": "run", + "componentId": "ex-generic-v2" + }, + "continueOnFailure": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json new file mode 100644 index 0000000000..9fd659428e --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/in/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json @@ -0,0 +1,6 @@ +{ + "name": "Phase 2", + "dependsOn": [ + "001-phase-1" + ] +} diff --git a/test/cli/push/ignore-configurations-orchestrator/initial-state.json b/test/cli/push/ignore-configurations-orchestrator/initial-state.json new file mode 100644 index 0000000000..d67a3d6699 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/initial-state.json @@ -0,0 +1,13 @@ +{ + "allBranchesConfigs": [], + "branches": [ + { + "branch": { + "name": "Main", + "isDefault": true + }, + "configs": [] + } + ] +} + diff --git a/test/cli/push/ignore-configurations-orchestrator/out/description.md b/test/cli/push/ignore-configurations-orchestrator/out/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/description.md b/test/cli/push/ignore-configurations-orchestrator/out/main/description.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/description.md @@ -0,0 +1 @@ + diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/config.json b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/config.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/config.json @@ -0,0 +1 @@ +{} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/description.md b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/meta.json b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/meta.json new file mode 100644 index 0000000000..eb2c70d865 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/empty/meta.json @@ -0,0 +1,4 @@ +{ + "name": "empty", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json new file mode 100644 index 0000000000..e7bf7fb680 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/config.json @@ -0,0 +1,7 @@ +{ + "parameters": { + "api": { + "baseUrl": "https://jsonplaceholder.typicode.com" + } + } +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json new file mode 100644 index 0000000000..fb770b9775 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/extractor/ex-generic-v2/without-rows/meta.json @@ -0,0 +1,4 @@ +{ + "name": "without-rows", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/meta.json b/test/cli/push/ignore-configurations-orchestrator/out/main/meta.json new file mode 100644 index 0000000000..154a3ce050 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Main", + "isDefault": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/config.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/config.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/config.json @@ -0,0 +1 @@ +{} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/description.md b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/meta.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/meta.json new file mode 100644 index 0000000000..da1706b7cf --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/meta.json @@ -0,0 +1,4 @@ +{ + "name": "orchestrator", + "isDisabled": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/.gitkeep b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json new file mode 100644 index 0000000000..a0e994a9bb --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/001-task-1/task.json @@ -0,0 +1,9 @@ +{ + "name": "Task 1", + "enabled": true, + "task": { + "mode": "run", + "configPath": "extractor/ex-generic-v2/empty" + }, + "continueOnFailure": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json new file mode 100644 index 0000000000..fc22a34a95 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/002-task-4-config-data/task.json @@ -0,0 +1,12 @@ +{ + "name": "Task 4 - configData", + "enabled": false, + "task": { + "mode": "run", + "configData": { + "params": "value" + }, + "componentId": "ex-generic-v2" + }, + "continueOnFailure": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json new file mode 100644 index 0000000000..ae18024114 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/001-phase-1/phase.json @@ -0,0 +1,4 @@ +{ + "name": "Phase 1", + "dependsOn": [] +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json new file mode 100644 index 0000000000..4eeed635aa --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/001-task-2/task.json @@ -0,0 +1,9 @@ +{ + "name": "Task 2", + "enabled": true, + "task": { + "mode": "run", + "configPath": "extractor/ex-generic-v2/without-rows" + }, + "continueOnFailure": false +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json new file mode 100644 index 0000000000..74d54574c4 --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/002-task-3-disabled/task.json @@ -0,0 +1,10 @@ +{ + "name": "Task 3 - disabled", + "enabled": false, + "task": { + "configId": "", + "mode": "run", + "componentId": "ex-generic-v2" + }, + "continueOnFailure": true +} diff --git a/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json new file mode 100644 index 0000000000..9fd659428e --- /dev/null +++ b/test/cli/push/ignore-configurations-orchestrator/out/main/other/keboola.orchestrator/orchestrator/phases/002-phase-2/phase.json @@ -0,0 +1,6 @@ +{ + "name": "Phase 2", + "dependsOn": [ + "001-phase-1" + ] +}