-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(foreach): run against previously failed or successful repos #147
base: main
Are you sure you want to change the base?
Conversation
|
||
failedResultsDirectory string | ||
failedReposFileName string | ||
failedReposSymlink = ".latest_failed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those could be const?
@@ -65,7 +80,9 @@ marks that no further options should be interpreted by turbolift.`, | |||
Args: cobra.MinimumNArgs(1), | |||
} | |||
|
|||
cmd.Flags().StringVar(&repoFile, "repos", "repos.txt", "A file containing a list of repositories to clone.") | |||
cmd.Flags().StringVar(&repoFile, "repos", "", "A file containing a list of repositories to clone.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is needed - this mutex between repos.txt and successful/failed seems complicated, should we just ignore the repoFile if --successful or --failed is set?
} | ||
err := os.Symlink(successfulReposFileName, successfulReposSymlink) | ||
if err != nil { | ||
logger.Warnf("Failed to create symlink for successful repos: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warn or fail?
Could there be a reason why this should fail?
|
||
overallResultsDirectory string | ||
|
||
successfulResultsDirectory string | ||
successfulReposFileName string | ||
successfulReposSymlink = ".latest_successful" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we definitely need two symlinks? If we have our output directories to be something like:
some_temp_dir_from_os/
some_random_bit/
successful/
repos.txt
logs/
failed/
repos.txt
logs/
Then we could just use one symlink, to the /some_temp_dir_from_os/some_random_bit
path and infer the rest as needed.
@@ -151,6 +185,27 @@ func setupOutputFiles(campaignName string, command string) { | |||
defer successfulReposFile.Close() | |||
defer failedReposFile.Close() | |||
|
|||
if _, err := os.Lstat(successfulReposSymlink); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can prob just override it?
#143