openedx / openedx-atlas

An Open edX CLI tool for moving translation files from openedx-translations
GNU Affero General Public License v3.0
3 stars 7 forks source link

feat: add --dry-run command to print tree without copying files #11

Closed OmarIthawi closed 1 year ago

OmarIthawi commented 1 year ago

Usage $ atlas pull --dry-run would print the following:

Full docs are in #8.

Using this command won't copy the files into local directory.

References

This pull request is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.

Check the links above for full information about the overall project.

Internalization is being rearchitected in Open edX Python, XBlock, Micro-frontend, and other projects. There are a number of immediately visible changes:

Breaking Changes

One of the primary goals of the project is to avoid breaking changes. If you noticed any suspicious code, please raise your concern. But before that, please know the strategy we're following to avoid breaking changes.

openedx-webhooks commented 1 year ago

Thanks for the pull request, @OmarIthawi! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate.

brian-smith-tcril commented 1 year ago

After thinking through the use cases I'm not sure if tying tree printing to a dry run makes sense. I can imagine a few use cases:

  1. Run atlas interactively with user input, want to see tree printed to confirm before actually doing the checkout
  2. Run atlas non-interactively, log output, seeing the tree is helpful for debugging when reading through logs
  3. Dry-run atlas

I think the simplest way to handle 2 and 3 would be to add --print-tree or something that does the tree printing, and then having --dry-run simply skip the sparse checkout step (regardless of tree printing)

Handling use case 1 is a little more complex, as ideally the flow would be:

Building out the logic for case 1 feels out of scope for this PR, but separating the logic for --dry-run and --print-tree feels in scope.

OmarIthawi commented 1 year ago

After thinking through the use cases I'm not sure if tying tree printing to a dry run makes sense. I can imagine a few use cases ...

I'll push an update splitting the two options, without an interactive mode.

I think the simplest way to handle 2 and 3 would be to add --print-tree or something that does the tree printing, and then having --dry-run simply skip the sparse checkout step (regardless of tree printing)

Did you mean skip the sparse checkout step --> copying the files step ? If sparse checkout is skipped, then a tree would be difficult to predict and print.

brian-smith-tcril commented 1 year ago

Did you mean skip the sparse checkout step --> copying the files step ? If sparse checkout is skipped, then a tree would be difficult to predict and print.

Good catch, yes. Skipping the file copy and going straight to the remove temp directory part makes sense.

OmarIthawi commented 1 year ago

To avoid inflating the project scope. I'm going to close this PR for now as I focus on integrating atlas and documented the features into issues:

openedx-webhooks commented 1 year ago

@OmarIthawi Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.