Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Expose admin use in forge implementation #27

Description

@realaravinth

Various forges might have different ways to identify a user(username, email ,etc). An interface should be made available to get the admin user's identifier so that hard coding admin user values like we are doing here:

interface/git.py
34:    def __init__(self, forge: Forge, admin_user: str, admin_email):
36:        self.admin = InterfaceAdmin(admin_email, admin_user)

interface/forges/base.py
30:    def __init__(self, host):  # self, base_url: str, admin_user: str, admin_email):

interface/forges/gitea.py
31:    def __init__(self):  # self, base_url: str, admin_user: str, admin_email):
➜  tmp.6358p3u9wv git:(master) rg GITEA.user
interface/forges/gitea.py
211:        path = format("/%s/%s" % CONFIG.GITEA.username, repo)
216:            "git@%s:%s/%s.git" % (self.host.netloc, CONFIG.GITEA.username, repo)

interface/runner.py
97:                if all([n["type"] == PULL, owner == CONFIG.GITEA.username]):

interface/git.py
88:    git = Git(forge, CONFIG.GITEA.username, CONFIG.SYSTEM.admin_email)

Possible Solution:

class Forge:
  def __init__(self, host, admin_user, admin_email):
    self.admin_user = admin_user
    self.admin_email = admin_email
  ...
class Gitea(Forge):
   def __init__(self):
       super().__init__(settings.GITEA.host, settings.GITEA.username, settings.SYSTEM.admin_email)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions