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

Check collaborator status for users #114

Closed
gentlementlegen opened this issue Dec 28, 2024 · 10 comments · Fixed by #116
Closed

Check collaborator status for users #114

gentlementlegen opened this issue Dec 28, 2024 · 10 comments · Fixed by #116

Comments

@gentlementlegen
Copy link
Member

          ![image](https://github.com/user-attachments/assets/3b7feaa1-ada6-4a6f-975d-554825644aa9)

@gentlementlegen he's a collaborator this error should not have been thrown

Originally posted by @0x4007 in ubiquity/business-development#106 (comment)

What happened

The user was recognized as member instead of collaborator, thus not being able to start the task.

What was expected

The user should have been recognized as collaborator and start the task.

Copy link

Note

The following contributors may be suitable for this task:

gentlementlegen

76% Match ubiquity-os-marketplace/text-conversation-rewards#214

Copy link

@gentlementlegen the deadline is at Sat, Dec 28, 11:31 AM UTC

Copy link

Important

  • Be sure to link a pull-request before the first reminder to avoid disqualification.
  • Reminders will be sent every 7 days if there is no activity.
  • Assignees will be disqualified after 14 days of inactivity.

@gentlementlegen
Copy link
Member Author

gentlementlegen commented Dec 29, 2024

@0x4007 So what happens here is that before we only checked for organization memberships. In the repo, the user only has outside collaborator access on this specific repo.

I added the retrieval of the role for the user in the repo, but it looks different from the organization one, and looks like the following:

{                                                                                                                                              
             "user": "ubiquity-ubiquibot",                                                                                                                
             "owner": "Meniole",                                                                                                                          
             "repo": "command-start-stop",
             "data": {
               "permission": "write",
               "user": {
                 "login": "ubiquity-ubiquibot",
                 ...
                 "type": "User",
                 "user_view_type": "public",
                 "site_admin": false,
                 "permissions": {
                   "admin": false,
                   "maintain": false,
                   "push": true,
                   "triage": true,
                   "pull": true
                 },
                 "role_name": "write"
               },
               "role_name": "write"
             }
}

The role_name: write corresponds to the role in the given repo, as seen in your screenshot. I think the best option is to add these in the roles. Possible options are: admin, write, read, none.

@0x4007
Copy link
Member

0x4007 commented Jan 2, 2025

I think any of the options technically means they are added as a "core team member." Possibly exclude none if that means they weren't added as a collaborator.

I'm assuming you are missing triage and maintain from your enum:

image

@gentlementlegen
Copy link
Member Author

@0x4007 technically these roles can be infinite because you can add custom ones, but sure I can add them.

@0x4007
Copy link
Member

0x4007 commented Jan 2, 2025

So then you should consider any value as a "core team member" but none is unclear to me what exactly that represents.

@gentlementlegen
Copy link
Member Author

read is for external contributors as well (it is the default role).

Quoting the docs

Get repository permissions for a user
Checks the repository permission of a collaborator. The possible repository permissions are admin, write, read, and none.

Note: The permission attribute provides the legacy base roles of admin, write, read, and none, where the maintain role is mapped to write and the triage role is mapped to read. To determine the role assigned to the collaborator, see the role_name attribute, which will provide the full role name, including custom roles. The permissions hash can also be used to determine which base level of access the collaborator has to the repository.

Copy link

+ Evaluating results. Please wait...

Copy link

 [ 158.92 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
IssueTask1100
IssueSpecification158.92
Conversation Incentives
CommentFormattingRelevancePriorityReward
![image](https://github.com/user-attachments/assets/3b7feaa1-ada…
14.73
content:
  content:
    p:
      score: 0
      elementCount: 5
    img:
      score: 5
      elementCount: 1
    em:
      score: 0
      elementCount: 1
    h2:
      score: 1
      elementCount: 2
    a:
      score: 5
      elementCount: 1
  result: 12
regex:
  wordCount: 49
  wordValue: 0.1
  result: 2.73
1458.92

 [ 27.816 WXDAI ] 

@0x4007
Contributions Overview
ViewContributionCountReward
IssueComment227.16
ReviewComment20.656
Conversation Incentives
CommentFormattingRelevancePriorityReward
I think any of the options technically means they are added as a…
7.49
content:
  content:
    p:
      score: 0
      elementCount: 3
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 44
  wordValue: 0.1
  result: 2.49
0.8423.968
So then you should consider any value as a "core team member" bu…
1.33
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 21
  wordValue: 0.1
  result: 1.33
0.643.192
@gentlementlegen will you be able to prioritize this?
0.59
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 8
  wordValue: 0.1
  result: 0.59
0.240.472
That sounds like a good plan.
0.46
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.140.184

 [ 4.9 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
ReviewComment14.9
Conversation Incentives
CommentFormattingRelevancePriorityReward
I'm fine with the changes, my only concern is that we will have …
1.75
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 29
  wordValue: 0.1
  result: 1.75
0.744.9

@rndquu rndquu removed this from Development Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants