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

Support multiple bots #48

Open
tanhongit opened this issue Jan 17, 2024 · 0 comments
Open

Support multiple bots #48

tanhongit opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request feature request

Comments

@tanhongit
Copy link
Member

tanhongit commented Jan 17, 2024

Supports multiple bots and allows separate customization for each bot.

  • multi json files(in folder bots)

  • bot info: name, username, token, event data. file name: timestamp_username.json

  • response example:

{
    "data": [
        {
            "name": "bot_1", 
            "username": "username_1", 
            "token": "xxxxxxxxxxxxxxxx", 
            "event_data": {
                "gitlab": {
                    "push": true,
                    "tag_push": true,
                    "issue": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false
                    },
                    "note": {
                      "issue": true,
                      "merge_request": true,
                      "commit": false,
                      "snippet": false
                    },
                    "merge_request": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false,
                      "approval": true,
                      "unapproval": false,
                      "approved": true,
                      "unapproved": false,
                      "merge": true
                    },
                    "wiki_page": {
                      "create": true,
                      "edit": false,
                      "delete": false
                    },
                    "feature_flag": false,
                    "release": {
                      "create": true,
                      "update": false
                    }
                },
                "github": {
                    "branch_protection_rule": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "check_run": {
                      "created": false,
                      "rerequested": false,
                      "completed": true
                    },
                    "check_suite": {
                      "completed": true,
                      "requested": false,
                      "rerequested": false
                    },
                    "code_scanning_alert": {
                      "created": false,
                      "fixed": false,
                      "reopened": false,
                      "closed_by_user": false,
                      "appeared_in_branch": false
                    },
                    "create": false,
                    "deploy_key": {
                      "created": true,
                      "deleted": false
                    },
                    "fork": true,
                    "gollum": true,
                    "issue_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "issue": {
                      "closed": true,
                      "opened": true,
                      "reopened": true,
                      "edited": false,
                      "assigned": true,
                      "unassigned": false,
                      "labeled": false,
                      "unlabeled": false,
                      "milestoned": false,
                      "demilestoned": false,
                      "locked": false,
                      "unlocked": false,
                      "transferred": false,
                      "pinned": false,
                      "unpinned": false,
                      "deleted": true
                    },
                    "member": {
                      "added": true,
                      "edited": false,
                      "removed": false
                    },
                    "package": {
                      "published": true,
                      "updated": false
                    },
                    "ping": true,
                    "project": {
                      "created": true,
                      "closed": true,
                      "reopened": false,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request": {
                      "closed": true,
                      "opened": true,
                      "reopened": false,
                      "review_request_removed": false,
                      "review_requested": true,
                      "synchronize": false,
                      "unlabeled": false,
                      "labeled": false,
                      "edited": false,
                      "assigned": false,
                      "unassigned": false
                    },
                    "pull_request_review_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request_review": {
                      "submitted": true,
                      "edited": false,
                      "dismissed": false
                    },
                    "pull_request_review_thread": {
                      "resolved": false,
                      "unresolved": false
                    },
                    "push": true,
                    "release": {
                      "published": true,
                      "unpublished": false,
                      "created": false,
                      "edited": false,
                      "deleted": false,
                      "prereleased": false,
                      "released": true
                    },
                    "secret_scanning_alert": {
                      "created": true,
                      "reopened": false,
                      "resolved": false,
                      "revoked": false
                    },
                    "star": {
                      "created": true,
                      "deleted": false
                    },
                    "watch": {
                      "started": true
                    },
                    "workflow_job": {
                      "queued": false,
                      "in_progress": false,
                      "completed": false,
                      "waiting": false
                    },
                    "workflow_run": {
                      "requested": false,
                      "in_progress": true,
                      "completed": true
                    }
                }
            }
        },
        {
            "name": "bot_1", 
            "username": "username_2", 
            "token": "xxxxxxxxxxxxxxxx", 
            "event_data": {
                "gitlab": {
                    "push": true,
                    "tag_push": true,
                    "issue": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false
                    },
                    "note": {
                      "issue": true,
                      "merge_request": true,
                      "commit": false,
                      "snippet": false
                    },
                    "merge_request": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false,
                      "approval": true,
                      "unapproval": false,
                      "approved": true,
                      "unapproved": false,
                      "merge": true
                    },
                    "wiki_page": {
                      "create": true,
                      "edit": false,
                      "delete": false
                    },
                    "feature_flag": false,
                    "release": {
                      "create": true,
                      "update": false
                    }
                },
                "github": {
                    "branch_protection_rule": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "check_run": {
                      "created": false,
                      "rerequested": false,
                      "completed": true
                    },
                    "check_suite": {
                      "completed": true,
                      "requested": false,
                      "rerequested": false
                    },
                    "code_scanning_alert": {
                      "created": false,
                      "fixed": false,
                      "reopened": false,
                      "closed_by_user": false,
                      "appeared_in_branch": false
                    },
                    "create": false,
                    "deploy_key": {
                      "created": true,
                      "deleted": false
                    },
                    "fork": true,
                    "gollum": true,
                    "issue_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "issue": {
                      "closed": true,
                      "opened": true,
                      "reopened": true,
                      "edited": false,
                      "assigned": true,
                      "unassigned": false,
                      "labeled": false,
                      "unlabeled": false,
                      "milestoned": false,
                      "demilestoned": false,
                      "locked": false,
                      "unlocked": false,
                      "transferred": false,
                      "pinned": false,
                      "unpinned": false,
                      "deleted": true
                    },
                    "member": {
                      "added": true,
                      "edited": false,
                      "removed": false
                    },
                    "package": {
                      "published": true,
                      "updated": false
                    },
                    "ping": true,
                    "project": {
                      "created": true,
                      "closed": true,
                      "reopened": false,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request": {
                      "closed": true,
                      "opened": true,
                      "reopened": false,
                      "review_request_removed": false,
                      "review_requested": true,
                      "synchronize": false,
                      "unlabeled": false,
                      "labeled": false,
                      "edited": false,
                      "assigned": false,
                      "unassigned": false
                    },
                    "pull_request_review_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request_review": {
                      "submitted": true,
                      "edited": false,
                      "dismissed": false
                    },
                    "pull_request_review_thread": {
                      "resolved": false,
                      "unresolved": false
                    },
                    "push": true,
                    "release": {
                      "published": true,
                      "unpublished": false,
                      "created": false,
                      "edited": false,
                      "deleted": false,
                      "prereleased": false,
                      "released": true
                    },
                    "secret_scanning_alert": {
                      "created": true,
                      "reopened": false,
                      "resolved": false,
                      "revoked": false
                    },
                    "star": {
                      "created": true,
                      "deleted": false
                    },
                    "watch": {
                      "started": true
                    },
                    "workflow_job": {
                      "queued": false,
                      "in_progress": false,
                      "completed": false,
                      "waiting": false
                    },
                    "workflow_run": {
                      "requested": false,
                      "in_progress": true,
                      "completed": true
                    }
                }
            }
        },
        {
            "name": "bot_2", 
            "username": "username_3", 
            "token": "xxxxxxxxxxxxxxxx", 
            "event_data": {
                "gitlab": {
                    "push": true,
                    "tag_push": true,
                    "issue": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false
                    },
                    "note": {
                      "issue": true,
                      "merge_request": true,
                      "commit": false,
                      "snippet": false
                    },
                    "merge_request": {
                      "open": true,
                      "close": true,
                      "reopen": false,
                      "update": false,
                      "approval": true,
                      "unapproval": false,
                      "approved": true,
                      "unapproved": false,
                      "merge": true
                    },
                    "wiki_page": {
                      "create": true,
                      "edit": false,
                      "delete": false
                    },
                    "feature_flag": false,
                    "release": {
                      "create": true,
                      "update": false
                    }
                },
                "github": {
                    "branch_protection_rule": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "check_run": {
                      "created": false,
                      "rerequested": false,
                      "completed": true
                    },
                    "check_suite": {
                      "completed": true,
                      "requested": false,
                      "rerequested": false
                    },
                    "code_scanning_alert": {
                      "created": false,
                      "fixed": false,
                      "reopened": false,
                      "closed_by_user": false,
                      "appeared_in_branch": false
                    },
                    "create": false,
                    "deploy_key": {
                      "created": true,
                      "deleted": false
                    },
                    "fork": true,
                    "gollum": true,
                    "issue_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "issue": {
                      "closed": true,
                      "opened": true,
                      "reopened": true,
                      "edited": false,
                      "assigned": true,
                      "unassigned": false,
                      "labeled": false,
                      "unlabeled": false,
                      "milestoned": false,
                      "demilestoned": false,
                      "locked": false,
                      "unlocked": false,
                      "transferred": false,
                      "pinned": false,
                      "unpinned": false,
                      "deleted": true
                    },
                    "member": {
                      "added": true,
                      "edited": false,
                      "removed": false
                    },
                    "package": {
                      "published": true,
                      "updated": false
                    },
                    "ping": true,
                    "project": {
                      "created": true,
                      "closed": true,
                      "reopened": false,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request": {
                      "closed": true,
                      "opened": true,
                      "reopened": false,
                      "review_request_removed": false,
                      "review_requested": true,
                      "synchronize": false,
                      "unlabeled": false,
                      "labeled": false,
                      "edited": false,
                      "assigned": false,
                      "unassigned": false
                    },
                    "pull_request_review_comment": {
                      "created": true,
                      "edited": false,
                      "deleted": false
                    },
                    "pull_request_review": {
                      "submitted": true,
                      "edited": false,
                      "dismissed": false
                    },
                    "pull_request_review_thread": {
                      "resolved": false,
                      "unresolved": false
                    },
                    "push": true,
                    "release": {
                      "published": true,
                      "unpublished": false,
                      "created": false,
                      "edited": false,
                      "deleted": false,
                      "prereleased": false,
                      "released": true
                    },
                    "secret_scanning_alert": {
                      "created": true,
                      "reopened": false,
                      "resolved": false,
                      "revoked": false
                    },
                    "star": {
                      "created": true,
                      "deleted": false
                    },
                    "watch": {
                      "started": true
                    },
                    "workflow_job": {
                      "queued": false,
                      "in_progress": false,
                      "completed": false,
                      "waiting": false
                    },
                    "workflow_run": {
                      "requested": false,
                      "in_progress": true,
                      "completed": true
                    }
                }
            }
        }
    ],
    "pagination_info": {
        "per_page": 10,
        "current_page": 1,
        "total": 1000
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
Status: Todo
Development

No branches or pull requests

2 participants