diff --git a/internal/pkg/diff/diff.go b/internal/pkg/diff/diff.go index 201cacc5a1..18aa675df8 100644 --- a/internal/pkg/diff/diff.go +++ b/internal/pkg/diff/diff.go @@ -18,13 +18,26 @@ import ( "github.com/keboola/keboola-as-code/internal/pkg/utils/strhelper" ) +type Option func(c *Config) + +type Config struct { + allowTargetEnv bool +} + +func WithIgnoreBranchName(allowTargetEnv bool) Option { + return func(c *Config) { + c.allowTargetEnv = allowTargetEnv + } +} + type typeName string type Differ struct { - objects model.ObjectStates - results []*Result // diff results - typeCache map[typeName][]*reflecthelper.StructField // reflection cache - errors errors.MultiError + objects model.ObjectStates + results []*Result // diff results + typeCache map[typeName][]*reflecthelper.StructField // reflection cache + errors errors.MultiError + allowTargetEnv bool // option } type ResultState int @@ -58,10 +71,17 @@ type Results struct { Objects model.ObjectStates } -func NewDiffer(objects model.ObjectStates) *Differ { +func NewDiffer(objects model.ObjectStates, option ...Option) *Differ { + config := Config{} + + for _, o := range option { + o(&config) + } + return &Differ{ - objects: objects, - typeCache: make(map[typeName][]*reflecthelper.StructField), + objects: objects, + allowTargetEnv: config.allowTargetEnv, + typeCache: make(map[typeName][]*reflecthelper.StructField), } } @@ -149,11 +169,23 @@ func (d *Differ) diffState(state model.ObjectState) (*Result, error) { } // Diff + if remoteState.Kind().IsBranch() { + result = d.resultFn(result, state, diffFields, remoteValues, localValues, d.newBranchOptions) + } else { + result = d.resultFn(result, state, diffFields, remoteValues, localValues, d.newOptions) + } + + return result, nil +} + +func (d *Differ) resultFn(result *Result, state model.ObjectState, diffFields []*reflecthelper.StructField, remoteValues, localValues reflect.Value, opts func(r *Reporter) cmp.Options) *Result { + state.RemoteState() for _, field := range diffFields { reporter := d.diffValues( state, remoteValues.FieldByName(field.StructField.Name).Interface(), localValues.FieldByName(field.StructField.Name).Interface(), + opts, ) diffStr := reporter.String() if len(diffStr) > 0 { @@ -169,16 +201,27 @@ func (d *Differ) diffState(state model.ObjectState) (*Result, error) { } else { result.State = ResultEqual } - - return result, nil + return result } -func (d *Differ) diffValues(objectState model.ObjectState, remoteValue, localValue any) *Reporter { +func (d *Differ) diffValues(objectState model.ObjectState, remoteValue, localValue any, opts func(r *Reporter) cmp.Options) *Reporter { reporter := newReporter(objectState, d.objects) - cmp.Diff(remoteValue, localValue, d.newOptions(reporter)) + cmp.Diff(remoteValue, localValue, opts(reporter)) return reporter } +func (d *Differ) newBranchOptions(reporter *Reporter) cmp.Options { + options := d.newOptions(reporter) + options = append(options, cmp.Transformer("name", func(s string) string { + if d.allowTargetEnv { + return "" + } + + return s + })) + return options +} + func (d *Differ) newOptions(reporter *Reporter) cmp.Options { return cmp.Options{ cmp.Reporter(reporter), diff --git a/internal/pkg/diff/diff_test.go b/internal/pkg/diff/diff_test.go index 752eaa460a..205a2a9820 100644 --- a/internal/pkg/diff/diff_test.go +++ b/internal/pkg/diff/diff_test.go @@ -371,7 +371,7 @@ func TestDiffRelations(t *testing.T) { assert.NoError(t, projectState.Set(objectState)) differ := NewDiffer(projectState) - reporter := differ.diffValues(objectState, objectState.Remote.Relations, objectState.Local.Relations) + reporter := differ.diffValues(objectState, objectState.Remote.Relations, objectState.Local.Relations, differ.newOptions) expected := ` - manifest side relation mocked key "foo" + manifest side relation mocked key "bar" @@ -454,7 +454,7 @@ func TestDiffTransformation(t *testing.T) { // Transformation differ := NewDiffer(projectState) - reporter := differ.diffValues(configState, configState.Remote.Transformation, configState.Local.Transformation) + reporter := differ.diffValues(configState, configState.Remote.Transformation, configState.Local.Transformation, differ.newOptions) expected := ` blocks/001-my-block: - # Block 1 @@ -472,7 +472,7 @@ func TestDiffTransformation(t *testing.T) { assert.Equal(t, strings.Trim(expected, "\n"), reporter.String()) // SharedCode link - reporter = differ.diffValues(configState, configState.Remote.SharedCode, configState.Local.SharedCode) + reporter = differ.diffValues(configState, configState.Remote.SharedCode, configState.Local.SharedCode, differ.newOptions) expected = ` - (null) + 12345 @@ -517,7 +517,7 @@ func TestDiffSharedCode(t *testing.T) { // Transformation differ := NewDiffer(projectState) - reporter := differ.diffValues(configRowState, configRowState.Remote.SharedCode, configRowState.Local.SharedCode) + reporter := differ.diffValues(configRowState, configRowState.Remote.SharedCode, configRowState.Local.SharedCode, differ.newOptions) expected := ` - SELECT 4; + SELECT 1; @@ -681,7 +681,7 @@ func TestDiffOrchestration(t *testing.T) { assert.NoError(t, projectState.Set(configState)) differ := NewDiffer(projectState) - reporter := differ.diffValues(configState, configState.Remote.Orchestration, configState.Local.Orchestration) + reporter := differ.diffValues(configState, configState.Remote.Orchestration, configState.Local.Orchestration, differ.newOptions) expected := ` phases/001-phase: # 001 Phase @@ -765,7 +765,7 @@ func TestDiffMap(t *testing.T) { assert.NoError(t, projectState.Set(configState)) differ := NewDiffer(projectState) - reporter := differ.diffValues(configState, configState.Remote.Content, configState.Local.Content) + reporter := differ.diffValues(configState, configState.Remote.Content, configState.Local.Content, differ.newOptions) expected := ` foo.bar: - "value" diff --git a/internal/pkg/plan/push/push.go b/internal/pkg/plan/push/push.go index ce6dc1cebb..fd49883556 100644 --- a/internal/pkg/plan/push/push.go +++ b/internal/pkg/plan/push/push.go @@ -18,10 +18,6 @@ func NewPlan(diffResults *diff.Results, allowTargetEnv bool) (*diffop.Plan, erro if result.ChangedFields.String() == "relations" && !result.ChangedFields.Get("relations").HasPath("InAPI") { continue } - - if allowTargetEnv && result.ChangedFields.Has("name") { - continue - } plan.Add(result, diffop.ActionSaveRemote) case diff.ResultOnlyInLocal: plan.Add(result, diffop.ActionSaveRemote) diff --git a/pkg/lib/operation/project/sync/diff/create/operation.go b/pkg/lib/operation/project/sync/diff/create/operation.go index 8899f2e39a..873a938bf4 100644 --- a/pkg/lib/operation/project/sync/diff/create/operation.go +++ b/pkg/lib/operation/project/sync/diff/create/operation.go @@ -16,11 +16,11 @@ type dependencies interface { Telemetry() telemetry.Telemetry } -func Run(ctx context.Context, o Options, d dependencies) (results *diff.Results, err error) { +func Run(ctx context.Context, o Options, d dependencies, opts ...diff.Option) (results *diff.Results, err error) { ctx, span := d.Telemetry().Tracer().Start(ctx, "keboola.go.operation.project.sync.diff.create") defer span.End(&err) - differ := diff.NewDiffer(o.Objects) + differ := diff.NewDiffer(o.Objects, opts...) results, err = differ.Diff() if err != nil { return nil, err diff --git a/pkg/lib/operation/project/sync/diff/printdiff/operation.go b/pkg/lib/operation/project/sync/diff/printdiff/operation.go index d3e5c98c0d..4cedda26c6 100644 --- a/pkg/lib/operation/project/sync/diff/printdiff/operation.go +++ b/pkg/lib/operation/project/sync/diff/printdiff/operation.go @@ -27,7 +27,7 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen logger := d.Logger() // Diff - results, err = createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d) + results, err = createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d, diff.WithIgnoreBranchName(projectState.ProjectManifest().AllowTargetENV())) if err != nil { return nil, err } diff --git a/pkg/lib/operation/project/sync/pull/operation.go b/pkg/lib/operation/project/sync/pull/operation.go index bf941d53dc..c828429e25 100644 --- a/pkg/lib/operation/project/sync/pull/operation.go +++ b/pkg/lib/operation/project/sync/pull/operation.go @@ -6,6 +6,7 @@ import ( "github.com/keboola/go-client/pkg/keboola" + "github.com/keboola/keboola-as-code/internal/pkg/diff" "github.com/keboola/keboola-as-code/internal/pkg/log" "github.com/keboola/keboola-as-code/internal/pkg/plan/pull" "github.com/keboola/keboola-as-code/internal/pkg/project" @@ -49,7 +50,7 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen logger := d.Logger() // Diff - results, err := createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d) + results, err := createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d, diff.WithIgnoreBranchName(projectState.ProjectManifest().AllowTargetENV())) if err != nil { return err } diff --git a/pkg/lib/operation/project/sync/push/operation.go b/pkg/lib/operation/project/sync/push/operation.go index 436d57cea6..3bd5a66a98 100644 --- a/pkg/lib/operation/project/sync/push/operation.go +++ b/pkg/lib/operation/project/sync/push/operation.go @@ -6,6 +6,7 @@ import ( "github.com/keboola/go-client/pkg/keboola" + "github.com/keboola/keboola-as-code/internal/pkg/diff" "github.com/keboola/keboola-as-code/internal/pkg/log" "github.com/keboola/keboola-as-code/internal/pkg/plan/push" "github.com/keboola/keboola-as-code/internal/pkg/project" @@ -65,7 +66,7 @@ func Run(ctx context.Context, projectState *project.State, o Options, d dependen } // Diff - results, err := createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d) + results, err := createDiff.Run(ctx, createDiff.Options{Objects: projectState}, d, diff.WithIgnoreBranchName(projectState.ProjectManifest().AllowTargetENV())) if err != nil { return err } diff --git a/pkg/lib/operation/template/sync/diff/create/operation.go b/pkg/lib/operation/template/sync/diff/create/operation.go index 6645657e98..04fc277cd3 100644 --- a/pkg/lib/operation/template/sync/diff/create/operation.go +++ b/pkg/lib/operation/template/sync/diff/create/operation.go @@ -1,29 +1,21 @@ package create -import ( - "context" +// type Options struct { +// Objects model.ObjectStates +//} +// +// type dependencies interface { +// Telemetry() telemetry.Telemetry +//} - "github.com/keboola/keboola-as-code/internal/pkg/diff" - "github.com/keboola/keboola-as-code/internal/pkg/model" - "github.com/keboola/keboola-as-code/internal/pkg/telemetry" -) - -type Options struct { - Objects model.ObjectStates -} - -type dependencies interface { - Telemetry() telemetry.Telemetry -} - -func Run(ctx context.Context, o Options, d dependencies) (results *diff.Results, err error) { - ctx, span := d.Telemetry().Tracer().Start(ctx, "keboola.go.operation.template.sync.diff.create") - defer span.End(&err) - - differ := diff.NewDiffer(o.Objects) - results, err = differ.Diff() - if err != nil { - return nil, err - } - return results, nil -} +// func Run(ctx context.Context, o Options, d dependencies) (results *diff.Results, err error) { +// ctx, span := d.Telemetry().Tracer().Start(ctx, "keboola.go.operation.template.sync.diff.create") +// defer span.End(&err) +// +// differ := diff.NewDiffer(o.Objects) +// results, err = differ.Diff() +// if err != nil { +// return nil, err +// } +// return results, nil +//} diff --git a/test/cli/push/ok-ignoring-branch-name/args b/test/cli/allow-target-env/ok-ignoring-branch-name/args similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/args rename to test/cli/allow-target-env/ok-ignoring-branch-name/args diff --git a/test/cli/push/ok-ignoring-branch-name/env b/test/cli/allow-target-env/ok-ignoring-branch-name/env similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/env rename to test/cli/allow-target-env/ok-ignoring-branch-name/env diff --git a/test/cli/push/ok-ignoring-branch-name/expected-code b/test/cli/allow-target-env/ok-ignoring-branch-name/expected-code similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/expected-code rename to test/cli/allow-target-env/ok-ignoring-branch-name/expected-code diff --git a/test/cli/push/ok-ignoring-branch-name/expected-state.json b/test/cli/allow-target-env/ok-ignoring-branch-name/expected-state.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/expected-state.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/expected-state.json diff --git a/test/cli/push/ok-ignoring-branch-name/expected-stderr b/test/cli/allow-target-env/ok-ignoring-branch-name/expected-stderr similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/expected-stderr rename to test/cli/allow-target-env/ok-ignoring-branch-name/expected-stderr diff --git a/test/cli/push/ok-ignoring-branch-name/expected-stdout b/test/cli/allow-target-env/ok-ignoring-branch-name/expected-stdout similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/expected-stdout rename to test/cli/allow-target-env/ok-ignoring-branch-name/expected-stdout diff --git a/test/cli/push/ok-ignoring-branch-name/in/.keboola/manifest.json b/test/cli/allow-target-env/ok-ignoring-branch-name/in/.keboola/manifest.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/in/.keboola/manifest.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/in/.keboola/manifest.json diff --git a/test/cli/push/ok-ignoring-branch-name/in/foo/description.md b/test/cli/allow-target-env/ok-ignoring-branch-name/in/foo/description.md similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/in/foo/description.md rename to test/cli/allow-target-env/ok-ignoring-branch-name/in/foo/description.md diff --git a/test/cli/push/ok-ignoring-branch-name/in/foo/meta.json b/test/cli/allow-target-env/ok-ignoring-branch-name/in/foo/meta.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/in/foo/meta.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/in/foo/meta.json diff --git a/test/cli/push/ok-ignoring-branch-name/initial-state.json b/test/cli/allow-target-env/ok-ignoring-branch-name/initial-state.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/initial-state.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/initial-state.json diff --git a/test/cli/push/ok-ignoring-branch-name/out/.gitkeep b/test/cli/allow-target-env/ok-ignoring-branch-name/out/.gitkeep similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/out/.gitkeep rename to test/cli/allow-target-env/ok-ignoring-branch-name/out/.gitkeep diff --git a/test/cli/push/ok-ignoring-branch-name/out/.keboola/manifest.json b/test/cli/allow-target-env/ok-ignoring-branch-name/out/.keboola/manifest.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/out/.keboola/manifest.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/out/.keboola/manifest.json diff --git a/test/cli/push/ok-ignoring-branch-name/out/foo/description.md b/test/cli/allow-target-env/ok-ignoring-branch-name/out/foo/description.md similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/out/foo/description.md rename to test/cli/allow-target-env/ok-ignoring-branch-name/out/foo/description.md diff --git a/test/cli/push/ok-ignoring-branch-name/out/foo/meta.json b/test/cli/allow-target-env/ok-ignoring-branch-name/out/foo/meta.json similarity index 100% rename from test/cli/push/ok-ignoring-branch-name/out/foo/meta.json rename to test/cli/allow-target-env/ok-ignoring-branch-name/out/foo/meta.json diff --git a/test/cli/allow-target-env/push-changed-config-values/args b/test/cli/allow-target-env/push-changed-config-values/args new file mode 100644 index 0000000000..c4c35dfc58 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/args @@ -0,0 +1 @@ +push --storage-api-token %%TEST_KBC_STORAGE_API_TOKEN%% diff --git a/test/cli/allow-target-env/push-changed-config-values/env b/test/cli/allow-target-env/push-changed-config-values/env new file mode 100644 index 0000000000..f92e12fb02 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/env @@ -0,0 +1,2 @@ +KBC_PROJECT_ID=%%TEST_KBC_PROJECT_ID%% +KBC_BRANCH_ID=%%TEST_BRANCH_MAIN_ID%% diff --git a/test/cli/allow-target-env/push-changed-config-values/expected-code b/test/cli/allow-target-env/push-changed-config-values/expected-code new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/expected-code @@ -0,0 +1 @@ +0 diff --git a/test/cli/allow-target-env/push-changed-config-values/expected-state.json b/test/cli/allow-target-env/push-changed-config-values/expected-state.json new file mode 100644 index 0000000000..4c377863ce --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/expected-state.json @@ -0,0 +1,32 @@ +{ + "branches": [ + { + "branch": { + "name": "Main", + "description": "", + "isDefault": true + }, + "configs": [ + { + "componentId": "keboola.data-apps", + "name": "Data-App", + "description": "test fixture", + "changeDescription": "Updated from #KeboolaCLI", + "configuration": { + "foo": "modified" + }, + "rows": [], + "isDisabled": false + }, + { + "componentId": "ex-generic-v2", + "name": "empty", + "description": "test fixture", + "configuration": {}, + "rows": [], + "isDisabled": false + } + ] + } + ] +} diff --git a/test/cli/allow-target-env/push-changed-config-values/expected-stderr b/test/cli/allow-target-env/push-changed-config-values/expected-stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/expected-stdout b/test/cli/allow-target-env/push-changed-config-values/expected-stdout new file mode 100644 index 0000000000..cec1ce52ff --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/expected-stdout @@ -0,0 +1,7 @@ +Overriding the project ID by the environment variable KBC_PROJECT_ID=%s +Overriding the branch ID by the environment variable KBC_BRANCH_ID=%s +Plan for "push" operation: + * C main/app/keboola.data-apps/data-app | changed: configuration, name + × C main/extractor/ex-generic-v2/empty - SKIPPED +Skipped remote objects deletion, use "--force" to delete them. +Push done. diff --git a/test/cli/allow-target-env/push-changed-config-values/in/.keboola/manifest.json b/test/cli/allow-target-env/push-changed-config-values/in/.keboola/manifest.json new file mode 100644 index 0000000000..1092a973fb --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/in/.keboola/manifest.json @@ -0,0 +1,49 @@ +{ + "version": 2, + "project": { + "id": 1, + "apiHost": "%%TEST_KBC_STORAGE_API_HOST%%" + }, + "allowTargetEnv": true, + "sortBy": "path", + "naming": { + "branch": "{branch_name}", + "config": "{component_type}/{component_id}/{config_name}", + "configRow": "rows/{config_row_name}", + "schedulerConfig": "schedules/{config_name}", + "sharedCodeConfig": "_shared/{target_component_id}", + "sharedCodeConfigRow": "codes/{config_row_name}", + "variablesConfig": "variables", + "variablesValuesRow": "values/{config_row_name}", + "dataAppConfig": "app/{component_id}/{config_name}" + }, + "allowedBranches": [ + "2" + ], + "ignoredComponents": [], + "templates": { + "repositories": [ + { + "type": "git", + "name": "keboola", + "url": "https://github.com/keboola/keboola-as-code-templates.git", + "ref": "main" + } + ] + }, + "branches": [ + { + "id": 2, + "path": "main" + } + ], + "configurations": [ + { + "branchId": 2, + "componentId": "keboola.data-apps", + "id": "%%TEST_BRANCH_MAIN_CONFIG_DATA_APP_ID%%", + "path": "app/keboola.data-apps/data-app", + "rows": [] + } + ] +} diff --git a/test/cli/allow-target-env/push-changed-config-values/in/description.md b/test/cli/allow-target-env/push-changed-config-values/in/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/config.json b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/config.json new file mode 100644 index 0000000000..2606669161 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/config.json @@ -0,0 +1,3 @@ +{ + "foo": "modified" +} diff --git a/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/description.md b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/meta.json b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/meta.json new file mode 100644 index 0000000000..299ce5fe85 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/in/main/app/keboola.data-apps/data-app/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Data-App", + "isDisabled": false +} diff --git a/test/cli/allow-target-env/push-changed-config-values/in/main/description.md b/test/cli/allow-target-env/push-changed-config-values/in/main/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/in/main/meta.json b/test/cli/allow-target-env/push-changed-config-values/in/main/meta.json new file mode 100644 index 0000000000..154a3ce050 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/in/main/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Main", + "isDefault": true +} diff --git a/test/cli/allow-target-env/push-changed-config-values/initial-state.json b/test/cli/allow-target-env/push-changed-config-values/initial-state.json new file mode 100644 index 0000000000..b605869838 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/initial-state.json @@ -0,0 +1,19 @@ +{ + "backend": { + "type": "snowflake" + }, + "allBranchesConfigs": [ + "empty" + ], + "branches": [ + { + "branch": { + "name": "Main", + "isDefault": true + }, + "configs": [ + "data-app" + ] + } + ] +} diff --git a/test/cli/allow-target-env/push-changed-config-values/out/.gitkeep b/test/cli/allow-target-env/push-changed-config-values/out/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/out/.keboola/manifest.json b/test/cli/allow-target-env/push-changed-config-values/out/.keboola/manifest.json new file mode 100644 index 0000000000..1092a973fb --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/out/.keboola/manifest.json @@ -0,0 +1,49 @@ +{ + "version": 2, + "project": { + "id": 1, + "apiHost": "%%TEST_KBC_STORAGE_API_HOST%%" + }, + "allowTargetEnv": true, + "sortBy": "path", + "naming": { + "branch": "{branch_name}", + "config": "{component_type}/{component_id}/{config_name}", + "configRow": "rows/{config_row_name}", + "schedulerConfig": "schedules/{config_name}", + "sharedCodeConfig": "_shared/{target_component_id}", + "sharedCodeConfigRow": "codes/{config_row_name}", + "variablesConfig": "variables", + "variablesValuesRow": "values/{config_row_name}", + "dataAppConfig": "app/{component_id}/{config_name}" + }, + "allowedBranches": [ + "2" + ], + "ignoredComponents": [], + "templates": { + "repositories": [ + { + "type": "git", + "name": "keboola", + "url": "https://github.com/keboola/keboola-as-code-templates.git", + "ref": "main" + } + ] + }, + "branches": [ + { + "id": 2, + "path": "main" + } + ], + "configurations": [ + { + "branchId": 2, + "componentId": "keboola.data-apps", + "id": "%%TEST_BRANCH_MAIN_CONFIG_DATA_APP_ID%%", + "path": "app/keboola.data-apps/data-app", + "rows": [] + } + ] +} diff --git a/test/cli/allow-target-env/push-changed-config-values/out/description.md b/test/cli/allow-target-env/push-changed-config-values/out/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/config.json b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/config.json new file mode 100644 index 0000000000..2606669161 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/config.json @@ -0,0 +1,3 @@ +{ + "foo": "modified" +} diff --git a/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/description.md b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/description.md new file mode 100644 index 0000000000..28f6091c29 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/description.md @@ -0,0 +1 @@ +test fixture diff --git a/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/meta.json b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/meta.json new file mode 100644 index 0000000000..299ce5fe85 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/out/main/app/keboola.data-apps/data-app/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Data-App", + "isDisabled": false +} diff --git a/test/cli/allow-target-env/push-changed-config-values/out/main/description.md b/test/cli/allow-target-env/push-changed-config-values/out/main/description.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/cli/allow-target-env/push-changed-config-values/out/main/meta.json b/test/cli/allow-target-env/push-changed-config-values/out/main/meta.json new file mode 100644 index 0000000000..154a3ce050 --- /dev/null +++ b/test/cli/allow-target-env/push-changed-config-values/out/main/meta.json @@ -0,0 +1,4 @@ +{ + "name": "Main", + "isDefault": true +}