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

Enable branch protection and auto merge #1

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Conversation

laeubi
Copy link
Member

@laeubi laeubi commented Jan 29, 2024

This enables branch protection and automerge

This enables branch protection and automerge

Signed-off-by: Christoph Läubrich <[email protected]>
@laeubi laeubi requested review from a team as code owners January 29, 2024 08:33

This comment has been minimized.

required_status_checks+: [
"continuous-integration/jenkins/pr-head",
"eclipsefdn/eca",
"License vetting status check"
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not totally sure about this, what I found in some examples it seem to need match a name.

Basically I want that this check is mandatory:
https://github.com/eclipse-tycho/tycho/actions/workflows/licensecheck.yml

Copy link
Contributor

Choose a reason for hiding this comment

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

the additional eclipsefdn/eca check is is not needed, as it is already inherited from the default.

For the license checking status, you should use

"call-license-check / check-licenses"

I checked it via the web ui and that the status that is detected. It follows the rules that are explained here: https://otterdog.readthedocs.io/en/latest/reference/organization/repository/status-check/

the jenkins status is correct afacit.

Copy link
Contributor

Choose a reason for hiding this comment

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

here is a screenshot from the web ui:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a link to the webui? Is it possible to edit the project file with that so one don't need to edit file by hand?

Signed-off-by: Christoph Läubrich <[email protected]>
@laeubi
Copy link
Member Author

laeubi commented Jan 29, 2024

@netomi thanks for the hints, I now updated the PR.

Copy link

Diff for 5c93936:
Printing local diff:

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

Organization technology.tycho[id=eclipse-tycho]
  there have been 3 validation infos, enable verbose output with '-v' to to display them.

  
!   repository[name="tycho"] {
!     allow_auto_merge                 = false -> true
!     allow_merge_commit               = true -> false
!     homepage                         = "" -> "https://tycho.eclipseprojects.io"
!     topics                           = "['build-tool', 'eclipse', 'java']" -> "['build-tool', 'eclipse', 'java', 'maven', 'OSGi']"
!   }

+   add repo_ruleset[name="main", repository="tycho"] {
+     allows_creations                 = false
+     allows_deletions                 = false
+     allows_force_pushes              = false
+     allows_updates                   = true
+     bypass_actors                    = [
+       "@eclipse-tycho/technology-tycho-committers"
+     ],
+     dismisses_stale_reviews          = true
+     enforcement                      = "active"
+     exclude_refs                     = []
+     include_refs                     = [
+       "refs/heads/main"
+     ],
+     name                             = "main"
+     required_approving_review_count  = "0"
+     required_status_checks           = [
+       "eclipse-eca-validation:eclipsefdn/eca"
+       "continuous-integration/jenkins/pr-head"
+       "call-license-check / check-licenses"
+     ],
+     requires_code_owner_review       = false
+     requires_commit_signatures       = false
+     requires_deployments             = false
+     requires_last_push_approval      = false
+     requires_linear_history          = false
+     requires_pull_request            = true
+     requires_review_thread_resolution = false
+     requires_status_checks           = true
+     requires_strict_status_checks    = false
+   }
  
  Plan: 1 to add, 4 to change, 0 to delete.
Canonical Diff for 5c93936:
Showing canonical diff:

Organization technology.tycho[id=eclipse-tycho]

--- canonical
+++ original
@@ -18,8 +18,6 @@
       gh_pages_build_type: "legacy"
       gh_pages_source_branch: "main"
       gh_pages_source_path: "/"
-      secret_scanning: "enabled"
-      secret_scanning_push_protection: "enabled"
       web_commit_signoff_required: false
       workflows+: {
         default_workflow_permissions: "write"
@@ -27,7 +25,6 @@
     }
     orgs.newRepo('tycho') {
       allow_auto_merge: true
-      allow_merge_commit: false
       delete_branch_on_merge: false
       dependabot_security_updates_enabled: true
       description: "Tycho project repository (tycho)"
@@ -52,8 +49,6 @@
           requires_review_thread_resolution: false
         }
       ]
-      secret_scanning: "enabled"
-      secret_scanning_push_protection: "enabled"
       secrets: [
         orgs.newRepoSecret('GIST_TOKEN') {
           value: "********"

@netomi
Copy link
Contributor

netomi commented Jan 29, 2024

LGTM, can some project lead approve that change?

@laeubi
Copy link
Member Author

laeubi commented Jan 29, 2024

I approve this as PL of Tycho project, maybe @akurtakov can give approval as well.

Copy link
Member

@akurtakov akurtakov left a comment

Choose a reason for hiding this comment

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

Fine with me.

@laeubi
Copy link
Member Author

laeubi commented Jan 29, 2024

@netomi one thing I noticed:

I cant approve this PR because it says

Pull request authors can’t approve their own pull request

that seems a bit odd here as a PL can then never approve its own proposed changes :-D

@netomi
Copy link
Contributor

netomi commented Jan 29, 2024

@netomi one thing I noticed:

I cant approve this PR because it says

Pull request authors can’t approve their own pull request

that seems a bit odd here as a PL can then never approve its own proposed changes :-D

thats normal GitHub behavior. You cant approve your own PRs.

@netomi netomi merged commit 42c0aa8 into eclipse-tycho:main Jan 29, 2024
2 checks passed
@netomi
Copy link
Contributor

netomi commented Jan 29, 2024

changes are live. Two minor things that I had to fix:

  • topics must start with a lowercase letter or number, so OSGi was not allowed, I changed that to osgi, will add a validation rule
  • the committers team could not be used as bypass actor as it is a secret team, and secret teams can not be used for that. We plan to change the team to public but for now I enabled bypass for all actors with write permissions to the repo which is more or less the same as committers

@laeubi
Copy link
Member Author

laeubi commented Jan 29, 2024

@netomi thanks, anyone with write access is fine, we want to use the protection rules manly for auto merge feature and otherwhise trust that committers do the right things (e.g. only bypass checks if they are sure it will fix something very important and the check is broken).

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