Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branch protection #3

Merged
merged 4 commits into from
Oct 18, 2023
Merged

Add branch protection #3

merged 4 commits into from
Oct 18, 2023

Conversation

wilyle
Copy link
Contributor

@wilyle wilyle commented Oct 18, 2023

Add branch protection rules to Ibeji repos. These are based on the branch protection rules defined for Chariott

@wilyle wilyle requested review from a team as code owners October 18, 2023 20:10
@github-actions

This comment has been minimized.

@@ -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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either this PR or a separate one, but 'secret_scanning_push_protection' should either be removed and/or enabled.

@netomi
Copy link
Contributor

netomi commented Oct 18, 2023

the PR LGTM, just some food for thought. Some projects defined a template for their branch protection rules that they would like to use for all repos so that the settings dont have to be repeated. Take a look here:

https://github.com/eclipse-vertx/.eclipsefdn/blob/main/otterdog/eclipse-vertx.jsonnet#L3

this might be of interest for you at some time.

@wilyle
Copy link
Contributor Author

wilyle commented Oct 18, 2023

the PR LGTM, just some food for thought. Some projects defined a template for their branch protection rules that they would like to use for all repos so that the settings dont have to be repeated. Take a look here:

https://github.com/eclipse-vertx/.eclipsefdn/blob/main/otterdog/eclipse-vertx.jsonnet#L3

this might be of interest for you at some time.

I like this idea, I'll go ahead and do it here too

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Signed-off-by: Thomas Neidhart <thomas.neidhart@eclipse-foundation.org>
@github-actions
Copy link

Diff for e289266:
Printing local diff for configuration at '/home/runner/work/.eclipsefdn/.eclipsefdn/otterdog-configs/otterdog.json'

Actions are indicated with the following symbols:
+   create
!   modify
!   forced update
-   delete

Organization eclipse-ibeji[id=eclipse-ibeji]

  
!   repository[name="freyja"] {
!     description                                              = null -> "freyja project"
!     secret_scanning_push_protection                          = "disabled" -> "enabled"
!   }

+   add branch_protection_rule[pattern="main", repository="freyja"] {
+     allows_deletions                                         = false
+     allows_force_pushes                                      = false
+     blocks_creations                                         = false
+     bypass_force_push_allowances                             = []
+     bypass_pull_request_allowances                           = []
+     dismisses_stale_reviews                                  = true
+     is_admin_enforced                                        = false
+     lock_allows_fetch_and_merge                              = false
+     lock_branch                                              = false
+     pattern                                                  = "main"
+     require_last_push_approval                               = false
+     required_approving_review_count                          = "1"
+     required_status_checks                                   = [
+       "eclipse-eca-validation:eclipsefdn/eca"
+     ],
+     requires_code_owner_reviews                              = false
+     requires_commit_signatures                               = false
+     requires_conversation_resolution                         = false
+     requires_deployments                                     = false
+     requires_linear_history                                  = false
+     requires_pull_request                                    = true
+     requires_status_checks                                   = true
+     requires_strict_status_checks                            = false
+     restricts_pushes                                         = false
+     restricts_review_dismissals                              = false
+   }

  
!   repository[name="ibeji"] {
!     secret_scanning_push_protection                          = "disabled" -> "enabled"
!   }

+   add branch_protection_rule[pattern="main", repository="ibeji"] {
+     allows_deletions                                         = false
+     allows_force_pushes                                      = false
+     blocks_creations                                         = false
+     bypass_force_push_allowances                             = []
+     bypass_pull_request_allowances                           = []
+     dismisses_stale_reviews                                  = true
+     is_admin_enforced                                        = false
+     lock_allows_fetch_and_merge                              = false
+     lock_branch                                              = false
+     pattern                                                  = "main"
+     require_last_push_approval                               = false
+     required_approving_review_count                          = "1"
+     required_status_checks                                   = [
+       "eclipse-eca-validation:eclipsefdn/eca"
+     ],
+     requires_code_owner_reviews                              = false
+     requires_commit_signatures                               = false
+     requires_conversation_resolution                         = false
+     requires_deployments                                     = false
+     requires_linear_history                                  = false
+     requires_pull_request                                    = true
+     requires_status_checks                                   = true
+     requires_strict_status_checks                            = false
+     restricts_pushes                                         = false
+     restricts_review_dismissals                              = false
+   }

  
!   repository[name="ibeji-example-applications"] {
!     secret_scanning_push_protection                          = "disabled" -> "enabled"
!   }

+   add branch_protection_rule[pattern="main", repository="ibeji-example-applications"] {
+     allows_deletions                                         = false
+     allows_force_pushes                                      = false
+     blocks_creations                                         = false
+     bypass_force_push_allowances                             = []
+     bypass_pull_request_allowances                           = []
+     dismisses_stale_reviews                                  = true
+     is_admin_enforced                                        = false
+     lock_allows_fetch_and_merge                              = false
+     lock_branch                                              = false
+     pattern                                                  = "main"
+     require_last_push_approval                               = false
+     required_approving_review_count                          = "1"
+     required_status_checks                                   = [
+       "eclipse-eca-validation:eclipsefdn/eca"
+     ],
+     requires_code_owner_reviews                              = false
+     requires_commit_signatures                               = false
+     requires_conversation_resolution                         = false
+     requires_deployments                                     = false
+     requires_linear_history                                  = false
+     requires_pull_request                                    = true
+     requires_status_checks                                   = true
+     requires_strict_status_checks                            = false
+     restricts_pushes                                         = false
+     restricts_review_dismissals                              = false
+   }
  
  Plan: 3 to add, 4 to change, 0 to delete.
Showing diff to a canonical version of the configuration at '/home/runner/work/.eclipsefdn/.eclipsefdn/otterdog-configs/otterdog.json'

Organization eclipse-ibeji[id=eclipse-ibeji]
--- original
+++ canonical
@@ -1,15 +1,16 @@
 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') {
   _repositories+:: [
     orgs.newRepo('freyja') {
       allow_merge_commit: true
       allow_update_branch: false
       branch_protection_rules: [
-        orgs.newBranchProtectionRule('main') {
-          dismisses_stale_reviews: true
-          required_approving_review_count: 1
-        }
+        ibejiBranchProtectionRule('main')
       ]
       delete_branch_on_merge: false
       description: "freyja project"
@@ -19,10 +20,7 @@
       allow_merge_commit: true
       allow_update_branch: false
       branch_protection_rules: [
-        orgs.newBranchProtectionRule('main') {
-          dismisses_stale_reviews: true
-          required_approving_review_count: 1
-        }
+        ibejiBranchProtectionRule('main')
       ]
       delete_branch_on_merge: false
       description: "ibeji project"
@@ -32,10 +30,7 @@
       allow_merge_commit: true
       allow_update_branch: false
       branch_protection_rules: [
-        orgs.newBranchProtectionRule('main') {
-          dismisses_stale_reviews: true
-          required_approving_review_count: 1
-        }
+        ibejiBranchProtectionRule('main')
       ]
       delete_branch_on_merge: false
       description: "ibeji project example applications and integrations with other components"
@@ -58,3 +53,4 @@
     }
   }
 }
+};

@netomi netomi merged commit 4777cac into eclipse-ibeji:main Oct 18, 2023
1 check passed
@netomi
Copy link
Contributor

netomi commented Oct 18, 2023

changes have been applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants