mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-06 07:38:48 +00:00
* Initial work. * Periodic push. * Fmt and start adding args to approve_policies cmd. * keep funcs for now. * Periodic push. * Periodic push. * fmt. * Move approve policies logic to project_command_runner. * update some tests * More test fixes. * update more tests. fix som logic. * more tests. add additional info to common data for custom templates. * fix apply with policies bug. update more tests/fmt * file perms * fix error parsing for conftest results. * Update more tests and linting. * update documentation. * Address no-fail case. Address comments. * Forgot changes. * fix markdown renderer * Fix policy fail logic. remove uneeded tmpl var * targeted policy approvals fix * Address PR comments. * empty commit to trigger build --------- Co-authored-by: PePe Amengual <jose.amengual@gmail.com> Co-authored-by: rkstrickland <ross.strickland@instacart.com> Co-authored-by: Dylan Page <dylan.page@autodesk.com>
44 lines
1.2 KiB
Go
44 lines
1.2 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://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/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
|
|
|
|
// PolicySet is the policy set to target (if specified) for the approve_policies command.
|
|
PolicySet string
|
|
|
|
Trigger Trigger
|
|
}
|