Documentation
¶
Index ¶
- func Make() (*cobra.Command, error)
- func ValidateParams(params []string) func(cmd *cobra.Command, args []string) error
- type DiscoveryConfig
- type Filter
- func GetFilterForAuthors(authors []string) *Filter
- func GetFilterForCreatedTime(duration time.Duration) *Filter
- func GetFilterForDrafts(filterDrafts bool) *Filter
- func GetFilterForLabels(labels []string, and bool) *Filter
- func GetFilterForLabelsAnd(labels []string) *Filter
- func GetFilterForLabelsOr(labels []string) *Filter
- func GetFilterForMilestone(milestoneRaw string) *Filter
- func GetFilterForTitleRegex(pattern string) (*Filter, error)
- func GetFilterForUpdatedTime(duration time.Duration) *Filter
- type FlagData
- func (f FlagData) BuildCmd(buildTypeID, branch, testRegex, service string) (int, string, error)
- func (f FlagData) BuildResultsCmd(buildID int) error
- func (f FlagData) BuildResultsForPRCmd(pr int) error
- func (f FlagData) GetAndRunPrsTests(prs map[int]string, testRegExParam string) error
- func (f FlagData) GetFilters() ([]Filter, error)
- func (f FlagData) GetPrTests(number int, title string) (*map[string][]string, error)
- func (f FlagData) NewRepo() GithubRepo
- func (f FlagData) NewTCServer() tc.Server
- type FlagsGitHub
- type FlagsGitHubPrFilter
- type FlagsTeamCity
- type FlagsTeamCityBuild
- type GithubRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiscoveryConfig ¶ added in v0.9.0
type DiscoveryConfig struct {
FileRegEx *regexp.Regexp `mapstructure:"-"`
SplitTestsOn string `mapstructure:"splitteston"`
ReappendSplitCharacter bool `mapstructure:"reappend-split-character"`
AccTestFileSuffixRegexes []*regexp.Regexp `mapstructure:"-"`
Concurrency int `mapstructure:"concurrency"`
CollapseFilesAfter int `mapstructure:"collapse-files-after"`
}
func (DiscoveryConfig) AccTestFileSuffixRegexStrings ¶ added in v0.9.1
func (cfg DiscoveryConfig) AccTestFileSuffixRegexStrings() string
type Filter ¶ added in v0.6.0
type Filter struct {
Name string
PR func(github.PullRequest) (bool, error) // todo shjould this return an error?
}
func GetFilterForAuthors ¶ added in v0.6.0
func GetFilterForCreatedTime ¶ added in v0.6.0
func GetFilterForDrafts ¶ added in v0.9.0
func GetFilterForLabels ¶ added in v0.6.0
func GetFilterForLabelsAnd ¶ added in v0.6.0
func GetFilterForLabelsOr ¶ added in v0.6.0
func GetFilterForMilestone ¶ added in v0.6.0
func GetFilterForTitleRegex ¶ added in v0.6.0
func GetFilterForUpdatedTime ¶ added in v0.6.0
type FlagData ¶
type FlagData struct {
GH FlagsGitHub `mapstructure:",squash"`
TC FlagsTeamCity `mapstructure:",squash"`
DiscoveryConfig DiscoveryConfig `mapstructure:",squash"`
OpenInBrowser bool `mapstructure:"open"`
RunAllTests bool `mapstructure:"all"`
Services []string `mapstructure:"service"`
}
func GetFlags ¶ added in v0.6.0
func GetFlags() FlagData
GetFlags returns the fully populated FlagData. We must unmarshal from Viper instead of using globally bound pflags variables because pflags only parses command-line arguments. Viper merges environment variables (and config files) on top of the CLI flags. By unmarshaling from Viper, we ensure that environment variable overrides (e.g. TCTEST_GH_TOKEN) are properly applied.
func (FlagData) BuildResultsCmd ¶ added in v0.6.0
func (FlagData) BuildResultsForPRCmd ¶ added in v0.6.0
func (FlagData) GetAndRunPrsTests ¶ added in v0.6.0
func (FlagData) GetFilters ¶ added in v0.6.0
func (FlagData) GetPrTests ¶ added in v0.6.0
func (FlagData) NewRepo ¶ added in v0.6.0
func (f FlagData) NewRepo() GithubRepo
func (FlagData) NewTCServer ¶ added in v0.9.1
type FlagsGitHub ¶ added in v0.6.0
type FlagsGitHub struct {
Token string `mapstructure:"token-gh"`
Repo string `mapstructure:"repo"`
FilterPRs FlagsGitHubPrFilter `mapstructure:",squash"`
}
type FlagsGitHubPrFilter ¶ added in v0.6.0
type FlagsGitHubPrFilter struct {
Authors []string `mapstructure:"f-authors"`
LabelsOr []string `mapstructure:"f-labels-any"`
LabelsAnd []string `mapstructure:"f-labels-all"`
Milestone string `mapstructure:"f-milestone"`
TitleRegex string `mapstructure:"f-title-regex"`
Drafts bool `mapstructure:"f-drafts"`
CreationTime time.Duration `mapstructure:"f-created-time"`
UpdatedTime time.Duration `mapstructure:"f-updated-time"`
}
type FlagsTeamCity ¶ added in v0.6.0
type FlagsTeamCity struct {
Build FlagsTeamCityBuild `mapstructure:",squash"`
ServerURL string `mapstructure:"server"`
Token string `mapstructure:"token-tc"`
User string `mapstructure:"username"`
Pass string `mapstructure:"password"`
}
type FlagsTeamCityBuild ¶ added in v0.6.0
type FlagsTeamCityBuild struct {
TypeID string `mapstructure:"build-type-id"`
LegacyTypeID string `mapstructure:"buildtypeid"`
Parameters string `mapstructure:"properties"`
SkipQueue bool `mapstructure:"skip-queue"`
Wait bool `mapstructure:"wait"`
Latest bool `mapstructure:"latest"`
Comment bool `mapstructure:"comment"`
ForceOldUI bool `mapstructure:"build-link-force-old-ui"`
AddServiceSuffix bool `mapstructure:"build-type-id-add-service-suffix"`
QueueTimeout int `mapstructure:"queue-timeout"`
RunTimeout int `mapstructure:"run-timeout"`
MaxBuildsPerPR int `mapstructure:"max-builds-per-pr"`
Tags []string `mapstructure:"tag"`
}
type GithubRepo ¶
wrap the common gh lib shared with my other tools. splits common GH code from this CLI tool's specific tooling code
func (GithubRepo) GetAllPullRequestFiles ¶ added in v0.6.0
func (gr GithubRepo) GetAllPullRequestFiles(pri int, cfg DiscoveryConfig) (*map[string]struct{}, error)
func (GithubRepo) ListServices ¶ added in v0.7.0
func (ghr GithubRepo) ListServices() ([]string, error)
ListServices lists all service directory names under internal/services/ in the repo
func (GithubRepo) PrTests ¶
func (gr GithubRepo) PrTests(pri int, cfg DiscoveryConfig) (*map[string][]string, error)
todo break this apart - get/check PR state, get files, filter/process files, get tests, get services.