multi_repo 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 363ca04276f3d649809c39b6fb2edb051e2eb51f8fd87f945409d08172984e0d
4
- data.tar.gz: 8267789b5af70973998fb0ecb0e59107347f7e6403a746fa98c0bc5f43a93f3c
3
+ metadata.gz: b895e633669dae8165a89b4378005b524b7c72dd468a94038f99ad4476e8f817
4
+ data.tar.gz: 05c5cb1daf363e14fb56133aca49f5ac43c1aa50e570ab7b0db83acb44bf696f
5
5
  SHA512:
6
- metadata.gz: 501f688e2084d24d9bcb39633d974bb08cbb97c8586d25983d1a7d76f41cf4d37836f7455f6d81addff4d03c40655c10a79b668f42a12eee61f378807f06784e
7
- data.tar.gz: 43f1aff7d976517022e22ce9903fd21ea20367b2e155bd418c03d66cb960026f0ff0f43b953382b703c3badd47d65e1761234c47325803e07ca0df0e4b000a01
6
+ metadata.gz: 40240dcbbbdf8db74c625875b3698a5cf92af8b3cdef30b9ca9cc455ceba58fcff2f93cdc0148eeb60838a5e26c9c9fa7577bb8f9427b6998374c9b9e48a4c74
7
+ data.tar.gz: 8a0c1668985696faab3678c9e38241ec31a52715bbe2e7e40f27ef320d23ff4c24e1ada8c08507ff7677bb8e445e946d054d9a98213d240aa8ce93217a58d48a
@@ -17,7 +17,7 @@ jobs:
17
17
  env:
18
18
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
19
19
  steps:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
21
  - name: Set up Ruby
22
22
  uses: ruby/setup-ruby@v1
23
23
  with:
@@ -29,4 +29,4 @@ jobs:
29
29
  - name: Report code coverage
30
30
  if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}
31
31
  continue-on-error: true
32
- uses: paambaati/codeclimate-action@v3.0.0
32
+ uses: paambaati/codeclimate-action@v5
data/exe/multi_repo CHANGED
@@ -2,16 +2,26 @@
2
2
 
3
3
  SCRIPT_DIR = File.expand_path("../scripts", __dir__)
4
4
 
5
+ def available_scripts
6
+ @available_scripts ||= Dir.children(SCRIPT_DIR).sort.to_h do |script|
7
+ desc = File.read(File.join(SCRIPT_DIR, script)).match(/synopsis(?:\(|\s+)['"](.*)['"]/)&.captures&.first
8
+ [script, desc]
9
+ end
10
+ end
11
+
5
12
  def usage
6
13
  puts "Usage: multi_repo <script> [args]"
7
14
  puts " script Script to run"
8
15
  puts " args Arguments to pass to the script"
9
16
  puts " -h, --help Show this help message"
10
-
11
- available_scripts = Dir.children(SCRIPT_DIR).sort.map { |f| " #{f}"}
17
+ puts
18
+ puts "For help on a specific script, run:"
19
+ puts " multi_repo <script> --help"
12
20
  puts
13
21
  puts "Available scripts:"
14
- puts available_scripts
22
+
23
+ justify = available_scripts.keys.map(&:length).max + 2
24
+ puts available_scripts.map { |script, desc| " #{script.ljust(justify)} #{desc}" }.join("\n")
15
25
  end
16
26
 
17
27
  script, args = ARGV[0], ARGV[1..]
@@ -3,6 +3,7 @@ module MultiRepo::Helpers
3
3
  def initialize
4
4
  require "colorize"
5
5
  require "config"
6
+ require "fileutils"
6
7
 
7
8
  @errors_occurred = false
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module MultiRepo
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Delete labels on all GitHub repos."
11
+
10
12
  opt :labels, "The labels to delete.", :type => :strings, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a branch on all local git repos."
11
+
10
12
  opt :branch, "The branch to destroy.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a remote on all local git repos."
11
+
10
12
  opt :remote, "The remote to destroy", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self)
data/scripts/destroy_tag CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a tag on all local git repos."
11
+
10
12
  opt :tag, "The tag to destroy", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
data/scripts/each_repo CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Run a command in each repo."
11
+
10
12
  opt :command, "A command to run in each repo", :type => :string, :required => true
11
13
  opt :ref, "Ref to checkout before running the command", :type => :string, :default => "master"
12
14
 
data/scripts/fetch_repos CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Fetch all repos."
11
+
10
12
  opt :checkout, "Branch to checkout after fetching.", :type => :string
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
data/scripts/git_mirror CHANGED
@@ -6,4 +6,8 @@ gemfile do
6
6
  gem "multi_repo", require: "multi_repo/cli", path: File.expand_path("..", __dir__)
7
7
  end
8
8
 
9
+ Optimist.options do
10
+ synopsis "Mirror all GitHub repos into another org."
11
+ end
12
+
9
13
  exit 1 unless MultiRepo::Helpers::GitMirror.new.mirror_all
@@ -7,4 +7,8 @@ gemfile do
7
7
  end
8
8
  require "more_core_extensions/core_ext/array/tableize"
9
9
 
10
+ Optimist.options do
11
+ synopsis "Display the current GitHub rate limit."
12
+ end
13
+
10
14
  puts [MultiRepo::Service::Github.client.rate_limit.to_h].tableize
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Apply the 'hacktoberfest' label to all 'good first issue' labels."
11
+
10
12
  opt :org, "The organization to apply the `hacktoberfest` label to", :type => :string, :required => true
11
13
  opt :apply, "Apply the `hacktoberfest` label to `good first issue` labels. "\
12
14
  "Pass --no-apply to remove the `hacktoberfest` label",
data/scripts/make_alumni CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Move a set of GitHub team members to an 'alumni' team."
11
+
10
12
  opt :users, "The users to make alumni.", :type => :strings, :required => true
11
13
  opt :org, "The org in which user belongs", :type => :string, :required => true
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create a stub for a new Ruby gem on rubygems.org."
11
+
10
12
  opt :owners, "Owners to add to the gem stub", :type => :strings, :default => []
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :repo_set)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create a pull request on all repos."
11
+
10
12
  opt :base, "The target branch for the changes.", :type => :string, :required => true
11
13
  opt :head, "The name of the branch to create on your fork.", :type => :string, :required => true
12
14
  opt :script, "The path to the script that will update the desired files.", :type => :string, :required => true
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Add or remove labels on a set of pull requests."
11
+
10
12
  opt :prs, "The list of PRs to merge", :type => :strings, :required => true
11
13
  opt :add, "Labels to add", :type => :strings, :required => true
12
14
  opt :remove, "Labels to remove", :type => :strings, :required => true
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Merge a set of pull requests, also setting assignee and labels."
11
+
10
12
  opt :prs, "The list of PRs to merge", :type => :strings, :required => true
11
13
  opt :assignee, "GitHub user to assign when merging", :type => :string, :required => true
12
14
  opt :labels, "Labels to apply when merging", :type => :strings
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Reenable all disabled workflows in an org."
11
+
10
12
  opt :org, "The organization to reenable workflows in", :type => :string, :required => true
11
13
  opt :extra_repos, "Extra repos to reenable workflows in", :type => :strings, :default => []
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Rename labels on all GitHub repos."
11
+
10
12
  opt :old, "The old label names.", :type => :strings, :required => true
11
13
  opt :new, "The new label names.", :type => :strings, :required => true
12
14
 
@@ -9,6 +9,8 @@ require 'travis'
9
9
  require 'travis/pro/auto_login'
10
10
 
11
11
  opts = Optimist.options do
12
+ synopsis "Restart all Travis builds for a given branch or tag for all GitHub repos."
13
+
12
14
  opt :ref, "The branch or release tag to rebuild.", :type => :string, :required => true
13
15
 
14
16
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -11,6 +11,8 @@ require "active_support/core_ext/string/inflections"
11
11
  DISPLAY_FORMATS = %w[commit pr-title pr-label]
12
12
 
13
13
  opts = Optimist.options do
14
+ synopsis "Show the git commit log between two refs for all git repos."
15
+
14
16
  opt :from, "The commit log 'from' ref", :type => :string, :required => true
15
17
  opt :to, "The commit log 'to' ref" , :type => :string, :required => true
16
18
  opt :display, "How to display the history. Valid values are: #{DISPLAY_FORMATS.join(", ")}", :default => "commit"
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show all members of an org."
11
+
10
12
  opt :org, "The org to list the users for", :type => :string, :required => true
11
13
  opt :team, "Show members of a specific team", :type => :string
12
14
  opt :alumni, "Whether or not to include alumni", :default => false
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "List all repos in an org."
11
+
10
12
  opt :org, "The org to list the repos for", :type => :string, :required => true
11
13
  end
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show commit and merge stats for all git repos."
11
+
10
12
  opt :since, "Since what date.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show all issues in a GitHub project column."
11
+
10
12
  opt :project_id, "The project ID", :type => :integer, :required => true
11
13
  opt :column, "The column within the project", :type => :string, :required => true
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "List all repos in a repo set."
11
+
10
12
  MultiRepo::CLI.common_options(self, :only => :repo_set)
11
13
  end
12
14
 
data/scripts/show_tag CHANGED
@@ -8,6 +8,8 @@ end
8
8
  require 'more_core_extensions/core_ext/array/tableize'
9
9
 
10
10
  opts = Optimist.options do
11
+ synopsis "Show the commit for a tag in all git repos."
12
+
11
13
  opt :tag, "The tag name.", :type => :string, :required => true
12
14
 
13
15
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -13,6 +13,8 @@ require 'travis'
13
13
  require 'travis/pro/auto_login'
14
14
 
15
15
  opts = Optimist.options do
16
+ synopsis "Show the Travis status for a branch or tag for all GitHub repos."
17
+
16
18
  opt :ref, "The branch or release tag to check status for.", :type => :string, :required => true
17
19
 
18
20
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Update the branch protection for all GitHub repos."
11
+
10
12
  opt :branch, "The branch to protect.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create or update labels on all GitHub repos."
11
+
10
12
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
11
13
  end
12
14
  opts[:repo] = MultiRepo::Labels.all.keys.sort unless opts[:repo] || opts[:repo_set]
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create, update, or close a milestone in all GitHub repos."
11
+
10
12
  opt :title, "The milestone title.", :type => :string, :required => true
11
13
  opt :due_on, "The due date.", :type => :string
12
14
  opt :close, "Whether to close the milestone.", :default => false
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Update repo settings in all GitHub repos."
11
+
10
12
  MultiRepo::CLI.common_options(self)
11
13
  end
12
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-17 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport