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

New CLI commands #244

Merged
merged 16 commits into from
Feb 19, 2022
Merged

New CLI commands #244

merged 16 commits into from
Feb 19, 2022

Conversation

neomilium
Copy link
Contributor

@neomilium neomilium commented Oct 18, 2021

Main goal is to be able to execute arbitrary commands on each repositories.

This PR contains a draft for new commands : reset, execute and push

  • clone: clone repo if not already done
  • execute: run arbitrary command
  • reset: hard-reset repositories
  • push: push commits

Any help to define expected behaviors is welcome.

@neomilium neomilium marked this pull request as draft October 18, 2021 16:44
@neomilium
Copy link
Contributor Author

Please note that this PR is on top of #206

lib/modulesync/repository.rb Outdated Show resolved Hide resolved
lib/modulesync/repository.rb Show resolved Hide resolved
features/execute.feature Outdated Show resolved Hide resolved
lib/modulesync.rb Outdated Show resolved Hide resolved
lib/modulesync.rb Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 18, 2021

Codecov Report

Merging #244 (0c9838c) into master (5b33600) will increase coverage by 2.37%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
+ Coverage   84.76%   87.14%   +2.37%     
==========================================
  Files          30       30              
  Lines         906     1011     +105     
==========================================
+ Hits          768      881     +113     
+ Misses        138      130       -8     
Impacted Files Coverage Δ
lib/modulesync/git_service.rb 70.58% <50.00%> (+16.24%) ⬆️
lib/modulesync/source_code.rb 97.50% <50.00%> (-2.50%) ⬇️
lib/modulesync/git_service/factory.rb 92.30% <80.00%> (+1.39%) ⬆️
lib/modulesync/git_service/base.rb 90.47% <90.90%> (+0.47%) ⬆️
lib/modulesync.rb 98.57% <97.67%> (-0.42%) ⬇️
features/step_definitions/git_steps.rb 96.15% <100.00%> (+0.32%) ⬆️
lib/modulesync/cli.rb 100.00% <100.00%> (ø)
lib/modulesync/git_service/gitlab.rb 100.00% <100.00%> (ø)
lib/modulesync/hook.rb 100.00% <100.00%> (ø)
lib/modulesync/renderer.rb 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c9e406...0c9838c. Read the comment docs.

lib/modulesync.rb Outdated Show resolved Hide resolved
@neomilium neomilium force-pushed the new-cli-commands branch 3 times, most recently from 840220d to d67be72 Compare October 18, 2021 19:14
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still love to see the execute command. It would still help me a lot.

Gemfile.lock Outdated Show resolved Hide resolved
@neomilium neomilium force-pushed the new-cli-commands branch 2 times, most recently from b965f5f to bb88b48 Compare January 24, 2022 18:07
@neomilium
Copy link
Contributor Author

Code rebased, contributions are welcome, dev is stalled on this ;-)

lib/modulesync.rb Outdated Show resolved Hide resolved
lib/modulesync.rb Outdated Show resolved Hide resolved
@bastelfreak
Copy link
Member

@neomilium do you still consider this a draft? can you please take a look at the rubocop issues?

@neomilium neomilium force-pushed the new-cli-commands branch 2 times, most recently from 5e33100 to 7ab93dc Compare January 27, 2022 22:19
@neomilium
Copy link
Contributor Author

@bastelfreak Yes, its still a draft, it requires to be used and feedbacks are needed.

Rubocop issues should be fixed.

@neomilium
Copy link
Contributor Author

One command is missing to the set to be really usable: pull-request or merge-request

@neomilium neomilium force-pushed the new-cli-commands branch 3 times, most recently from 44570d2 to b1223c9 Compare January 31, 2022 22:29
@neomilium neomilium force-pushed the new-cli-commands branch 3 times, most recently from f0327cc to 8e47644 Compare February 14, 2022 21:31
@neomilium neomilium requested a review from ekohl February 14, 2022 21:34
@neomilium neomilium force-pushed the new-cli-commands branch 5 times, most recently from 24a72ac to f73192f Compare February 18, 2022 20:37
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this addresses all my concerns. It's still a large patch and I could have missed things, but I'm going to trust all the tests you added. Let's try this out since I'm excited to replace my bash for loops with msync exec, see how that feels. Fun fact: I actually prefer doing msync exec git pull over trusting msync. Feels like I get more control. Certainly something I had desired for a long time.

@ekohl ekohl merged commit 25c2fc4 into voxpupuli:master Feb 19, 2022
@neomilium neomilium deleted the new-cli-commands branch February 21, 2022 15:48
@ekohl
Copy link
Member

ekohl commented Mar 9, 2022

Now that it's been released I'm really enjoying msync exec, but the one thing that bugs me is that it switches to the default branch. I had expected it to be a short hand for for module in modules/*/* ; do ( cd $i && $command ) ; done. Is this intentional or a bug?

@ekohl
Copy link
Member

ekohl commented Mar 9, 2022

So I opened #251 for further discussion.

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

Successfully merging this pull request may close these issues.

4 participants