diff --git a/cypress/fixtures/repositories.json b/cypress/fixtures/repositories.json index fc2f37eb4..3a25b7b8d 100644 --- a/cypress/fixtures/repositories.json +++ b/cypress/fixtures/repositories.json @@ -20,7 +20,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 18, @@ -43,7 +62,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 17, @@ -65,7 +103,26 @@ "allow_push": true, "allow_deploy": false, "allow_tag": false, - "allow_comment": false + "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 16, @@ -88,6 +145,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } } ] diff --git a/cypress/fixtures/repositories_100.json b/cypress/fixtures/repositories_100.json index d432f94ae..a3268deb9 100644 --- a/cypress/fixtures/repositories_100.json +++ b/cypress/fixtures/repositories_100.json @@ -20,7 +20,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 1, @@ -43,7 +62,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 2, @@ -66,7 +104,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 3, @@ -89,7 +146,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 4, @@ -112,7 +188,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 5, @@ -135,7 +230,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 6, @@ -158,7 +272,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 7, @@ -181,7 +314,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 8, @@ -204,7 +356,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 9, @@ -227,7 +398,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 10, @@ -250,7 +440,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 11, @@ -273,7 +482,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 12, @@ -296,7 +524,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 13, @@ -319,7 +566,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 14, @@ -342,7 +608,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 15, @@ -365,7 +650,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 16, @@ -388,7 +692,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 17, @@ -411,7 +734,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 18, @@ -434,7 +776,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 19, @@ -457,7 +818,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 20, @@ -480,7 +860,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 21, @@ -503,7 +902,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 22, @@ -526,7 +944,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 23, @@ -549,7 +986,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 24, @@ -572,7 +1028,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 25, @@ -595,7 +1070,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 26, @@ -618,7 +1112,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 27, @@ -641,7 +1154,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 28, @@ -664,7 +1196,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 29, @@ -687,7 +1238,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 30, @@ -710,7 +1280,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 31, @@ -733,7 +1322,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 32, @@ -756,7 +1364,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 33, @@ -779,7 +1406,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 34, @@ -802,7 +1448,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 35, @@ -825,7 +1490,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 36, @@ -848,7 +1532,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 37, @@ -871,7 +1574,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 38, @@ -894,7 +1616,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 39, @@ -917,7 +1658,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 40, @@ -940,7 +1700,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 41, @@ -963,7 +1742,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 42, @@ -986,7 +1784,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 43, @@ -1009,7 +1826,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 44, @@ -1032,7 +1868,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 45, @@ -1055,7 +1910,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 46, @@ -1078,7 +1952,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 47, @@ -1101,7 +1994,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 48, @@ -1124,7 +2036,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 49, @@ -1147,7 +2078,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 50, @@ -1170,7 +2120,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 51, @@ -1193,7 +2162,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 52, @@ -1216,7 +2204,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 53, @@ -1239,7 +2246,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 54, @@ -1262,7 +2288,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 55, @@ -1285,7 +2330,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 56, @@ -1308,7 +2372,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 57, @@ -1331,7 +2414,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 58, @@ -1354,7 +2456,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 59, @@ -1377,7 +2498,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 60, @@ -1400,7 +2540,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 61, @@ -1423,7 +2582,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 62, @@ -1446,7 +2624,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 63, @@ -1469,7 +2666,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 64, @@ -1492,7 +2708,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 65, @@ -1515,7 +2750,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 66, @@ -1538,7 +2792,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 67, @@ -1561,7 +2834,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 68, @@ -1584,7 +2876,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 69, @@ -1607,7 +2918,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 70, @@ -1630,7 +2960,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 71, @@ -1653,7 +3002,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 72, @@ -1676,7 +3044,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 73, @@ -1699,7 +3086,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 74, @@ -1722,7 +3128,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 75, @@ -1745,7 +3170,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 76, @@ -1768,7 +3212,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 77, @@ -1791,7 +3254,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 78, @@ -1814,7 +3296,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 79, @@ -1837,7 +3338,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 80, @@ -1860,7 +3380,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 81, @@ -1883,7 +3422,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 82, @@ -1906,7 +3464,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 83, @@ -1929,7 +3506,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 84, @@ -1952,7 +3548,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 85, @@ -1975,7 +3590,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 86, @@ -1998,7 +3632,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 87, @@ -2021,7 +3674,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 88, @@ -2044,7 +3716,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 89, @@ -2067,7 +3758,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 90, @@ -2090,7 +3800,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 91, @@ -2113,7 +3842,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 92, @@ -2136,7 +3884,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 93, @@ -2159,7 +3926,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 94, @@ -2182,7 +3968,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 95, @@ -2205,7 +4010,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 96, @@ -2228,7 +4052,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 97, @@ -2251,7 +4094,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 98, @@ -2274,7 +4136,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 99, @@ -2297,6 +4178,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } } ] diff --git a/cypress/fixtures/repositories_10a.json b/cypress/fixtures/repositories_10a.json index 689ab5801..fb7e6c138 100644 --- a/cypress/fixtures/repositories_10a.json +++ b/cypress/fixtures/repositories_10a.json @@ -20,7 +20,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 1, @@ -43,7 +62,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 2, @@ -66,7 +104,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 3, @@ -89,7 +146,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 4, @@ -112,7 +188,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 5, @@ -135,7 +230,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 6, @@ -158,7 +272,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 7, @@ -181,7 +314,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 8, @@ -204,7 +356,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 9, @@ -227,6 +398,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } } ] diff --git a/cypress/fixtures/repositories_10b.json b/cypress/fixtures/repositories_10b.json index 82ae85f47..34098857c 100644 --- a/cypress/fixtures/repositories_10b.json +++ b/cypress/fixtures/repositories_10b.json @@ -20,7 +20,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 11, @@ -43,7 +62,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 12, @@ -66,7 +104,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 13, @@ -89,7 +146,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 14, @@ -112,7 +188,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 15, @@ -135,7 +230,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 16, @@ -158,7 +272,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 17, @@ -181,7 +314,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 18, @@ -204,7 +356,26 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } }, { "id": 19, @@ -227,6 +398,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, - "pipeline_type": "yaml" + "pipeline_type": "yaml", + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + } } ] diff --git a/cypress/fixtures/repositories_5.json b/cypress/fixtures/repositories_5.json index b0f07d2e2..51b46bdcb 100644 --- a/cypress/fixtures/repositories_5.json +++ b/cypress/fixtures/repositories_5.json @@ -20,6 +20,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" }, { @@ -43,6 +62,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" }, { @@ -66,6 +104,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" }, { @@ -89,6 +146,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" }, { @@ -112,6 +188,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" } ] diff --git a/cypress/fixtures/repository.json b/cypress/fixtures/repository.json index 1f2e66fdf..4ac27f803 100644 --- a/cypress/fixtures/repository.json +++ b/cypress/fixtures/repository.json @@ -19,6 +19,25 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml", "approve_build": "fork-always" } diff --git a/cypress/fixtures/repository_inactive.json b/cypress/fixtures/repository_inactive.json index 92d8dfc58..cc43faf38 100644 --- a/cypress/fixtures/repository_inactive.json +++ b/cypress/fixtures/repository_inactive.json @@ -19,5 +19,24 @@ "allow_deploy": false, "allow_tag": false, "allow_comment": false, + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml" } diff --git a/cypress/fixtures/repository_updated.json b/cypress/fixtures/repository_updated.json index 8da3b8bbf..10c69294c 100644 --- a/cypress/fixtures/repository_updated.json +++ b/cypress/fixtures/repository_updated.json @@ -19,6 +19,25 @@ "allow_deploy": true, "allow_tag": true, "allow_comment": false, + "allow_events": { + "push": { + "branch": false, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": true + }, + "comment": { + "created": false, + "edited": false + } + }, "pipeline_type": "yaml", "approve_build": "fork-no-write" } diff --git a/cypress/integration/repo_settings.spec.js b/cypress/integration/repo_settings.spec.js index 4a491470b..2324e60ab 100644 --- a/cypress/integration/repo_settings.spec.js +++ b/cypress/integration/repo_settings.spec.js @@ -51,12 +51,14 @@ context('Repo Settings', () => { cy.get('[data-test=repo-settings-events]').should('be.visible'); }); - it('allow_push checkbox should show', () => { - cy.get('[data-test=repo-checkbox-allow_push]').should('be.visible'); + it('allow_push_branch checkbox should show', () => { + cy.get('[data-test=repo-checkbox-allow_push_branch]').should( + 'be.visible', + ); }); - it('clicking allow_push checkbox should toggle the value', () => { - cy.get('[data-test=repo-checkbox-allow_push] input').as( + it('clicking allow_push_branch checkbox should toggle the value', () => { + cy.get('[data-test=repo-checkbox-allow_push_branch] input').as( 'allowPushCheckbox', ); cy.get('@allowPushCheckbox').should('have.checked'); diff --git a/src/elm/Main.elm b/src/elm/Main.elm index 365b36ce8..0ebef7f97 100644 --- a/src/elm/Main.elm +++ b/src/elm/Main.elm @@ -178,6 +178,7 @@ import Vela , UpdateUserPayload , buildUpdateFavoritesPayload , buildUpdateRepoBoolPayload + , buildUpdateRepoEventsPayload , buildUpdateRepoIntPayload , buildUpdateRepoStringPayload , decodeGraphInteraction @@ -433,7 +434,7 @@ type Msg | DisableRepo Repository | ChownRepo Repository | RepairRepo Repository - | UpdateRepoEvent Org Repo Field Bool + | UpdateRepoEvent Org Repo Repository Field Bool | UpdateRepoAccess Org Repo Field String | UpdateRepoForkPolicy Org Repo Field String | UpdateRepoPipelineType Org Repo Field String @@ -1182,11 +1183,11 @@ update msg model = RepairRepo repo -> ( model, Api.try (RepoRepairedResponse repo) <| Api.repairRepo model repo ) - UpdateRepoEvent org repo field value -> + UpdateRepoEvent org name repo field value -> let payload : UpdateRepositoryPayload payload = - buildUpdateRepoBoolPayload field value + buildUpdateRepoEventsPayload repo field value cmd = if Pages.RepoSettings.validEventsUpdate rm.repo payload then @@ -1195,7 +1196,7 @@ update msg model = body = Http.jsonBody <| encodeUpdateRepository payload in - Api.try (RepoUpdatedResponse field) (Api.updateRepository model org repo body) + Api.try (RepoUpdatedResponse field) (Api.updateRepository model org name body) else addErrorString "Could not disable webhook event. At least one event must be active." HandleError diff --git a/src/elm/Pages/RepoSettings.elm b/src/elm/Pages/RepoSettings.elm index c9a7acd77..8dddde1ab 100644 --- a/src/elm/Pages/RepoSettings.elm +++ b/src/elm/Pages/RepoSettings.elm @@ -27,6 +27,7 @@ import Html , div , em , h2 + , h3 , img , input , label @@ -80,10 +81,10 @@ import Vela -- TYPES -{-| CheckboxUpdate : type that takes Msg for forwarding checkbox input callback to Main.elm +{-| EventsUpdate : type that takes Msg for forwarding event checkbox input callback to Main.elm -} -type alias CheckboxUpdate msg = - String -> String -> String -> (Bool -> msg) +type alias EventsUpdate msg = + String -> String -> Repository -> String -> (Bool -> msg) {-| RadioUpdate : type that takes Msg for forwarding radio input callback to Main.elm @@ -107,7 +108,7 @@ type alias StringInputChange msg = {-| Msgs : record containing msgs routeable to Main.elm -} type alias Msgs msg = - { eventsUpdate : CheckboxUpdate msg + { eventsUpdate : EventsUpdate msg , accessUpdate : RadioUpdate msg , forkPolicyUpdate : RadioUpdate msg , limitUpdate : NumberInputChange msg @@ -296,43 +297,78 @@ badge repo velaAPI velaURL copyMsg = {-| events : takes model and repo and renders the settings category for updating repo webhook events -} -events : Repository -> CheckboxUpdate msg -> Html msg +events : Repository -> EventsUpdate msg -> Html msg events repo msg = - section [ class "settings", Util.testAttribute "repo-settings-events" ] - [ h2 [ class "settings-title" ] [ text "Webhook Events" ] - , p [ class "settings-description" ] - [ text "Control which events on Git will trigger Vela pipelines." - , br [] [] - , em [] [ text "Active repositories must have at least one event enabled." ] - ] - , div [ class "form-controls", class "-stack" ] - [ checkbox "Push" - "allow_push" - repo.allow_push - <| - msg repo.org repo.name "allow_push" - , checkbox "Pull Request" - "allow_pull" - repo.allow_pull - <| - msg repo.org repo.name "allow_pull" - , checkbox "Tag" - "allow_tag" - repo.allow_tag - <| - msg repo.org repo.name "allow_tag" - , checkbox "Comment" - "allow_comment" - repo.allow_comment - <| - msg repo.org repo.name "allow_comment" - , checkbox "Deploy" - "allow_deploy" - repo.allow_deploy - <| - msg repo.org repo.name "allow_deploy" - ] - ] + case repo.allow_events of + Nothing -> + text "" + + Just allowEvents -> + section [ class "settings", Util.testAttribute "repo-settings-events" ] + [ h2 [ class "settings-title" ] [ text "Webhook Events" ] + , p [ class "settings-description" ] + [ text "Control which events on Git will trigger Vela pipelines." + , br [] [] + , em [] [ text "Active repositories must have at least one event enabled." ] + ] + , h3 [ class "settings-subtitle" ] [ text "Push" ] + , div [ class "form-controls", class "-two-col" ] + [ checkbox "Push" + "allow_push_branch" + allowEvents.push.branch + <| + msg repo.org repo.name repo "allow_push_branch" + , checkbox "Tag" + "allow_push_tag" + allowEvents.push.tag + <| + msg repo.org repo.name repo "allow_push_tag" + ] + , h3 [ class "settings-subtitle" ] [ text "Pull Request" ] + , div [ class "form-controls", class "-two-col" ] + [ checkbox "Opened" + "allow_pull_opened" + allowEvents.pull.opened + <| + msg repo.org repo.name repo "allow_pull_opened" + , checkbox "Synchronize" + "allow_pull_synchronize" + allowEvents.pull.synchronize + <| + msg repo.org repo.name repo "allow_pull_synchronize" + , checkbox "Edited" + "allow_pull_edited" + allowEvents.pull.edited + <| + msg repo.org repo.name repo "allow_pull_edited" + , checkbox "Reopened" + "allow_pull_reopened" + allowEvents.pull.reopened + <| + msg repo.org repo.name repo "allow_pull_reopened" + ] + , h3 [ class "settings-subtitle" ] [ text "Deployments" ] + , div [ class "form-controls", class "-two-col" ] + [ checkbox "Created" + "allow_deploy_created" + allowEvents.deploy.created + <| + msg repo.org repo.name repo "allow_deploy_created" + ] + , h3 [ class "settings-subtitle" ] [ text "Comment" ] + , div [ class "form-controls", class "-two-col" ] + [ checkbox "Created" + "allow_comment_created" + allowEvents.comment.created + <| + msg repo.org repo.name repo "allow_comment_created" + , checkbox "Edited" + "allow_comment_edited" + allowEvents.comment.edited + <| + msg repo.org repo.name repo "allow_comment_edited" + ] + ] {-| limit : takes model and repo and renders the settings category for updating repo build limit @@ -392,7 +428,7 @@ checkbox name field state msg = , onCheck msg ] [] - , label [ class "form-label", for <| "checkbox-" ++ field ] [ strong [] [ text name ] ] + , label [ class "form-label", for <| "checkbox-" ++ field ] [ text name ] ] @@ -896,20 +932,32 @@ msgPrefix field = "approve_build" -> "$ approve build policy set to " - "allow_pull" -> - "Pull events for $ " + "allow_pull_opened" -> + "Pull opened events for $ " + + "allow_pull_synchronize" -> + "Pull synchronize events for $ " - "allow_push" -> - "Push events for $ " + "allow_pull_edited" -> + "Pull edited events for $ " - "allow_deploy" -> + "allow_pull_reopened" -> + "Pull reopened events for $ " + + "allow_push_branch" -> + "Push branch events for $ " + + "allow_push_tag" -> + "Push tag events for $ " + + "allow_deploy_created" -> "Deploy events for $ " - "allow_tag" -> - "Tag events for $ " + "allow_comment_created" -> + "Comment created events for $ " - "allow_comment" -> - "Comment events for $ " + "allow_comment_edited" -> + "Comment edited events for $ " "build_limit" -> "Build limit for $ " @@ -944,17 +992,77 @@ msgSuffix field repo = "approve_build" -> repo.approve_build ++ "." - "allow_pull" -> - toggleText "allow_pull" repo.allow_pull + "allow_pull_opened" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_pull_opened" allowEvents.pull.opened - "allow_push" -> - toggleText "allow_push" repo.allow_push + "allow_pull_synchronize" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_pull_synchronize" allowEvents.pull.synchronize + + "allow_pull_edited" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_pull_edited" allowEvents.pull.edited + + "allow_pull_reopened" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_pull_reopened" allowEvents.pull.reopened + + "allow_push_branch" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_push_branch" allowEvents.push.branch - "allow_deploy" -> - toggleText "allow_deploy" repo.allow_deploy + "allow_push_tag" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_push_tag" allowEvents.push.tag + + "allow_deploy_created" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_deploy_created" allowEvents.deploy.created + + "allow_comment_created" -> + case repo.allow_events of + Nothing -> + "" + + Just allowEvents -> + toggleText "allow_comment_created" allowEvents.comment.created + + "allow_comment_edited" -> + case repo.allow_events of + Nothing -> + "" - "allow_comment" -> - toggleText "allow_comment" repo.allow_comment + Just allowEvents -> + toggleText "allow_comment_edited" allowEvents.comment.edited "build_limit" -> "set to " ++ String.fromInt repo.limit diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index 921a37ac9..f6538451d 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -5,6 +5,7 @@ SPDX-License-Identifier: Apache-2.0 module Vela exposing ( AddSchedulePayload + , AllowEvents , AuthParams , Build , BuildGraph @@ -87,6 +88,7 @@ module Vela exposing , buildDeploymentPayload , buildUpdateFavoritesPayload , buildUpdateRepoBoolPayload + , buildUpdateRepoEventsPayload , buildUpdateRepoIntPayload , buildUpdateRepoStringPayload , buildUpdateSchedulePayload @@ -919,6 +921,39 @@ type alias Deployment = } +type alias PushActions = + { branch : Bool + , tag : Bool + } + + +type alias PullActions = + { opened : Bool + , synchronize : Bool + , edited : Bool + , reopened : Bool + } + + +type alias DeployActions = + { created : Bool + } + + +type alias CommentActions = + { created : Bool + , edited : Bool + } + + +type alias AllowEvents = + { push : PushActions + , pull : PullActions + , deploy : DeployActions + , comment : CommentActions + } + + type alias Repository = { id : Int , user_id : Int @@ -941,6 +976,7 @@ type alias Repository = , allow_deploy : Bool , allow_tag : Bool , allow_comment : Bool + , allow_events : Maybe AllowEvents , enabled : Enabled , enabling : Enabling , inLimit : Maybe Int @@ -963,6 +999,44 @@ type Enabling | NotAsked_ +decodePushActions : Decoder PushActions +decodePushActions = + Decode.succeed PushActions + |> required "branch" bool + |> required "tag" bool + + +decodePullActions : Decoder PullActions +decodePullActions = + Decode.succeed PullActions + |> required "opened" bool + |> required "synchronize" bool + |> required "edited" bool + |> required "reopened" bool + + +decodeDeployActions : Decoder DeployActions +decodeDeployActions = + Decode.succeed DeployActions + |> required "created" bool + + +decodeCommentActions : Decoder CommentActions +decodeCommentActions = + Decode.succeed CommentActions + |> required "created" bool + |> required "edited" bool + + +decodeAllowEvents : Decoder AllowEvents +decodeAllowEvents = + Decode.succeed AllowEvents + |> required "push" decodePushActions + |> required "pull_request" decodePullActions + |> required "deployment" decodeDeployActions + |> required "comment" decodeCommentActions + + decodeRepositories : Decoder (List Repository) decodeRepositories = Decode.list decodeRepository @@ -992,6 +1066,7 @@ decodeRepository = |> optional "allow_deploy" bool False |> optional "allow_tag" bool False |> optional "allow_comment" bool False + |> optional "allow_events" (Decode.maybe decodeAllowEvents) Nothing -- "enabled" |> optional "active" enabledDecoder NotAsked -- "enabling" @@ -1074,6 +1149,50 @@ encodeEnableRepository repo = , ( "allow_deploy", Encode.bool <| repo.allow_deploy ) , ( "allow_tag", Encode.bool <| repo.allow_tag ) , ( "allow_comment", Encode.bool <| repo.allow_comment ) + , ( "allow_events", encodeOptional encodeAllowEvents repo.allow_events ) + ] + + +encodeAllowEvents : AllowEventsPayload -> Encode.Value +encodeAllowEvents events = + Encode.object + [ ( "push", encodePushActions events.push ) + , ( "pull_request", encodePullActions events.pull ) + , ( "deployment", encodeDeployActions events.deploy ) + , ( "comment", encodeCommentActions events.comment ) + ] + + +encodePushActions : PushActionsPayload -> Encode.Value +encodePushActions push = + Encode.object + [ ( "branch", Encode.bool <| push.branch ) + , ( "tag", Encode.bool <| push.tag ) + ] + + +encodePullActions : PullActionsPayload -> Encode.Value +encodePullActions pull = + Encode.object + [ ( "opened", Encode.bool <| pull.opened ) + , ( "synchronize", Encode.bool <| pull.synchronize ) + , ( "edited", Encode.bool <| pull.edited ) + , ( "reopened", Encode.bool <| pull.reopened ) + ] + + +encodeDeployActions : DeployActionsPayload -> Encode.Value +encodeDeployActions deploy = + Encode.object + [ ( "created", Encode.bool <| deploy.created ) + ] + + +encodeCommentActions : CommentActionsPayload -> Encode.Value +encodeCommentActions comment = + Encode.object + [ ( "created", Encode.bool <| comment.created ) + , ( "edited", Encode.bool <| comment.edited ) ] @@ -1091,12 +1210,46 @@ type alias EnableRepositoryPayload = , allow_deploy : Bool , allow_tag : Bool , allow_comment : Bool + , allow_events : Maybe AllowEventsPayload + } + + +type alias AllowEventsPayload = + { push : PushActionsPayload + , pull : PullActionsPayload + , deploy : DeployActionsPayload + , comment : CommentActionsPayload + } + + +type alias PushActionsPayload = + { branch : Bool + , tag : Bool + } + + +type alias PullActionsPayload = + { opened : Bool + , synchronize : Bool + , edited : Bool + , reopened : Bool + } + + +type alias DeployActionsPayload = + { created : Bool + } + + +type alias CommentActionsPayload = + { created : Bool + , edited : Bool } defaultEnableRepositoryPayload : EnableRepositoryPayload defaultEnableRepositoryPayload = - EnableRepositoryPayload "" "" "" "" "" False False True False False False False False + EnableRepositoryPayload "" "" "" "" "" False False True False False False False False Nothing type alias UpdateRepositoryPayload = @@ -1108,6 +1261,7 @@ type alias UpdateRepositoryPayload = , allow_deploy : Maybe Bool , allow_tag : Maybe Bool , allow_comment : Maybe Bool + , allow_events : Maybe AllowEventsPayload , visibility : Maybe String , approve_build : Maybe String , limit : Maybe Int @@ -1123,7 +1277,57 @@ type alias Field = defaultUpdateRepositoryPayload : UpdateRepositoryPayload defaultUpdateRepositoryPayload = - UpdateRepositoryPayload Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing + UpdateRepositoryPayload Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing + + +defaultAllowEventsPayload : Repository -> AllowEventsPayload +defaultAllowEventsPayload repository = + case repository.allow_events of + Nothing -> + AllowEventsPayload (defaultPushActionsPayload Nothing) (defaultPullActionsPayload Nothing) (defaultDeployActionsPayload Nothing) (defaultCommentActionsPayload Nothing) + + Just events -> + AllowEventsPayload (defaultPushActionsPayload (Just events.push)) (defaultPullActionsPayload (Just events.pull)) (defaultDeployActionsPayload (Just events.deploy)) (defaultCommentActionsPayload (Just events.comment)) + + +defaultPushActionsPayload : Maybe PushActions -> PushActionsPayload +defaultPushActionsPayload pushActions = + case pushActions of + Nothing -> + PushActionsPayload False False + + Just push -> + PushActionsPayload push.branch push.tag + + +defaultPullActionsPayload : Maybe PullActions -> PullActionsPayload +defaultPullActionsPayload pullActions = + case pullActions of + Nothing -> + PullActionsPayload False False False False + + Just pull -> + PullActionsPayload pull.opened pull.synchronize pull.edited pull.reopened + + +defaultDeployActionsPayload : Maybe DeployActions -> DeployActionsPayload +defaultDeployActionsPayload deployActions = + case deployActions of + Nothing -> + DeployActionsPayload False + + Just deploy -> + DeployActionsPayload deploy.created + + +defaultCommentActionsPayload : Maybe CommentActions -> CommentActionsPayload +defaultCommentActionsPayload commentActions = + case commentActions of + Nothing -> + CommentActionsPayload False False + + Just comment -> + CommentActionsPayload comment.created comment.edited encodeUpdateRepository : UpdateRepositoryPayload -> Encode.Value @@ -1137,6 +1341,7 @@ encodeUpdateRepository repo = , ( "allow_deploy", encodeOptional Encode.bool repo.allow_deploy ) , ( "allow_tag", encodeOptional Encode.bool repo.allow_tag ) , ( "allow_comment", encodeOptional Encode.bool repo.allow_comment ) + , ( "allow_events", encodeOptional encodeAllowEvents repo.allow_events ) , ( "visibility", encodeOptional Encode.string repo.visibility ) , ( "approve_build", encodeOptional Encode.string repo.approve_build ) , ( "build_limit", encodeOptional Encode.int repo.limit ) @@ -1166,6 +1371,56 @@ encodeOptionalList encoder value = Encode.null +buildUpdateRepoEventsPayload : Repository -> Field -> Bool -> UpdateRepositoryPayload +buildUpdateRepoEventsPayload repository field value = + let + events = + defaultAllowEventsPayload repository + + pushActions = + events.push + + pullActions = + events.pull + + deployActions = + events.deploy + + commentActions = + events.comment + in + case field of + "allow_push_branch" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | push = { pushActions | branch = value } } } + + "allow_push_tag" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | push = { pushActions | tag = value } } } + + "allow_pull_opened" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | pull = { pullActions | opened = value } } } + + "allow_pull_synchronize" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | pull = { pullActions | synchronize = value } } } + + "allow_pull_edited" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | pull = { pullActions | edited = value } } } + + "allow_pull_reopened" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | pull = { pullActions | reopened = value } } } + + "allow_deploy_created" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | deploy = { deployActions | created = value } } } + + "allow_comment_created" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | comment = { commentActions | created = value } } } + + "allow_comment_edited" -> + { defaultUpdateRepositoryPayload | allow_events = Just { events | comment = { commentActions | edited = value } } } + + _ -> + defaultUpdateRepositoryPayload + + buildUpdateRepoBoolPayload : Field -> Bool -> UpdateRepositoryPayload buildUpdateRepoBoolPayload field value = case field of diff --git a/src/scss/_forms.scss b/src/scss/_forms.scss index b42306367..e7ddc1be7 100644 --- a/src/scss/_forms.scss +++ b/src/scss/_forms.scss @@ -251,6 +251,16 @@ border: none; + // .-two-col is for arranging controls in two columns + &.-two-col { + flex-flow: row wrap; + gap: 0.5rem; + + .form-control { + flex: 0 0 40%; + } + } + .form-control { margin-right: 0.5rem; } diff --git a/src/scss/_settings.scss b/src/scss/_settings.scss index 0640ae976..385d1e6bc 100644 --- a/src/scss/_settings.scss +++ b/src/scss/_settings.scss @@ -23,6 +23,10 @@ &-description { font-size: 1rem; } + + &-subtitle { + margin-bottom: 0; + } } // for the admin action section