Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: add docstring and catch default case (#1937)

Joe Chen62fc1f59fb25
diff --git a/plugin/vcs/github/github.go b/plugin/vcs/github/github.go
index d40158da2a..c1bd34eb70 100644
--- a/plugin/vcs/github/github.go
+++ b/plugin/vcs/github/github.go
@@ -131,6 +131,10 @@ type WebhookConfig struct {
// WebhookCreateOrUpdate represents a GitHub API request for creating or
// updating a webhook.
+//
+// NOTE: GitHub uses different API payloads for creating and updating webhooks
+// (the latter has more options), but we are not using any differentiated parts
+// so it makes sense to have a combined struct until we needed.
type WebhookCreateOrUpdate struct {
// Config contains settings for the webhook.
Config WebhookConfig `json:"config"`
diff --git a/server/project_member.go b/server/project_member.go
index 73cc1ef6f7..f75264fad9 100644
--- a/server/project_member.go
+++ b/server/project_member.go
@@ -120,6 +120,8 @@ func (s *Server) registerProjectMemberRoutes(g *echo.Group) {
roleProvider = api.ProjectRoleProviderGitLabSelfHost
case vcsPlugin.GitHubCom:
roleProvider = api.ProjectRoleProviderGitHubCom
+ default:
+ return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Unrecognized VCS type %q", vcs.Type))
}
batchUpdateProjectMember := &api.ProjectMemberBatchUpdate{