Documentation ¶
Index ¶
- Constants
- func ActivateBuildsForProject(project model.ProjectRef) error
- func AddBuildBreakSubscriptions(v *model.Version, projectRef *model.ProjectRef) error
- func CheckGithubAPIResources(ctx context.Context, githubToken string) bool
- func CollectRevisionsForProject(ctx context.Context, conf *evergreen.Settings, project model.ProjectRef) error
- func CreateManifest(v model.Version, proj *model.Project, branch string, ...) (*manifest.Manifest, error)
- func CreateVersionFromConfig(ctx context.Context, ref *model.ProjectRef, config *model.Project, ...) (*model.Version, error)
- func NewMockRepoPoller(mockProject *model.Project, mockRevisions []model.Revision) *mockRepoPoller
- type GithubRepositoryPoller
- func (gRepoPoller *GithubRepositoryPoller) GetChangedFiles(ctx context.Context, commitRevision string) ([]string, error)
- func (gRepoPoller *GithubRepositoryPoller) GetRecentRevisions(maxRevisions int) ([]model.Revision, error)
- func (gRepoPoller *GithubRepositoryPoller) GetRemoteConfig(ctx context.Context, projectFileRevision string) (projectConfig *model.Project, err error)
- func (gRepoPoller *GithubRepositoryPoller) GetRevisionsSince(revision string, maxRevisionsToSearch int) ([]model.Revision, error)
- type RepoPoller
- type RepoTracker
- type VersionErrors
- type VersionMetadata
Constants ¶
const ( // determines the default maximum number of revisions to fetch for a newly tracked repo // if not specified in configuration file DefaultNumNewRepoRevisionsToFetch = 200 DefaultMaxRepoRevisionsToSearch = 50 DefaultNumConcurrentRequests = 10 )
const (
// the repotracker polls version control (github) for new commits
RunnerName = "repotracker"
)
Variables ¶
This section is empty.
Functions ¶
func ActivateBuildsForProject ¶
func ActivateBuildsForProject(project model.ProjectRef) error
func AddBuildBreakSubscriptions ¶
func AddBuildBreakSubscriptions(v *model.Version, projectRef *model.ProjectRef) error
AddBuildBreakSubscriptions will subscribe admins of a project to a version if no one else would receive a build break notification
func CheckGithubAPIResources ¶
CheckGithubAPIResources returns true when the github API is ready, accessible and with sufficient quota to satisfy our needs
func CreateManifest ¶
func CreateVersionFromConfig ¶
func CreateVersionFromConfig(ctx context.Context, ref *model.ProjectRef, config *model.Project, metadata VersionMetadata, ignore bool, versionErrs *VersionErrors) (*model.Version, error)
Types ¶
type GithubRepositoryPoller ¶
type GithubRepositoryPoller struct { ProjectRef *model.ProjectRef OauthToken string }
GithubRepositoryPoller is a struct that implements Github specific behavior required of a RepoPoller
func NewGithubRepositoryPoller ¶
func NewGithubRepositoryPoller(projectRef *model.ProjectRef, oauthToken string) *GithubRepositoryPoller
NewGithubRepositoryPoller constructs and returns a pointer to a GithubRepositoryPoller struct
func (*GithubRepositoryPoller) GetChangedFiles ¶
func (gRepoPoller *GithubRepositoryPoller) GetChangedFiles(ctx context.Context, commitRevision string) ([]string, error)
GetRemoteConfig fetches the contents of a remote github repository's configuration data as at a given revision
func (*GithubRepositoryPoller) GetRecentRevisions ¶
func (gRepoPoller *GithubRepositoryPoller) GetRecentRevisions(maxRevisions int) ([]model.Revision, error)
GetRecentRevisions fetches the most recent 'numRevisions'
func (*GithubRepositoryPoller) GetRemoteConfig ¶
func (gRepoPoller *GithubRepositoryPoller) GetRemoteConfig(ctx context.Context, projectFileRevision string) (projectConfig *model.Project, err error)
GetRemoteConfig fetches the contents of a remote github repository's configuration data as at a given revision
func (*GithubRepositoryPoller) GetRevisionsSince ¶
func (gRepoPoller *GithubRepositoryPoller) GetRevisionsSince(revision string, maxRevisionsToSearch int) ([]model.Revision, error)
GetRevisionsSince fetches the all commits from the corresponding Github ProjectRef that were made after 'revision'
type RepoPoller ¶
type RepoPoller interface { // Fetches the contents of a remote repository's configuration data as at // the given revision. GetRemoteConfig(ctx context.Context, revision string) (*model.Project, error) // Fetches a list of all filepaths modified by a given revision. GetChangedFiles(ctx context.Context, revision string) ([]string, error) // Fetches all changes since the 'revision' specified - with the most recent // revision appearing as the first element in the slice. // // 'maxRevisionsToSearch' determines the maximum number of revisions we // allow to search through - in order to find 'revision' - before we give // up. A value <= 0 implies we allow to search through till we hit the first // revision for the project. GetRevisionsSince(sinceRevision string, maxRevisions int) ([]model.Revision, error) // Fetches the most recent 'numNewRepoRevisionsToFetch' revisions for a // project - with the most recent revision appearing as the first element in // the slice. GetRecentRevisions(numNewRepoRevisionsToFetch int) ([]model.Revision, error) }
The RepoPoller interface specifies behavior required of all repository poller implementations
type RepoTracker ¶
type RepoTracker struct { *evergreen.Settings *model.ProjectRef RepoPoller }
RepoTracker is used to manage polling repository changes and storing such changes. It contains a number of interfaces that specify behavior required by client implementations
func (*RepoTracker) FetchRevisions ¶
func (repoTracker *RepoTracker) FetchRevisions(ctx context.Context) error
The FetchRevisions method is used by a RepoTracker to run the pipeline for tracking repositories. It performs everything from polling the repository to persisting any changes retrieved from the repository reference.
func (*RepoTracker) GetProjectConfig ¶
func (repoTracker *RepoTracker) GetProjectConfig(ctx context.Context, revision string) (*model.Project, error)
GetProjectConfig fetches the project configuration for a given repository returning a remote config if the project references a remote repository configuration file - via the Identifier. Otherwise it defaults to the local project file. An erroneous project file may be returned along with an error.
func (*RepoTracker) StoreRevisions ¶
func (repoTracker *RepoTracker) StoreRevisions(ctx context.Context, revisions []model.Revision) error
Constructs all versions stored from recent repository revisions The additional complexity is due to support for project modifications on patch builds. We need to parse the remote config as it existed when each revision was created. The return value is the most recent version created as a result of storing the revisions. This function is idempotent with regard to storing the same version multiple times.
type VersionErrors ¶
type VersionMetadata ¶
type VersionMetadata struct { Revision model.Revision TriggerID string TriggerType string EventID string TriggerDefinitionID string SourceVersion *model.Version IsAdHoc bool User *user.DBUser Message string Alias string PeriodicBuildID string }
VersionMetadata is used to pass information about upstream versions to downstream version creation