Skip to content

More flexible webhook and git host support #133

@bobheadxi

Description

@bobheadxi

🚳 Remove dependency on go-github and implement a custom approach to webhook receiving that can hopefully accommodate different webhooks, ie GitLab.

⚒ Update functions like GetSSHRemote to accommodate different hosts (right now it assumes the remote URL is a GitHub one)

🚧 Probably a few other changes to make as well related to GitHub assumptions

Implementation Ideas 🏋️

for webhooks, a constructor that can take a request body and attempt to parse it into different structs (one for each supported API). If it errors, attempt to parse into another. Return an interface:

// webhookPayload represents a generic webhook payload
type webhookPayload interface {
        // GetBody returns the struct representing the hook request
	GetBody()
        // GetBranchName returns the webhook branch name
	GetBranchName()
        // GetRefHead returns the webhook ref head
	GetRefHead()
        // ... etc etc etc
}

Implement this interface for GitHub, GitLab, whatever

Metadata

Metadata

Assignees

No one assigned

    Labels

    :cmdcommand line and clientside functionality:daemondaemon and serverside functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions