Documentation
¶
Index ¶
- func IssueCommentEventFromJSON(data io.Reader) (*github.IssueCommentEvent, error)
- func NewBool(b bool) *bool
- func NewInt(n int) *int
- func NewInt32(n int32) *int32
- func NewInt64(n int64) *int64
- func NewString(s string) *string
- func PingEventFromJSON(data io.Reader) (*github.PingEvent, error)
- func PullRequestEventFromJSON(data io.Reader) (*github.PullRequestEvent, error)
- func PushEventFromJSON(data io.Reader) (*github.PushEvent, error)
- func ValidateSignature(receivedHash []string, bodyBuffer []byte, secretKey string) error
- type Builds
- type CWS
- type CloudAuth
- type Deployment
- type E2EInstance
- type MatterwickConfig
- type MockedBuilds
- type Server
- func (s *Server) CheckLimitRateAndAbortRequest() bool
- func (s *Server) CheckLimitRateAndSleep()
- func (s *Server) GetPullRequestFromGithub(pullRequest *github.PullRequest) (*model.PullRequest, error)
- func (s *Server) GetUpdateChecks(owner, repoName string, prNumber int) (*model.PullRequest, error)
- func (s *Server) Start()
- func (s *Server) Stop()
- type WebhookRequest
- type WorkflowRunWebhookPayload
- type WorkflowRunWithInputs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IssueCommentEventFromJSON ¶
func IssueCommentEventFromJSON(data io.Reader) (*github.IssueCommentEvent, error)
IssueCommentEventFromJSON parses json to a github.IssueCommentEvent
func PingEventFromJSON ¶
PingEventFromJSON parses json to a github.PingEvent
func PullRequestEventFromJSON ¶
func PullRequestEventFromJSON(data io.Reader) (*github.PullRequestEvent, error)
PullRequestEventFromJSON parses json to a github.PullRequestEvent
func PushEventFromJSON ¶ added in v0.4.5
PushEventFromJSON parses json to a github.PushEvent
Types ¶
type Builds ¶
type Builds struct{}
Builds implements buildsInterface for working with external CI/CD systems.
type CWS ¶
type CWS struct {
Database string
CWSSiteURL string
CWSSMTPUsername string
CWSSMTPPassword string
CWSSMTPServer string
CWSSMTPPort string
CWSSMTPServerTimeout string
CWSSMTPConnectionSecurity string
CWSEmailReplyToName string
CWSEmailReplyToAddress string
CWSEmailBCCAddress string
CWSCloudURL string
CWSStripeKey string
CWSCloudDNSDomain string
CWSCloudGroupID string
CWSBlapiURL string
CWSBlapiToken string
CWSLicenseGeneratorURL string
CWSLicenseGeneratorKey string
CWSDisableRenewalChecks string
CWSSplitKey string
CWSSplitServerID string
CloudDefaultProductID string
CloudDefaultTrialProductID string
DockerHubCredentials string
CWSPublicPort string
CWSPrivatePort string
}
CWS contains all configuration for the Customer Web Server
type Deployment ¶
type Deployment struct {
Namespace string
PR int
ImageTag string
DeployFilePath string
Environment CWS
}
Deployment contains information needed to create a deployment in Kubernetes
type E2EInstance ¶ added in v0.4.5
type E2EInstance struct {
Name string `json:"name"`
Platform string `json:"platform"` // Desktop: linux/macos/windows (OS runner), Mobile: site-1/site-2/site-3 (instance ID)
Runner string `json:"runner"` // For desktop only: GitHub Actions runner label
URL string `json:"url"`
InstallationID string `json:"installation_id"`
ServerVersion string `json:"server_version"`
}
E2EInstance represents a single E2E test server instance Note: Platform field has different meanings for desktop vs mobile:
- Desktop: Platform = OS runner (linux/macos/windows) where tests execute
- Mobile: Platform = instance identifier (site-1/site-2/site-3) for the test server
type MatterwickConfig ¶
type MatterwickConfig struct {
ListenAddress string
MatterWickURL string
GithubAccessToken string
GitHubTokenReserve int
GithubUsername string
GitHubWebhookSecret string
Org string
Username string
SetupSpinWick string
SetupSpinWickHA string
SetupSpinWickWithCWS string
SpinWickHALicense string
ProvisionerServer string
AWSAPIKey string
DNSNameTestServer string
CloudGroupID string
SetupSpinmintMessage string
SetupSpinmintFailedMessage string
DestroyedSpinmintMessage string
DockerRegistryURL string
DockerUsername string
DockerPassword string
MattermostWebhookURL string
MattermostCredentialsWebhookURL string
MattermostCredentialsChannelURL string
KubeClusterName string
KubeClusterRegion string
LogSettings struct {
EnableDebug bool
ConsoleJSON bool
}
CWSPublicAPIAddress string
CWSInternalAPIAddress string
CWSAPIKey string
CWSUserPassword string
CWSSpinwickGroupID string
CWS CWS
CloudAuth CloudAuth
// PluginRepoToIDMapping maps repository names to plugin IDs for mmctl commands
// Key: repository name (e.g., "mattermost-plugin-boards")
// Value: plugin ID to use for mmctl enable command
PluginRepoToIDMapping map[string]string
E2ELabel string
E2EMobileIOSLabel string
E2EMobileAndroidLabel string
E2EUsername string
E2EPassword string
E2EServerVersion string
E2EAutoTriggerOnRelease bool
E2EAutoTriggerOnMaster bool
E2EReleasePatternPrefix string
E2ENightlyTriggerWorkflowName string // workflow name (name: field) of the nightly trigger workflow
E2ETestWorkflowNames []string // workflow names of the actual test workflows (for completion-based cleanup)
}
MatterwickConfig defines all config for to run the server
func GetConfig ¶
func GetConfig(fileName string) (*MatterwickConfig, error)
GetConfig gets the config
type MockedBuilds ¶
type MockedBuilds struct {
Version string
}
MockedBuilds implements buildsInterface but returns hardcoded information. This is used for local development and/or testing.
type Server ¶
type Server struct {
Config *MatterwickConfig
Router *mux.Router
Builds buildsInterface
StartTime time.Time
Logger logrus.FieldLogger
CloudClient *cloudModel.Client
// contains filtered or unexported fields
}
Server is the MatterWick server.
func New ¶
func New(config *MatterwickConfig) *Server
New returns a new server with the desired configuration
func (*Server) CheckLimitRateAndAbortRequest ¶
CheckLimitRateAndAbortRequest checks the api rate and abort the request if needed
func (*Server) CheckLimitRateAndSleep ¶
func (s *Server) CheckLimitRateAndSleep()
CheckLimitRateAndSleep checks the api rate and sleep if needed
func (*Server) GetPullRequestFromGithub ¶
func (s *Server) GetPullRequestFromGithub(pullRequest *github.PullRequest) (*model.PullRequest, error)
GetPullRequestFromGithub get updated pr info
func (*Server) GetUpdateChecks ¶
GetUpdateChecks retrieve updated status checks from GH
type WebhookRequest ¶
WebhookRequest defines the message to send to MM
type WorkflowRunWebhookPayload ¶ added in v0.4.5
type WorkflowRunWebhookPayload struct {
Action string `json:"action"`
WorkflowRun WorkflowRunWithInputs `json:"workflow_run"`
Repository map[string]interface{} `json:"repository"`
Workflow map[string]interface{} `json:"workflow"`
}
WorkflowRunWebhookPayload represents the workflow_run webhook payload with inputs
func ParseWorkflowRunEventWithInputs ¶ added in v0.4.5
func ParseWorkflowRunEventWithInputs(data io.Reader) (*WorkflowRunWebhookPayload, error)
ParseWorkflowRunEventWithInputs parses workflow_run event and extracts inputs
type WorkflowRunWithInputs ¶ added in v0.4.5
type WorkflowRunWithInputs struct {
ID int64 `json:"id"`
Name string `json:"name"`
HeadBranch string `json:"head_branch"`
HeadSHA string `json:"head_sha"`
Inputs map[string]string `json:"inputs"`
}
WorkflowRunWithInputs extends WorkflowRun with inputs field