From d68c1dbf7b63caa0a53d0dc85c0f9cde528b9b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20G=C3=B6drei?= Date: Thu, 15 Jun 2023 10:25:23 +0200 Subject: [PATCH] Remove trigger map from the generated configs (#260) --- _tests/integration/android_test.go | 20 ------- _tests/integration/cordova_test.go | 10 ---- _tests/integration/fastlane_test.go | 10 ---- _tests/integration/flutter_test.go | 20 ------- _tests/integration/ionic_test.go | 5 -- _tests/integration/ios_test.go | 50 ---------------- _tests/integration/mac_test.go | 5 -- _tests/integration/manual_config_test.go | 65 --------------------- _tests/integration/reactnative_expo_test.go | 15 ----- _tests/integration/reactnative_test.go | 25 -------- models/configbuilder.go | 12 ---- models/configbuilder_test.go | 4 +- 12 files changed, 2 insertions(+), 239 deletions(-) diff --git a/_tests/integration/android_test.go b/_tests/integration/android_test.go index 388f33d2..629c06cf 100644 --- a/_tests/integration/android_test.go +++ b/_tests/integration/android_test.go @@ -126,11 +126,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: android - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -276,11 +271,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: android - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -399,11 +389,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: android - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -502,11 +487,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: android - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/cordova_test.go b/_tests/integration/cordova_test.go index 2f3bfb2d..d836cf09 100644 --- a/_tests/integration/cordova_test.go +++ b/_tests/integration/cordova_test.go @@ -73,11 +73,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: cordova - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: steps: @@ -152,11 +147,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: cordova - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: steps: diff --git a/_tests/integration/fastlane_test.go b/_tests/integration/fastlane_test.go index c8a5dbd4..13d1ad28 100644 --- a/_tests/integration/fastlane_test.go +++ b/_tests/integration/fastlane_test.go @@ -114,11 +114,6 @@ configs: app: envs: - FASTLANE_XCODE_LIST_TIMEOUT: "120" - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -136,11 +131,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/flutter_test.go b/_tests/integration/flutter_test.go index f55620f1..4d7ff780 100644 --- a/_tests/integration/flutter_test.go +++ b/_tests/integration/flutter_test.go @@ -77,11 +77,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -166,11 +161,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: description: | @@ -254,11 +244,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -307,11 +292,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/ionic_test.go b/_tests/integration/ionic_test.go index af5d13ef..687a76a6 100644 --- a/_tests/integration/ionic_test.go +++ b/_tests/integration/ionic_test.go @@ -67,11 +67,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ionic - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: diff --git a/_tests/integration/ios_test.go b/_tests/integration/ios_test.go index 068d96a3..e4baa59f 100644 --- a/_tests/integration/ios_test.go +++ b/_tests/integration/ios_test.go @@ -116,11 +116,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -247,11 +242,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -443,11 +433,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -489,11 +474,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -602,11 +582,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -761,11 +736,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -814,11 +784,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -860,11 +825,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -913,11 +873,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -1020,11 +975,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/mac_test.go b/_tests/integration/mac_test.go index 41bfab17..dd506ed3 100644 --- a/_tests/integration/mac_test.go +++ b/_tests/integration/mac_test.go @@ -83,11 +83,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: macos - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: steps: diff --git a/_tests/integration/manual_config_test.go b/_tests/integration/manual_config_test.go index 631ba957..72c89fe1 100644 --- a/_tests/integration/manual_config_test.go +++ b/_tests/integration/manual_config_test.go @@ -518,11 +518,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: android - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -586,11 +581,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: cordova - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -619,11 +609,6 @@ configs: app: envs: - FASTLANE_XCODE_LIST_TIMEOUT: "120" - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -643,11 +628,6 @@ configs: app: envs: - FASTLANE_XCODE_LIST_TIMEOUT: "120" - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -666,11 +646,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -722,11 +697,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -780,11 +750,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: flutter - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -839,11 +804,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ionic - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -869,11 +829,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -940,11 +895,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: macos - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: steps: @@ -993,11 +943,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: other - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: primary: steps: @@ -1010,11 +955,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -1072,11 +1012,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/reactnative_expo_test.go b/_tests/integration/reactnative_expo_test.go index 1a135df7..6ef2cb2e 100644 --- a/_tests/integration/reactnative_expo_test.go +++ b/_tests/integration/reactnative_expo_test.go @@ -75,11 +75,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -159,11 +154,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -249,11 +239,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/_tests/integration/reactnative_test.go b/_tests/integration/reactnative_test.go index 5757a2b1..e77a2618 100644 --- a/_tests/integration/reactnative_test.go +++ b/_tests/integration/reactnative_test.go @@ -228,11 +228,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -407,11 +402,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -584,11 +574,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -756,11 +741,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | @@ -952,11 +932,6 @@ configs: format_version: "%s" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: react-native - trigger_map: - - push_branch: '*' - workflow: primary - - pull_request_source_branch: '*' - workflow: primary workflows: deploy: description: | diff --git a/models/configbuilder.go b/models/configbuilder.go index fcb5ab09..675c96e9 100644 --- a/models/configbuilder.go +++ b/models/configbuilder.go @@ -68,17 +68,6 @@ func (builder *ConfigBuilderModel) Generate(projectType string, appEnvs ...envma workflows[string(workflowID)] = workflowBuilder.generate() } - triggerMap := []bitriseModels.TriggerMapItemModel{ - bitriseModels.TriggerMapItemModel{ - PushBranch: "*", - WorkflowID: string(PrimaryWorkflowID), - }, - bitriseModels.TriggerMapItemModel{ - PullRequestSourceBranch: "*", - WorkflowID: string(PrimaryWorkflowID), - }, - } - app := bitriseModels.AppModel{ Environments: appEnvs, } @@ -87,7 +76,6 @@ func (builder *ConfigBuilderModel) Generate(projectType string, appEnvs ...envma FormatVersion: FormatVersion, DefaultStepLibSource: defaultSteplibSource, ProjectType: projectType, - TriggerMap: triggerMap, Workflows: workflows, App: app, }, nil diff --git a/models/configbuilder_test.go b/models/configbuilder_test.go index c6d0a451..37d19064 100644 --- a/models/configbuilder_test.go +++ b/models/configbuilder_test.go @@ -20,7 +20,7 @@ func TestConfigGenerateHaveProjectType(t *testing.T) { require.Equal(t, "iOS", model.ProjectType) } -func TestConfigGenerateHaveTriggerMap(t *testing.T) { +func TestConfigDoesNotGenerateTriggerMap(t *testing.T) { config := NewDefaultConfigBuilder() config.AppendStepListItemsTo("primary", []bitriseModels.StepListItemModel{ {"step-id": stepmanModels.StepModel{}}, @@ -29,5 +29,5 @@ func TestConfigGenerateHaveTriggerMap(t *testing.T) { model, err := config.Generate("iOS") require.Nil(t, err) - require.Equal(t, 2, len(model.TriggerMap)) + require.Nil(t, model.TriggerMap) }