From 23f3ebf43a2893fd33c59bd993dd313624cae4e3 Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Tue, 23 Jan 2024 13:02:05 -0600 Subject: [PATCH 1/5] feat: adding a delete event --- src/elm/Main.elm | 1 + src/elm/Pages/RepoSettings.elm | 35 ++++++++++++++++++++++++++++++++++ src/elm/Vela.elm | 18 +++++++++++++++-- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/elm/Main.elm b/src/elm/Main.elm index 0ebef7f97..806b7cb84 100644 --- a/src/elm/Main.elm +++ b/src/elm/Main.elm @@ -3206,6 +3206,7 @@ viewBuildsFilter shouldRender org repo maybeEvent = , "deployment" , "schedule" , "comment" + , "delete" ] in div [ class "form-controls", class "build-filters", Util.testAttribute "build-filter" ] <| diff --git a/src/elm/Pages/RepoSettings.elm b/src/elm/Pages/RepoSettings.elm index 8dddde1ab..0ce7a732b 100644 --- a/src/elm/Pages/RepoSettings.elm +++ b/src/elm/Pages/RepoSettings.elm @@ -368,6 +368,19 @@ events repo msg = <| msg repo.org repo.name repo "allow_comment_edited" ] + , h3 [ class "settings-subtitle" ] [ text "Delete" ] + , div [ class "form-controls", class "-two-col" ] + [ checkbox "Branch" + "allow_push_delete_branch" + allowEvents.push.branch + <| + msg repo.org repo.name repo "allow_push_delete_branch" + , checkbox "Tag" + "allow_push_delete_tag" + allowEvents.push.tag + <| + msg repo.org repo.name repo "allow_push_delete_tag" + ] ] @@ -950,6 +963,12 @@ msgPrefix field = "allow_push_tag" -> "Push tag events for $ " + "allow_push_delete_branch" -> + "Push delete branch events for $ " + + "allow_push_delete_tag" -> + "Push delete tag events for $ " + "allow_deploy_created" -> "Deploy events for $ " @@ -1040,6 +1059,22 @@ msgSuffix field repo = Just allowEvents -> toggleText "allow_push_tag" allowEvents.push.tag + "allow_push_delete_branch" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_push_delete_branch" allowEvents.push.branch + + "allow_push_delete_tag" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_push_delete_tag" allowEvents.push.tag + "allow_deploy_created" -> case repo.allow_events of Nothing -> diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index f6538451d..42df831e0 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -924,6 +924,8 @@ type alias Deployment = type alias PushActions = { branch : Bool , tag : Bool + , delete_branch : Bool + , delete_tag : Bool } @@ -1004,6 +1006,8 @@ decodePushActions = Decode.succeed PushActions |> required "branch" bool |> required "tag" bool + |> required "delete_branch" bool + |> required "delete_tag" bool decodePullActions : Decoder PullActions @@ -1168,6 +1172,8 @@ encodePushActions push = Encode.object [ ( "branch", Encode.bool <| push.branch ) , ( "tag", Encode.bool <| push.tag ) + , ( "delete_branch", Encode.bool <| push.delete_branch ) + , ( "delete_tag", Encode.bool <| push.delete_tag ) ] @@ -1225,6 +1231,8 @@ type alias AllowEventsPayload = type alias PushActionsPayload = { branch : Bool , tag : Bool + , delete_branch : Bool + , delete_tag : Bool } @@ -1294,10 +1302,10 @@ defaultPushActionsPayload : Maybe PushActions -> PushActionsPayload defaultPushActionsPayload pushActions = case pushActions of Nothing -> - PushActionsPayload False False + PushActionsPayload False False False False Just push -> - PushActionsPayload push.branch push.tag + PushActionsPayload push.branch push.tag push.delete_branch push.delete_tag defaultPullActionsPayload : Maybe PullActions -> PullActionsPayload @@ -1396,6 +1404,12 @@ buildUpdateRepoEventsPayload repository field value = "allow_push_tag" -> { defaultUpdateRepositoryPayload | allow_events = Just { events | push = { pushActions | tag = value } } } + "allow_push_delete_branch" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | push = { pushActions | delete_branch = value } } } + + "allow_push_delete_tag" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | push = { pushActions | delete_tag = value } } } + "allow_pull_opened" -> { defaultUpdateRepositoryPayload | allow_events = Just { events | pull = { pullActions | opened = value } } } From 69b1c5e4f799b996e0f488e4cdcddadbe378e710 Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Mon, 29 Jan 2024 13:29:50 -0600 Subject: [PATCH 2/5] fix: working with new changes with secrets/allowEvents --- src/elm/Pages/RepoSettings.elm | 4 ++-- src/elm/Pages/Secrets/Form.elm | 13 +++++++++++++ src/elm/Pages/Secrets/Update.elm | 6 ++++++ src/elm/Pages/Secrets/View.elm | 2 ++ src/elm/Vela.elm | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/elm/Pages/RepoSettings.elm b/src/elm/Pages/RepoSettings.elm index 0ce7a732b..d16303ad6 100644 --- a/src/elm/Pages/RepoSettings.elm +++ b/src/elm/Pages/RepoSettings.elm @@ -372,12 +372,12 @@ events repo msg = , div [ class "form-controls", class "-two-col" ] [ checkbox "Branch" "allow_push_delete_branch" - allowEvents.push.branch + allowEvents.push.delete_branch <| msg repo.org repo.name repo "allow_push_delete_branch" , checkbox "Tag" "allow_push_delete_tag" - allowEvents.push.tag + allowEvents.push.delete_tag <| msg repo.org repo.name repo "allow_push_delete_tag" ] diff --git a/src/elm/Pages/Secrets/Form.elm b/src/elm/Pages/Secrets/Form.elm index 4d3995ea5..ab72c661e 100644 --- a/src/elm/Pages/Secrets/Form.elm +++ b/src/elm/Pages/Secrets/Form.elm @@ -258,6 +258,19 @@ viewEventsSelect secret model = <| OnChangeEvent "allow_comment_edited" ] + , strong [ class "settings-subtitle" ] [ text "Delete" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Branch" + "allow_push_delete_branch" + secret.allowEvents.push.delete_branch + <| + OnChangeEvent "allow_push_delete_branch" + , checkbox "Tag" + "allow_push_delete_tag" + secret.allowEvents.push.delete_tag + <| + OnChangeEvent "allow_push_delete_tag" + ] ] scheduleOption ) diff --git a/src/elm/Pages/Secrets/Update.elm b/src/elm/Pages/Secrets/Update.elm index 622d2f39f..8d53aa85c 100644 --- a/src/elm/Pages/Secrets/Update.elm +++ b/src/elm/Pages/Secrets/Update.elm @@ -187,6 +187,12 @@ updateSecretEvents sform field value = "allow_push_tag" -> { sform | allowEvents = { events | push = { pushActions | tag = value } } } + + "allow_push_delete_branch" -> + { sform | allowEvents = { events | push = { pushActions | delete_branch = value } } } + + "allow_push_delete_tag" -> + { sform | allowEvents = { events | push = { pushActions | delete_tag = value } } } "allow_pull_opened" -> { sform | allowEvents = { events | pull = { pullActions | opened = value } } } diff --git a/src/elm/Pages/Secrets/View.elm b/src/elm/Pages/Secrets/View.elm index 6d51897b2..bc4baaf7e 100644 --- a/src/elm/Pages/Secrets/View.elm +++ b/src/elm/Pages/Secrets/View.elm @@ -471,6 +471,8 @@ allowEventsToList events = [] |> appendLabel events.push.branch "push" |> appendLabel events.push.tag "tag" + |> appendLabel events.push.delete_branch "delete:branch" + |> appendLabel events.push.delete_tag "delete:tag" |> appendLabel events.pull.opened "pull_request:opened" |> appendLabel events.pull.synchronize "pull_request:synchronize" |> appendLabel events.pull.edited "pull_request:edited" diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index 810a9a565..d99b6645b 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -2517,7 +2517,7 @@ secretToKey secret = defaultSecretAllowEvents : AllowEvents defaultSecretAllowEvents = - { push = { branch = True, tag = True }, pull = defaultPullActionsPayload Nothing, deploy = { created = True }, comment = defaultCommentActionsPayload Nothing, schedule = defaultScheduleActionsPayload Nothing } + { push = { branch = True, tag = True, delete_branch = True, delete_tag = True }, pull = defaultPullActionsPayload Nothing, deploy = { created = True }, comment = defaultCommentActionsPayload Nothing, schedule = defaultScheduleActionsPayload Nothing } decodeSecret : Decoder Secret From ac5c4bef49bccfc93a1f4aa4ab6eb684db226d13 Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Mon, 29 Jan 2024 13:37:30 -0600 Subject: [PATCH 3/5] fix: linter --- src/elm/Pages/RepoSettings.elm | 2 +- src/elm/Pages/Secrets/Update.elm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elm/Pages/RepoSettings.elm b/src/elm/Pages/RepoSettings.elm index d16303ad6..3de4fb5d0 100644 --- a/src/elm/Pages/RepoSettings.elm +++ b/src/elm/Pages/RepoSettings.elm @@ -368,7 +368,7 @@ events repo msg = <| msg repo.org repo.name repo "allow_comment_edited" ] - , h3 [ class "settings-subtitle" ] [ text "Delete" ] + , h3 [ class "settings-subtitle" ] [ text "Delete" ] , div [ class "form-controls", class "-two-col" ] [ checkbox "Branch" "allow_push_delete_branch" diff --git a/src/elm/Pages/Secrets/Update.elm b/src/elm/Pages/Secrets/Update.elm index 8d53aa85c..8a5ce4a73 100644 --- a/src/elm/Pages/Secrets/Update.elm +++ b/src/elm/Pages/Secrets/Update.elm @@ -187,7 +187,7 @@ updateSecretEvents sform field value = "allow_push_tag" -> { sform | allowEvents = { events | push = { pushActions | tag = value } } } - + "allow_push_delete_branch" -> { sform | allowEvents = { events | push = { pushActions | delete_branch = value } } } From 2276426d2b0b382b733ef0e1128f446421c00eaf Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Mon, 29 Jan 2024 13:54:46 -0600 Subject: [PATCH 4/5] fix: cypress tests hopefully --- cypress/fixtures/repositories.json | 16 +- cypress/fixtures/repositories_100.json | 400 ++++++++++++++++------ cypress/fixtures/repositories_10a.json | 40 ++- cypress/fixtures/repositories_10b.json | 40 ++- cypress/fixtures/repositories_5.json | 20 +- cypress/fixtures/repository.json | 4 +- cypress/fixtures/repository_inactive.json | 4 +- cypress/fixtures/repository_updated.json | 4 +- cypress/fixtures/secret_org.json | 4 +- cypress/fixtures/secret_repo.json | 4 +- cypress/fixtures/secret_shared.json | 4 +- cypress/fixtures/secrets_org_5.json | 20 +- 12 files changed, 420 insertions(+), 140 deletions(-) diff --git a/cypress/fixtures/repositories.json b/cypress/fixtures/repositories.json index 3a25b7b8d..e3db600f9 100644 --- a/cypress/fixtures/repositories.json +++ b/cypress/fixtures/repositories.json @@ -24,7 +24,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -66,7 +68,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -107,7 +111,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -149,7 +155,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repositories_100.json b/cypress/fixtures/repositories_100.json index a3268deb9..37c804b6a 100644 --- a/cypress/fixtures/repositories_100.json +++ b/cypress/fixtures/repositories_100.json @@ -24,7 +24,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -66,7 +68,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -108,7 +112,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -150,7 +156,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -192,7 +200,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -234,7 +244,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -276,7 +288,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -318,7 +332,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -360,7 +376,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -402,7 +420,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -444,7 +464,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -486,7 +508,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -528,7 +552,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -570,7 +596,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -612,7 +640,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -654,7 +684,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -696,7 +728,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -738,7 +772,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -780,7 +816,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -822,7 +860,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -864,7 +904,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -906,7 +948,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -948,7 +992,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -990,7 +1036,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1032,7 +1080,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1074,7 +1124,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1116,7 +1168,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1158,7 +1212,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1200,7 +1256,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1242,7 +1300,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1284,7 +1344,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1326,7 +1388,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1368,7 +1432,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1410,7 +1476,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1452,7 +1520,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1494,7 +1564,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1536,7 +1608,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1578,7 +1652,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1620,7 +1696,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1662,7 +1740,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1704,7 +1784,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1746,7 +1828,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1788,7 +1872,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1830,7 +1916,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1872,7 +1960,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1914,7 +2004,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1956,7 +2048,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -1998,7 +2092,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2040,7 +2136,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2082,7 +2180,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2124,7 +2224,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2166,7 +2268,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2208,7 +2312,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2250,7 +2356,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2292,7 +2400,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2334,7 +2444,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2376,7 +2488,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2418,7 +2532,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2460,7 +2576,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2502,7 +2620,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2544,7 +2664,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2586,7 +2708,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2628,7 +2752,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2670,7 +2796,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2712,7 +2840,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2754,7 +2884,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2796,7 +2928,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2838,7 +2972,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2880,7 +3016,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2922,7 +3060,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -2964,7 +3104,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3006,7 +3148,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3048,7 +3192,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3090,7 +3236,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3132,7 +3280,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3174,7 +3324,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3216,7 +3368,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3258,7 +3412,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3300,7 +3456,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3342,7 +3500,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3384,7 +3544,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3426,7 +3588,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3468,7 +3632,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3510,7 +3676,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3552,7 +3720,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3594,7 +3764,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3636,7 +3808,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3678,7 +3852,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3720,7 +3896,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3762,7 +3940,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3804,7 +3984,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3846,7 +4028,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3888,7 +4072,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3930,7 +4116,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -3972,7 +4160,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -4014,7 +4204,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -4056,7 +4248,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -4098,7 +4292,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -4140,7 +4336,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -4182,7 +4380,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repositories_10a.json b/cypress/fixtures/repositories_10a.json index fb7e6c138..834a1e1e4 100644 --- a/cypress/fixtures/repositories_10a.json +++ b/cypress/fixtures/repositories_10a.json @@ -24,7 +24,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -66,7 +68,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -108,7 +112,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -150,7 +156,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -192,7 +200,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -234,7 +244,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -276,7 +288,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -318,7 +332,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -360,7 +376,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -402,7 +420,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repositories_10b.json b/cypress/fixtures/repositories_10b.json index 34098857c..e6d69a7a7 100644 --- a/cypress/fixtures/repositories_10b.json +++ b/cypress/fixtures/repositories_10b.json @@ -24,7 +24,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -66,7 +68,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -108,7 +112,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -150,7 +156,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -192,7 +200,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -234,7 +244,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -276,7 +288,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -318,7 +332,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -360,7 +376,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -402,7 +420,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repositories_5.json b/cypress/fixtures/repositories_5.json index 51b46bdcb..41222f613 100644 --- a/cypress/fixtures/repositories_5.json +++ b/cypress/fixtures/repositories_5.json @@ -23,7 +23,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -65,7 +67,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -107,7 +111,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -149,7 +155,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -191,7 +199,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repository.json b/cypress/fixtures/repository.json index 6a4f6da8e..e9e0b395a 100644 --- a/cypress/fixtures/repository.json +++ b/cypress/fixtures/repository.json @@ -22,7 +22,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repository_inactive.json b/cypress/fixtures/repository_inactive.json index cc43faf38..f187528c8 100644 --- a/cypress/fixtures/repository_inactive.json +++ b/cypress/fixtures/repository_inactive.json @@ -22,7 +22,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/repository_updated.json b/cypress/fixtures/repository_updated.json index 10c69294c..c0adf6aec 100644 --- a/cypress/fixtures/repository_updated.json +++ b/cypress/fixtures/repository_updated.json @@ -22,7 +22,9 @@ "allow_events": { "push": { "branch": false, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/secret_org.json b/cypress/fixtures/secret_org.json index 2e44df64e..c8d6b4775 100644 --- a/cypress/fixtures/secret_org.json +++ b/cypress/fixtures/secret_org.json @@ -11,7 +11,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/secret_repo.json b/cypress/fixtures/secret_repo.json index 8281b8793..f5b84df18 100644 --- a/cypress/fixtures/secret_repo.json +++ b/cypress/fixtures/secret_repo.json @@ -11,7 +11,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/secret_shared.json b/cypress/fixtures/secret_shared.json index 1f11e9a7b..79e0b7739 100644 --- a/cypress/fixtures/secret_shared.json +++ b/cypress/fixtures/secret_shared.json @@ -11,7 +11,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, diff --git a/cypress/fixtures/secrets_org_5.json b/cypress/fixtures/secrets_org_5.json index 006f90103..4b1d843ea 100644 --- a/cypress/fixtures/secrets_org_5.json +++ b/cypress/fixtures/secrets_org_5.json @@ -12,7 +12,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -46,7 +48,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -80,7 +84,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -114,7 +120,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, @@ -148,7 +156,9 @@ "allow_events": { "push": { "branch": true, - "tag": false + "tag": false, + "delete_branch": false, + "delete_tag": false }, "pull_request": { "opened": false, From 519e3d69b968bf975795d155b94f487a5f05116b Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Wed, 31 Jan 2024 09:13:17 -0600 Subject: [PATCH 5/5] fix: default secret allow events --- src/elm/Vela.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index d99b6645b..b57dff10a 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -2517,7 +2517,7 @@ secretToKey secret = defaultSecretAllowEvents : AllowEvents defaultSecretAllowEvents = - { push = { branch = True, tag = True, delete_branch = True, delete_tag = True }, pull = defaultPullActionsPayload Nothing, deploy = { created = True }, comment = defaultCommentActionsPayload Nothing, schedule = defaultScheduleActionsPayload Nothing } + { push = { branch = True, tag = True, delete_branch = False, delete_tag = False }, pull = defaultPullActionsPayload Nothing, deploy = { created = True }, comment = defaultCommentActionsPayload Nothing, schedule = defaultScheduleActionsPayload Nothing } decodeSecret : Decoder Secret