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

user's permissions on Issues/PRs #100

Open
7 tasks
marusinm opened this issue Jul 5, 2019 · 11 comments
Open
7 tasks

user's permissions on Issues/PRs #100

marusinm opened this issue Jul 5, 2019 · 11 comments
Labels
area/github Related to GitHub implementation. area/gitlab Related to GitLab implementation. good-first-issue Good for newcomers. Hacktoberfest Participate in https://hacktoberfest.digitalocean.com kind/feature New feature or a request for enhancement. kind/technical-debt The code needs love. Refactoring. pagure Related to Pagure implementation.

Comments

@marusinm
Copy link
Contributor

marusinm commented Jul 5, 2019

Updated by @lachmanfrantisek :

We have a lot of methods related to the permissions (e.g. who can merge/close,..)

It's not consistent, let's clean that!

Feel free to solve this in smaller parts. Just write on what you are going to work...

AC:

The progress is tracked in the following tables. (Any update in the comments is appreciated.)

Project who_can_close_issue() -> Set[str] who_can_merge_pr() -> Set[str] can_close_issue(username: str) -> bool can_merge_pr(username: str) -> bool
abstract 👍 👍 ❗ deprecate the Issue argument
base nothing nothing implement here implement here
Github ? ? ? ?
GitLab ? ? ? ?
Pagure ? ? ? ?
Issue who_can_close() -> Set[str] can_close(username: str) -> bool
abstract implement here 👍
base nothing 👍
Github ? nothing
GitLab ? nothing
Pagure ? nothing
PullRequest who_can_close() -> Set[str] who_can_merge() -> Set[str] can_close(username: str) -> bool can_merge(username: str) -> bool
abstract ? ? ? ?
base nothing nothing implement here implement here
Github ? ? ? ?
GitLab ? ? ? ?
Pagure ? ? ? ?
@lachmanfrantisek lachmanfrantisek added kind/feature New feature or a request for enhancement. area/github Related to GitHub implementation. pagure Related to Pagure implementation. triaged labels Jul 10, 2019
@lachmanfrantisek

This comment has been minimized.

@lachmanfrantisek lachmanfrantisek added area/gitlab Related to GitLab implementation. and removed area/github Related to GitHub implementation. pagure Related to Pagure implementation. labels Sep 18, 2019
@stale

This comment has been minimized.

@stale stale bot added the stale Is the issue still valid? label Dec 31, 2019
@lachmanfrantisek

This comment has been minimized.

@stale stale bot removed the stale Is the issue still valid? label Jan 2, 2020
@lachmanfrantisek lachmanfrantisek added area/github Related to GitHub implementation. good-first-issue Good for newcomers. pagure Related to Pagure implementation. labels Feb 14, 2020
@lachmanfrantisek
Copy link
Member

I've updated the description. This issue is now about cleaning the methods and add the missing parts. Please, check if I don't forget anything.

@lachmanfrantisek lachmanfrantisek added the kind/technical-debt The code needs love. Refactoring. label Feb 14, 2020
@stale

This comment has been minimized.

@stale stale bot added the stale Is the issue still valid? label May 26, 2020
@lachmanfrantisek lachmanfrantisek added pinned and removed stale Is the issue still valid? labels Jun 1, 2020
@lachmanfrantisek lachmanfrantisek added the Hacktoberfest Participate in https://hacktoberfest.digitalocean.com label Sep 30, 2020
@lachmanfrantisek lachmanfrantisek moved this to 📋 Backlog 🔟 in Packit Kanban Board Sep 6, 2022
@pranav33317
Copy link

Yes ma'am , I am working on it , will draft a PR ASAP . Had a question about the unimplemented functions , a lot of the functions are missing return statements and thus giving error . Should I just return default value or raise some error ?
Thanks

@lbarcziova
Copy link
Member

@pranav33317 hello and thanks!

a lot of the functions are missing return statements and thus giving error .

Could you please provide some examples?

@pranav33317
Copy link

pranav33317 commented Mar 21, 2025

@indirect(GithubIssue.get)
def get_issue(self, issue_id: int) -> Issue:
    pass

@indirect(GithubIssue.create)
def create_issue(
    self,
    title: str,
    body: str,
    private: Optional[bool] = None,
    labels: Optional[list[str]] = None,
    assignees: Optional[list[str]] = None,
) -> Issue:
    pass , @indirect(GithubPullRequest.get_list)
def get_pr_list(self, status: PRStatus = PRStatus.open) -> list[PullRequest]:
    pass
 def get_issue_list(
          self,
          status: IssueStatus = IssueStatus.open,
          author: Optional[str] = None,
          assignee: Optional[str] = None,
          labels: Optional[list[str]] = None,
      ) -> list[Issue]:
            pass

@indirect(GithubPullRequest.get)
def get_pr(self, pr_id: int) -> PullRequest:
    pass , def create_pr(
    self,
    title: str,
    body: str,
    target_branch: str,
    source_branch: str,
    fork_username: Optional[str] = None,
) -> PullRequest:
    pass, def set_commit_status(
    self,
    commit: str,
    state: Union[CommitStatus, str],
    target_url: str,
    description: str,
    context: str,
    trim: bool = False,
):
    pass

@indirect(GithubCommitFlag.get)
def get_commit_statuses(self, commit: str) -> list[CommitFlag]:
    pass

@indirect(GithubCheckRun.get)
def get_check_run(
    self,
    check_run_id: Optional[int] = None,
    commit_sha: Optional[str] = None,
) -> Optional["GithubCheckRun"]:
    pass

@indirect(GithubCheckRun.create)
def create_check_run(
    self,
    name: str,
    commit_sha: str,
    url: Optional[str] = None,
    external_id: Optional[str] = None,
    status: GithubCheckRunStatus = GithubCheckRunStatus.queued,
    started_at: Optional[datetime.datetime] = None,
    conclusion: Optional[GithubCheckRunResult] = None,
    completed_at: Optional[datetime.datetime] = None,
    output: Optional[GithubCheckRunOutput] = None,
    actions: Optional[list[dict[str, str]]] = None,
) -> "GithubCheckRun":
    pass

@indirect(GithubCheckRun.get_list)
def get_check_runs(
    self,
    commit_sha: str,
    name: Optional[str] = None,
    status: Optional[GithubCheckRunStatus] = None,
) -> list["GithubCheckRun"]:
    pass

, these are some of the examples of unimplemented functions missing return statements , they are mostly in the following files : ogr/services/github/project.py and ogr/services/gitlab/project.py

@lbarcziova
Copy link
Member

and where do you see these causing errors? From what you posted I would say the methods are implemented, just not directly, but using the @indirect decorator, with methods on the particular objects.

@pranav33317
Copy link

All of them have empty bodies and require a return statement so they are returning error :

Image Image

@pranav33317
Copy link

Hi , I'm sorry I commented on the wrong issue . This is related to #696 , I will repost it there.
I'm working on this issue parallely as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/github Related to GitHub implementation. area/gitlab Related to GitLab implementation. good-first-issue Good for newcomers. Hacktoberfest Participate in https://hacktoberfest.digitalocean.com kind/feature New feature or a request for enhancement. kind/technical-debt The code needs love. Refactoring. pagure Related to Pagure implementation.
Projects
Status: backlog
Development

No branches or pull requests

5 participants