ubiquibot / plugins-wishlist

0 stars 1 forks source link

Generalized "GitHub Webhook + Contributor Role -> Rewards" Plugin #22

Open 0x4007 opened 1 week ago

0x4007 commented 1 week ago

Dynamically map the config property name to count the amount of matching webhook events that occur in the issue/pull timeline, and credit accordingly. In which case, this plugin seems generally useful for mapping any value to any event, in the context of an issue or pull!

Heres a small example of a single (issue or pull) handler plugin config schema, which seems neat:

pull_request: 
    assigned: 
      targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
      value: 0

Below is handling both


pull_request: 
    assigned: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    auto_merge_disabled: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    auto_merge_enabled: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    closed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    converted_to_draft: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    demilestoned: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    dequeued: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    edited: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    enqueued: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    labeled: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    locked: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    milestoned: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    opened: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    ready_for_review: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    reopened: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    review_request_removed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    review_requested: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    synchronize: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    unassigned: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    unlabeled: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    unlocked: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

pull_request_review: 
    dismissed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    edited: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    submitted: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

pull_request_review_comment: 
    created: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    deleted: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    edited: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

pull_request_review_thread: 
    resolved: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    unresolved: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

push: 
    pull: 
      targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
      value: 0
    issue: 
      targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
      value: 0

commit_comment: 
    created: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

issue_comment: 
    created: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    deleted: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    edited: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

workflow_run: 
    completed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    in_progress: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    requested: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

workflow_dispatch: 
    pull: 
      targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
      value: 0
    issue: 
      targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
      value: 0

check_run: 
    completed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    created: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    requested_action: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    rerequested: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0

check_suite: 
    completed: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    requested: 
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
    rerequested:
        pull: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
        issue: 
          targets: [ ISSUER, ASSIGNEE, COLLABORATOR, CONTRIBUTOR ]
          value: 0
0x4007 commented 1 week ago

I would actually consider marking this as two weeks, because there are a ton of tests to cover here.