Skip to content

Commit

Permalink
Skip ACLs syncing for other forges than Pagure (packit#2318)
Browse files Browse the repository at this point in the history
Skip ACLs syncing for other forges than Pagure

For GitLab, the maintainers should be able to push to the PR by default without the need to sync the ACLs.
Fixes packit/packit-service#2429

RELEASE NOTES BEGIN
We have fixed the syncing of ACLs for propose-downtream for CentOS Stream.
RELEASE NOTES END

Reviewed-by: František Lachman <[email protected]>
  • Loading branch information
softwarefactory-project-zuul[bot] authored May 27, 2024
2 parents e009705 + 8cc15a3 commit 1268842
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packit/distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from fedora.client import AuthError
from lazy_object_proxy import Proxy
from ogr.abstract import PullRequest
from ogr.services.pagure import PagureProject
from specfile.utils import NEVR

from packit.base_git import PackitRepositoryBase
Expand Down Expand Up @@ -297,8 +298,8 @@ def push_to_fork(
"Unable to create a fork of repository "
f"{self.local_project.git_project.full_repo_name}",
)
if sync_acls:
# synchronize ACLs between original repo and fork
if sync_acls and isinstance(self.local_project.git_project, PagureProject):
# synchronize ACLs between original repo and fork for Pagure
self.sync_acls(self.local_project.git_project, fork)
fork_urls = fork.get_git_urls()
self.local_project.git_repo.create_remote(
Expand Down
8 changes: 6 additions & 2 deletions packit/upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import git
from lazy_object_proxy import Proxy
from ogr.services.pagure import PagureProject

from packit.actions import ActionName
from packit.base_git import PackitRepositoryBase
Expand Down Expand Up @@ -154,8 +155,11 @@ def push_to_fork(
# ogr is awesome! if you want to fork your own repo, you'll get it!
project = self.local_project.git_project.get_fork(create=True)

if sync_acls:
# synchronize ACLs between original repo and fork
if sync_acls and isinstance(
self.local_project.git_project,
PagureProject,
):
# synchronize ACLs between original repo and fork for Pagure
self.sync_acls(self.local_project.git_project, project)

fork_username = project.namespace
Expand Down

0 comments on commit 1268842

Please sign in to comment.