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
Add Archive management #83
Conversation
6c717a3
to
f7618b6
Compare
c0f20ef
to
070f7d9
Compare
@rjschwei Added items option to choose specific items to archive and rebased against master. |
070f7d9
to
c56dfad
Compare
ipa/scripts/cli.py
Outdated
time_stamp = datetime.now().strftime('%Y%m%d%H%M%S') | ||
file_name = ''.join(['ipa_', time_stamp, '.tar.gz']) | ||
archive_path = os.path.join(path, file_name) | ||
|
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 think the user should have the option to give the archive a name that is meaningful to them rather than using the date based naming scheme in this case.
ipa/scripts/cli_utils.py
Outdated
shutil.copyfile(log_src, destination_path) | ||
shutil.copyfile(results_src, os.path.join(destination, results_dest)) | ||
except Exception: | ||
pass # File does not exist, nothing we can do now. |
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.
Should log or print an info message that tells the user that the selected item was not found and based on the "else" clause we should abandon the archive operation at this point all together, more below.
ipa/scripts/cli_utils.py
Outdated
except Exception: | ||
pass # File does not exist, nothing we can do now. | ||
else: | ||
# Only update the archive results log if no error occur. |
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.
We have two options, best effort, or give up on error. Implementation appears to be inconsistent. An exception on finding a file we try to archive is ignored, that implies best effort, but with the else clause we do not clean up the history for the files that were archived, which implies "give up on error".
In this case I would tend to follow th e"give up on error" approach as we can presume the user has a certain set of results in mind that should be archived and when that set cannot be met we should not do anything but tell the user of the problem. So the exception of the results copy should trigger bail out logic.
Allow history log and results + log files to be archived to a single tar file. The additional clear flag will empty the history log once the results are backed up.
If --clear-log option is used with --items only the items in list will be deleted from history file.
62d8efd
to
d75e28c
Compare
- Path and name will be used as full path to archive tarball. - If there are missing log/results files for a history item fail eagerly and let the user fix the issue before creating an archive.
d75e28c
to
069ccfe
Compare
069ccfe
to
76c900e
Compare
Allow for archiving of ipa results. All results and log files in addition to the history log will be copied to a tarball.
--clear-log
option will clear the history once the archive has complete.--items
accepts a coma separated list of values to be archived. Using--clear-log
in conjunction with--items
will delete all items in the provided list from history file.Fixes #1.