From 4468b895f1ac436d81b05625c7a356703d3cb19e Mon Sep 17 00:00:00 2001 From: William Lyles <26171886+wilyle@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:09:30 -0700 Subject: [PATCH 1/4] add branch protection --- otterdog/eclipse-ibeji.jsonnet | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/otterdog/eclipse-ibeji.jsonnet b/otterdog/eclipse-ibeji.jsonnet index 0d30680..501141d 100644 --- a/otterdog/eclipse-ibeji.jsonnet +++ b/otterdog/eclipse-ibeji.jsonnet @@ -21,8 +21,15 @@ orgs.newOrg('eclipse-ibeji') { allow_merge_commit: true, allow_update_branch: false, delete_branch_on_merge: false, + description: "freyja project", secret_scanning_push_protection: "disabled", web_commit_signoff_required: false, + branch_protection_rules: [ + orgs.newBranchProtectionRule('main') { + dismisses_stale_reviews: true, + required_approving_review_count: 1, + }, + ], }, orgs.newRepo('ibeji') { allow_merge_commit: true, @@ -31,6 +38,12 @@ orgs.newOrg('eclipse-ibeji') { description: "ibeji project", secret_scanning_push_protection: "disabled", web_commit_signoff_required: false, + branch_protection_rules: [ + orgs.newBranchProtectionRule('main') { + dismisses_stale_reviews: true, + required_approving_review_count: 1, + }, + ], }, orgs.newRepo('ibeji-example-applications') { allow_merge_commit: true, @@ -39,6 +52,12 @@ orgs.newOrg('eclipse-ibeji') { description: "ibeji project example applications and integrations with other components", secret_scanning_push_protection: "disabled", web_commit_signoff_required: false, + branch_protection_rules: [ + orgs.newBranchProtectionRule('main') { + dismisses_stale_reviews: true, + required_approving_review_count: 1, + }, + ], }, ], } From df96f5e644e10f698a5b842574ef06a52e25470e Mon Sep 17 00:00:00 2001 From: William Lyles <26171886+wilyle@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:20:58 -0700 Subject: [PATCH 2/4] enable secret scanning --- otterdog/eclipse-ibeji.jsonnet | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/otterdog/eclipse-ibeji.jsonnet b/otterdog/eclipse-ibeji.jsonnet index 501141d..6d6c1ae 100644 --- a/otterdog/eclipse-ibeji.jsonnet +++ b/otterdog/eclipse-ibeji.jsonnet @@ -22,7 +22,7 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "freyja project", - secret_scanning_push_protection: "disabled", + secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ orgs.newBranchProtectionRule('main') { @@ -36,7 +36,7 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "ibeji project", - secret_scanning_push_protection: "disabled", + secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ orgs.newBranchProtectionRule('main') { @@ -50,7 +50,7 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "ibeji project example applications and integrations with other components", - secret_scanning_push_protection: "disabled", + secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ orgs.newBranchProtectionRule('main') { From 970697f9df8141947aa54a3f189d19a83214aa1f Mon Sep 17 00:00:00 2001 From: William Lyles <26171886+wilyle@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:24:15 -0700 Subject: [PATCH 3/4] common definition --- otterdog/eclipse-ibeji.jsonnet | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/otterdog/eclipse-ibeji.jsonnet b/otterdog/eclipse-ibeji.jsonnet index 6d6c1ae..a53aa99 100644 --- a/otterdog/eclipse-ibeji.jsonnet +++ b/otterdog/eclipse-ibeji.jsonnet @@ -1,5 +1,10 @@ local orgs = import 'vendor/otterdog-defaults/otterdog-defaults.libsonnet'; +local ibejiBranchProtectionRule(branchName) = orgs.newBranchProtectionRule(branchName) { + dismisses_stale_reviews: true, + required_approving_review_count: 1, +}; + orgs.newOrg('eclipse-ibeji') { settings+: { default_repository_permission: "none", @@ -25,10 +30,7 @@ orgs.newOrg('eclipse-ibeji') { secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ - orgs.newBranchProtectionRule('main') { - dismisses_stale_reviews: true, - required_approving_review_count: 1, - }, + ibejiBranchProtectionRule('main'), ], }, orgs.newRepo('ibeji') { @@ -39,10 +41,7 @@ orgs.newOrg('eclipse-ibeji') { secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ - orgs.newBranchProtectionRule('main') { - dismisses_stale_reviews: true, - required_approving_review_count: 1, - }, + ibejiBranchProtectionRule('main'), ], }, orgs.newRepo('ibeji-example-applications') { @@ -53,10 +52,7 @@ orgs.newOrg('eclipse-ibeji') { secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ - orgs.newBranchProtectionRule('main') { - dismisses_stale_reviews: true, - required_approving_review_count: 1, - }, + ibejiBranchProtectionRule('main'), ], }, ], From 62bf4acc9a46bb583e64ab4e56e47d1483bfb7dc Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Wed, 18 Oct 2023 22:25:46 +0200 Subject: [PATCH 4/4] Remove redundant setting. Signed-off-by: Thomas Neidhart --- otterdog/eclipse-ibeji.jsonnet | 3 --- 1 file changed, 3 deletions(-) diff --git a/otterdog/eclipse-ibeji.jsonnet b/otterdog/eclipse-ibeji.jsonnet index a53aa99..c251c7d 100644 --- a/otterdog/eclipse-ibeji.jsonnet +++ b/otterdog/eclipse-ibeji.jsonnet @@ -27,7 +27,6 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "freyja project", - secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ ibejiBranchProtectionRule('main'), @@ -38,7 +37,6 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "ibeji project", - secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ ibejiBranchProtectionRule('main'), @@ -49,7 +47,6 @@ orgs.newOrg('eclipse-ibeji') { allow_update_branch: false, delete_branch_on_merge: false, description: "ibeji project example applications and integrations with other components", - secret_scanning_push_protection: "enabled", web_commit_signoff_required: false, branch_protection_rules: [ ibejiBranchProtectionRule('main'),