Skip to content

New CLI commands#244

Merged
ekohl merged 16 commits into
voxpupuli:masterfrom
opus-codium:new-cli-commands
Feb 19, 2022
Merged

New CLI commands#244
ekohl merged 16 commits into
voxpupuli:masterfrom
opus-codium:new-cli-commands

Conversation

@neomilium

@neomilium neomilium commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Please note that this PR is on top of #206

Comment thread lib/modulesync/repository.rb Outdated
Comment thread lib/modulesync/repository.rb
Comment thread features/execute.feature Outdated
Comment thread lib/modulesync.rb Outdated
Comment thread lib/modulesync.rb Outdated
@codecov

codecov Bot commented Oct 18, 2021

Copy link
Copy Markdown

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.

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

@ekohl ekohl left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Gemfile.lock Outdated
@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
Copy Markdown
Contributor Author

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

Comment thread lib/modulesync.rb Outdated
Comment thread lib/modulesync.rb Outdated
@bastelfreak

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@ekohl ekohl left a comment

Copy link
Copy Markdown
Member

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

ekohl commented Mar 9, 2022

Copy link
Copy Markdown
Member

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

ekohl commented Mar 9, 2022

Copy link
Copy Markdown
Member

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