You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Make the selection mode used by git-xargs explicit in the report
- Add more explicit error handling when all --repo or STDIN repos are
malformed
- These changes should make it easier to grok what git-xargs is doing
and why when it comes to --github-org being preferred, or user-supplied
inputs being malformed
// fetchUserProvidedReposViaGithub converts repos provided as strings, already validated as being well-formed, into GitHub API repo objects that can be further processed
// RepoFlagSuppliedRepoMalformed denotes a repo passed via the --repo flag that was malformed (perhaps missing it's Github org prefix) and therefore unprocessable
@@ -94,10 +96,12 @@ var allEvents = []types.AnnotatedEvent{
94
96
{Event: DirectCommitsPushedToRemoteBranch, Description: "Repos whose changes were pushed directly to the remote branch because --skip-pull-requests was passed"},
95
97
{Event: BranchRemotePullFailed, Description: "Repos whose remote branches could not be successfully pulled"},
96
98
{Event: BranchRemoteDidntExistYet, Description: "Repos whose specified branches did not exist on the remote, and so were first created locally"},
99
+
{Event: RepoFlagSuppliedRepoMalformed, Description: "Repos passed via the --repo flag that were malformed (missing their Github org prefix?) and therefore unprocessable"},
97
100
}
98
101
99
102
// RunStats will be a stats-tracker class that keeps score of which repos were touched, which were considered for update, which had branches made, PRs made, which were missing workflows or contexts, or had out of date workflows syntax values, etc
// SetSelectionMode accepts a string representing the method by which repos were selected for this run - in order to print a human-legible description in the final report
136
+
func (r*RunStats) SetSelectionMode(modestring) {
137
+
r.selectionMode=mode
138
+
}
139
+
140
+
// GetSelectionMode returns the currently set repo selection method
141
+
func (r*RunStats) GetSelectionMode() string {
142
+
returnr.selectionMode
143
+
}
144
+
131
145
// GetTotalRunSeconds returns the total time it took, in seconds, to run all the selected commands against all the targeted repos
returnfmt.Sprint("You must target some repos for processing either via stdin or by providing one of the --github-org, --repos, or --repo flags")
61
62
}
62
63
64
+
typeNoRepoFlagTargetsValidstruct{}
65
+
66
+
func (NoRepoFlagTargetsValid) Error() string {
67
+
returnfmt.Sprint("None of the repos specified via the --repo flag are valid. Please double-check you have included the Github org prefix for each - e.g. --repo gruntwork-io/git-xargs")
0 commit comments