Skip to content

Allow archive to be run as its own module #295

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

Merged
merged 8 commits into from
Oct 9, 2020
Merged

Conversation

sgsmob
Copy link
Contributor

@sgsmob sgsmob commented Oct 7, 2020

[edit:krivard] Fixes #280.

Archiving can now be run from the command line as a module, e.g.,

$ python -m delphi_utils.archive --help

usage: archive.py [-h] --archive_type {git,s3} [--indicator_prefix INDICATOR_PREFIX] [--branch_name BRANCH_NAME]
                  [--override_dirty] [--commit_partial_success] [--commit_message COMMIT_MESSAGE]

optional arguments:
  -h, --help            show this help message and exit
  --archive_type {git,s3}
                        Type of archive differ to use.
  --indicator_prefix INDICATOR_PREFIX
                        The prefix for S3 keys related to this indicator. Required for `archive_type = 's3'
  --branch_name BRANCH_NAME
                        Branch to use for `archive_type` = 'git'.
  --override_dirty      Whether to allow overwriting of untracked & uncommitted changes for `archive_type` = 'git'
  --commit_partial_success
                        Whether to still commit for `archive_type` = 'git' even if some files were not archived and staged due to
                        `override_dirty` = False.
  --commit_message COMMIT_MESSAGE
                        Commit message for `archive_type` = 'git'

@sgsmob
Copy link
Contributor Author

sgsmob commented Oct 7, 2020

See #280

@krivard krivard requested a review from huisaddison October 7, 2020 19:38
@huisaddison
Copy link
Contributor

huisaddison commented Oct 9, 2020

tl;dr : LGTM

  • Read through source - code looks good - added ArchDiffer.run() and run_module() (a few diffs are line breaks to enforce character limits, which I appreciate)
  • Compared the implementation of ArchiveDiffer.run() [link] against the ArchDiffer runs in delphi_jhu [link] and delphi_google_health [link]. Looks like a straightforward abstraction of the functionality to me.
  • Unit tests look good to me (also looks like @sgsmob deduped some local constants into global constants :) ). Checked out the PR locally, installed module, ran unit tests, everything passes.

@krivard is there anything else you want me to look into for this code review? For @sgsmob 's context - I am not a professional software engineer, and I haven't been heavily involved in engineering since April-ish. I wrote a bunch of initial indicator code, then switched to modeling for the summer, and then I came back to eng because the structure allows me to get Phd student work done in parallel :P So my main "strength" is probably explaining why there are certain hacks in legacy code (and spending time fixing them to pay down our tech debt!)

@krivard
Copy link
Contributor

krivard commented Oct 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt archive utility to run as a separate step in the pipeline
3 participants