Skip to content
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: add --dry-run command to print tree without copying files #11

Closed
wants to merge 1 commit into from

Conversation

OmarIthawi
Copy link
Member

@OmarIthawi OmarIthawi commented Apr 5, 2023

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

  • git sparse-checkout configuration
  • git checkout tree
  • cp -r tree

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:

  • Remove source and language translations from the repositories, hence no .json, .po or .mo files will be committed into the repos.
  • Add standardized make extract_translations in all repositories
  • Push user-facing messages strings into openedx/openedx-translations.
  • Integrate root repositories with openedx/openedx-atlas to pull translations on build/deploy time

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 openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 5, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 5, 2023

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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@OmarIthawi OmarIthawi force-pushed the dry_run branch 2 times, most recently from 818e329 to 5afb809 Compare April 5, 2023 22:31
@OmarIthawi OmarIthawi marked this pull request as ready for review April 5, 2023 22:31
@brian-smith-tcril
Copy link
Contributor

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:

  • run atlas, see tree and prompt for Continue with checkout (Y/n)?
  • respond with Y or N, sparse checkout happens if Y selected

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
Copy link
Member Author

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.

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

 - `git sparse-checkout` configuration
 - `git checkout` tree
 - `cp -r` tree

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

Refs: OEP-58 FC-0012
@brian-smith-tcril
Copy link
Contributor

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
Copy link
Member Author

OmarIthawi commented Apr 12, 2023

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:

@OmarIthawi OmarIthawi closed this Apr 12, 2023
@openedx-webhooks
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants