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

Loosen branch protection rules to just primary and release ones #7

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

jonahgraham
Copy link
Member

As recommended here https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4330#note_1798317

PS at some future time we may try to resolve cdt-lsp calling default branch master and cdt calling default branch main

@ghentschke FYI with this change merged it means that temporary branches will be deletable by committers.

@jonahgraham jonahgraham requested review from a team as code owners February 22, 2024 16:36
Copy link

Diff for 69fb901:
Printing local diff:

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

Organization tools.cdt[id=eclipse-cdt]
  there have been 2 validation infos, enable verbose output with '-v' to to display them.

-   remove branch_protection_rule[pattern="*", repository="cdt"] {
-     allows_deletions                  = false
-     allows_force_pushes               = false
-     blocks_creations                  = false
-     bypass_force_push_allowances      = []
-     bypass_pull_request_allowances    = []
-     dismisses_stale_reviews           = false
-     is_admin_enforced                 = false
-     lock_allows_fetch_and_merge       = false
-     lock_branch                       = false
-     pattern                           = "*"
-     require_last_push_approval        = false
-     required_approving_review_count   = "0"
-     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
-   }

+   add branch_protection_rule[pattern="main", repository="cdt"] {
+     allows_deletions                  = false
+     allows_force_pushes               = false
+     blocks_creations                  = false
+     bypass_force_push_allowances      = []
+     bypass_pull_request_allowances    = []
+     dismisses_stale_reviews           = false
+     is_admin_enforced                 = false
+     lock_allows_fetch_and_merge       = false
+     lock_branch                       = false
+     pattern                           = "main"
+     require_last_push_approval        = false
+     required_approving_review_count   = "0"
+     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
+   }

+   add branch_protection_rule[pattern="org.eclipse.remote-master", repository="cdt"] {
+     allows_deletions                  = false
+     allows_force_pushes               = false
+     blocks_creations                  = false
+     bypass_force_push_allowances      = []
+     bypass_pull_request_allowances    = []
+     dismisses_stale_reviews           = false
+     is_admin_enforced                 = false
+     lock_allows_fetch_and_merge       = false
+     lock_branch                       = false
+     pattern                           = "org.eclipse.remote-master"
+     require_last_push_approval        = false
+     required_approving_review_count   = "0"
+     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
+   }

+   add branch_protection_rule[pattern="cdt_*", repository="cdt"] {
+     allows_deletions                  = false
+     allows_force_pushes               = false
+     blocks_creations                  = false
+     bypass_force_push_allowances      = []
+     bypass_pull_request_allowances    = []
+     dismisses_stale_reviews           = false
+     is_admin_enforced                 = false
+     lock_allows_fetch_and_merge       = false
+     lock_branch                       = false
+     pattern                           = "cdt_*"
+     require_last_push_approval        = false
+     required_approving_review_count   = "0"
+     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
+   }

-   remove branch_protection_rule[pattern="*", repository="cdt-lsp"] {
-     allows_deletions                  = false
-     allows_force_pushes               = false
-     blocks_creations                  = false
-     bypass_force_push_allowances      = []
-     bypass_pull_request_allowances    = []
-     dismisses_stale_reviews           = false
-     is_admin_enforced                 = false
-     lock_allows_fetch_and_merge       = false
-     lock_branch                       = false
-     pattern                           = "*"
-     require_last_push_approval        = false
-     required_approving_review_count   = "0"
-     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
-   }

+   add branch_protection_rule[pattern="master", repository="cdt-lsp"] {
+     allows_deletions                  = false
+     allows_force_pushes               = false
+     blocks_creations                  = false
+     bypass_force_push_allowances      = []
+     bypass_pull_request_allowances    = []
+     dismisses_stale_reviews           = false
+     is_admin_enforced                 = false
+     lock_allows_fetch_and_merge       = false
+     lock_branch                       = false
+     pattern                           = "master"
+     require_last_push_approval        = false
+     required_approving_review_count   = "0"
+     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
+   }

+   add branch_protection_rule[pattern="cdt_lsp_*", repository="cdt-lsp"] {
+     allows_deletions                  = false
+     allows_force_pushes               = false
+     blocks_creations                  = false
+     bypass_force_push_allowances      = []
+     bypass_pull_request_allowances    = []
+     dismisses_stale_reviews           = false
+     is_admin_enforced                 = false
+     lock_allows_fetch_and_merge       = false
+     lock_branch                       = false
+     pattern                           = "cdt_lsp_*"
+     require_last_push_approval        = false
+     required_approving_review_count   = "0"
+     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: 5 to add, 0 to change, 2 to delete.
Canonical Diff for 69fb901:
Showing canonical diff:

Organization tools.cdt[id=eclipse-cdt]

--- canonical
+++ original
@@ -1,17 +1,14 @@
 local orgs = import 'vendor/otterdog-defaults/otterdog-defaults.libsonnet';
 
-local custom_branch_protection_rule(pattern) = 
-  orgs.newBranchProtectionRule(pattern) {
-
-    required_approving_review_count: 0
-  };
 orgs.newOrg('eclipse-cdt') {
   _repositories+:: [
     orgs.newRepo('.github') {
       allow_merge_commit: true
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('main')
+        orgs.newBranchProtectionRule('main') {
+          required_approving_review_count: 0
+        }
       ]
       delete_branch_on_merge: false
       dependabot_alerts_enabled: false
@@ -28,9 +25,15 @@
       allow_auto_merge: true
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('cdt_*')
-        custom_branch_protection_rule('main')
-        custom_branch_protection_rule('org.eclipse.remote-master')
+        orgs.newBranchProtectionRule('cdt_*') {
+          required_approving_review_count: 0
+        }
+        orgs.newBranchProtectionRule('main') {
+          required_approving_review_count: 0
+        }
+        orgs.newBranchProtectionRule('org.eclipse.remote-master') {
+          required_approving_review_count: 0
+        }
       ]
       delete_branch_on_merge: false
       dependabot_security_updates_enabled: true
@@ -47,7 +50,9 @@
       allow_merge_commit: true
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('*')
+        orgs.newBranchProtectionRule('*') {
+          required_approving_review_count: 0
+        }
       ]
       default_branch: "master"
       delete_branch_on_merge: false
@@ -61,8 +66,12 @@
     orgs.newRepo('cdt-lsp') {
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('cdt_lsp_*')
-        custom_branch_protection_rule('master')
+        orgs.newBranchProtectionRule('cdt_lsp_*') {
+          required_approving_review_count: 0
+        }
+        orgs.newBranchProtectionRule('master') {
+          required_approving_review_count: 0
+        }
       ]
       default_branch: "master"
       delete_branch_on_merge: false
@@ -76,7 +85,9 @@
     orgs.newRepo('cdt-new-managedbuild-prototype') {
       archived: true
       branch_protection_rules: [
-        custom_branch_protection_rule('*')
+        orgs.newBranchProtectionRule('*') {
+          required_approving_review_count: 0
+        }
       ]
       default_branch: "master"
       description: "Prototype of new Managed Build system for Eclipse CDT"
@@ -88,7 +99,9 @@
     orgs.newRepo('cdt-vscode') {
       archived: true
       branch_protection_rules: [
-        custom_branch_protection_rule('*')
+        orgs.newBranchProtectionRule('*') {
+          required_approving_review_count: 0
+        }
       ]
       default_branch: "master"
       description: "C/C++ Development Tooling (CDT) Visual Studio Code extension"

@netomi netomi merged commit a10b39d into eclipse-cdt:main Feb 22, 2024
2 checks passed
@netomi
Copy link
Contributor

netomi commented Feb 22, 2024

changes are live.

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.

2 participants