mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-30 10:28:48 +00:00
* Moved CommandContext and CommandResult to models (#193) * Moved CommandContext and CommandResult to models * move from models to command rename CommandContext -> Context rename CommandResult -> Result * moved command related helpers into command package * move ProjectCommandContext and ProjectResult to command/project package * move project command context and project result * revert unrelated code * move tests * fix left over * fix linting * fix tests * remove unused import * fix project context dependencies * fix depenedecies * fix typo
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package command
|
|
|
|
import (
|
|
"github.com/runatlantis/atlantis/server/events/models"
|
|
"github.com/runatlantis/atlantis/server/logging"
|
|
"github.com/uber-go/tally"
|
|
)
|
|
|
|
// Trigger represents the how the command was triggered
|
|
type Trigger int
|
|
|
|
const (
|
|
// Commands that are automatically triggered (ie. automatic plans)
|
|
AutoTrigger Trigger = iota
|
|
|
|
// Commands that are triggered by comments (ie. atlantis plan)
|
|
CommentTrigger
|
|
)
|
|
|
|
// Context represents the context of a command that should be executed
|
|
// for a pull request.
|
|
type Context struct {
|
|
// HeadRepo is the repository that is getting merged into the BaseRepo.
|
|
// If the pull request branch is from the same repository then HeadRepo will
|
|
// be the same as BaseRepo.
|
|
// See https://help.github.com/articles/about-pull-request-merges/.
|
|
HeadRepo models.Repo
|
|
Pull models.PullRequest
|
|
Scope tally.Scope
|
|
// User is the user that triggered this command.
|
|
User models.User
|
|
Log logging.SimpleLogging
|
|
|
|
// Current PR state
|
|
PullRequestStatus models.PullReqStatus
|
|
|
|
PullStatus *models.PullStatus
|
|
|
|
Trigger Trigger
|
|
}
|