neetob 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/.semaphore/semaphore.yml +4 -5
  5. data/CHANGELOG.md +21 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +15 -1
  8. data/README.md +197 -118
  9. data/bookmarks.md +30 -0
  10. data/data/branch-protection-rules.json +1 -1
  11. data/data/github-labels.json +54 -29
  12. data/images/commit-message-update.png +0 -0
  13. data/lib/neetob/cli/base.rb +22 -10
  14. data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -3
  15. data/lib/neetob/cli/github/auth.rb +3 -3
  16. data/lib/neetob/cli/github/base.rb +7 -0
  17. data/lib/neetob/cli/github/commands.rb +6 -2
  18. data/lib/neetob/cli/github/labels/commands.rb +18 -10
  19. data/lib/neetob/cli/github/labels/delete.rb +5 -3
  20. data/lib/neetob/cli/github/labels/delete_all.rb +5 -3
  21. data/lib/neetob/cli/github/labels/list.rb +5 -3
  22. data/lib/neetob/cli/github/labels/show.rb +5 -3
  23. data/lib/neetob/cli/github/labels/update.rb +16 -4
  24. data/lib/neetob/cli/github/labels/upsert.rb +43 -7
  25. data/lib/neetob/cli/github/make_pr/base.rb +2 -1
  26. data/lib/neetob/cli/github/make_pr/commands.rb +4 -1
  27. data/lib/neetob/cli/github/make_pr/compliance_fix.rb +6 -1
  28. data/lib/neetob/cli/github/make_pr/script.rb +4 -3
  29. data/lib/neetob/cli/github/protect_branch.rb +5 -3
  30. data/lib/neetob/cli/heroku/config_vars/upsert.rb +6 -2
  31. data/lib/neetob/cli/heroku/execute.rb +2 -2
  32. data/lib/neetob/cli/ui.rb +1 -1
  33. data/lib/neetob/cli/users/commands.rb +3 -1
  34. data/lib/neetob/cli/users/commits.rb +71 -22
  35. data/lib/neetob/cli.rb +3 -1
  36. data/lib/neetob/exception_handler.rb +3 -1
  37. data/lib/neetob/version.rb +1 -1
  38. data/neetob.gemspec +1 -1
  39. metadata +8 -57
  40. data/LICENSE.txt +0 -21
  41. data/env.sample +0 -1
  42. data/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
  43. data/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
  44. data/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
  45. data/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
  46. data/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
  47. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
  48. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
  49. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
  50. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
  51. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
  52. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
  53. data/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
  54. data/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
  55. data/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
  56. data/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
  57. data/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
  58. data/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
  59. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
  60. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
  61. data/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
  62. data/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
  63. data/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
  64. data/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
  65. data/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
  66. data/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
  67. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
  68. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
  69. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
  70. data/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
  71. data/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
  72. data/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
  73. data/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
  74. data/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
  75. data/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
  76. data/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
  77. data/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
  78. data/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
  79. data/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
  80. data/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
  81. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
  82. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
  83. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
  84. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
  85. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
  86. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
  87. data/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
  88. data/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
  89. data/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
  90. data/neeto_compliance/lib/neeto_compliance/version.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3291bcfdc94bbfd6c2575e8fe48ab5e9a20e51e4bf935b5bf10199cce63adde
4
- data.tar.gz: 42471a13f903e0fbb5d8d140ff570d86029e11a0617e40c4f52209ea27a1b7c3
3
+ metadata.gz: 641eee79e8d05537132030cc9db2ca8d4a57e60e480552dcb1a904fd00e542f5
4
+ data.tar.gz: a4c674222429b42cff84e1eeb7a66212b32da60f4248a36a4dae5b03439cc649
5
5
  SHA512:
6
- metadata.gz: 7f4826cd0e5c4d6c94161091a70e68c794e2b2a83d1b0297fbfac37754af2d1cb0bb9e03ae4783f3b2f8d92a8f456576a4ae36891e5611d1e4e5fe7286fffb9a
7
- data.tar.gz: 5db7526af2e260fae78e176d78531204c5e97b692ba5e0514c98108acc4294d30c8023372a2613097742edc75da9f4f1e3180d46b87d50878fc5f3554b4a9247
6
+ metadata.gz: 57951a8d15b4514b7468b7994094c42ff8b0786f6dee034091db26b71d909094c90235855f208a1b1bbc1cc4125add4a53afb6869e82e255baadbe22846220a7
7
+ data.tar.gz: e47da7744b3a4d92aa23881673f88d6cd9e1b795d92ddb67d0be5676229b82ea194b43125d0f8904bbf009c054f52884d1e5e43e2ecdff4d06eccea9e6bf227b
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # cspell:Disable
2
2
  AllCops:
3
- TargetRubyVersion: 3.0.4
3
+ TargetRubyVersion: 3.1.3
4
4
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
5
5
  # to ignore them, so only the ones explicitly set in this file are enabled.
6
6
  DisabledByDefault: true
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.4
1
+ 3.1.3
@@ -9,7 +9,7 @@ global_job_config:
9
9
  prologue:
10
10
  commands:
11
11
  - checkout
12
- - sem-version ruby 3.0.4
12
+ - sem-version ruby 3.1.3
13
13
  - bundle config path 'vendor/bundle'
14
14
  - bundle install
15
15
  env_vars:
@@ -21,11 +21,10 @@ global_job_config:
21
21
  value: "test"
22
22
 
23
23
  blocks:
24
- - name: Rails Tests
24
+ - name: Linters | Tests
25
25
  task:
26
26
  jobs:
27
- - name: Rails Tests
27
+ - name: Checks
28
28
  commands:
29
- - git clone https://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@github.com/bigbinary/neeto_compliance
30
- - cd neeto_compliance/ && git checkout 3404e3dc33764a0f6d9c976c1cd73f9b56a1c913 && cd ..
29
+ - bundle exec rubocop
31
30
  - bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [0.1.5](https://www.github.com/bigbinary/neetob/compare/v0.1.4...v0.1.5) (2023-03-01)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * handled some edge cases in the update and upsert labels cmd ([#192](https://www.github.com/bigbinary/neetob/issues/192)) ([dc87d19](https://www.github.com/bigbinary/neetob/commit/dc87d198a6a22850f3e04659413bed41d9db454f))
9
+
10
+ ### [0.1.4](https://www.github.com/bigbinary/neetob/compare/v0.1.3...v0.1.4) (2023-02-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Fixed the readme ([#176](https://www.github.com/bigbinary/neetob/issues/176)) ([7770273](https://www.github.com/bigbinary/neetob/commit/7770273f7e11e7b8006dfc5e37f6746eb4229eb3))
16
+
17
+ ## 0.1.3 (2023-02-23)
18
+
19
+
20
+ ### Features
21
+
22
+ * Added workflow to autorelease gem ([#156](https://www.github.com/bigbinary/neetob/issues/156)) ([bb7f5c9](https://www.github.com/bigbinary/neetob/commit/bb7f5c9081d0734f3a3086facbf28216a10151c3))
23
+
3
24
  ## [0.1.0] - 2022-10-28
4
25
 
5
26
  - Initial release
data/Gemfile CHANGED
@@ -21,6 +21,16 @@ group :test do
21
21
  gem "minitest", "~> 5.0"
22
22
  gem "minitest-reporters"
23
23
  gem "mocha"
24
+ gem "rubocop", "~> 1.28"
24
25
  gem "simplecov"
25
26
  gem "webmock"
26
27
  end
28
+
29
+ gem "byebug"
30
+ gem "chronic"
31
+
32
+ source "https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com" do
33
+
34
+ gem "neeto-compliance"
35
+
36
+ end
data/Gemfile.lock CHANGED
@@ -1,13 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetob (0.1.2)
4
+ neetob (0.1.5)
5
5
  dotenv (~> 2.8.1)
6
6
  launchy (~> 2.5.0)
7
7
  octokit (~> 4.0)
8
8
  terminal-table (~> 3.0.2)
9
9
  thor (~> 1.2.1)
10
10
 
11
+ GEM
12
+ remote: https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com/
13
+ specs:
14
+ neeto-compliance (1.0.1)
15
+ colorize
16
+ hashdiff
17
+ json (~> 2.6.2)
18
+
11
19
  GEM
12
20
  remote: https://rubygems.org/
13
21
  specs:
@@ -81,8 +89,11 @@ GEM
81
89
  ansi (1.5.0)
82
90
  ast (2.4.2)
83
91
  builder (3.2.4)
92
+ byebug (11.1.3)
84
93
  childprocess (4.1.0)
94
+ chronic (0.10.2)
85
95
  coderay (1.1.3)
96
+ colorize (0.8.1)
86
97
  concurrent-ruby (1.1.10)
87
98
  crack (0.4.5)
88
99
  rexml
@@ -230,11 +241,14 @@ PLATFORMS
230
241
  x86_64-linux
231
242
 
232
243
  DEPENDENCIES
244
+ byebug
245
+ chronic
233
246
  dotenv (~> 2.8.1)
234
247
  faraday-retry
235
248
  minitest (~> 5.0)
236
249
  minitest-reporters
237
250
  mocha
251
+ neeto-compliance!
238
252
  neetob!
239
253
  overcommit (~> 0.59.1)
240
254
  pry
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # neetob
2
2
 
3
- The `neetob` gem gives different commands for interacting with Github and Heroku instances of existing neeto projects.
3
+ The `neetob` gem gives different commands for interacting with Github repos, Heroku instances and other tools to manage the workflow of neeto products.
4
4
 
5
5
  ## Table of Contents
6
6
 
7
- 1. [Getting Started](#getting-started)
8
- 1. [Installation](#installation)
9
- 2. [Usage](#usage)
7
+ 1. [Usage](#usage)
8
+ 1. [Installing neetob for use](#installing-neetob-for-use)
9
+ 2. [For development](#for-development)
10
+ 2. [Source of truth](#source-of-truth)
10
11
  3. [Working with GitHub](#working-with-github)
11
12
  1. [Issues](#issues)
12
13
  2. [Labels](#labels)
@@ -21,36 +22,22 @@ The `neetob` gem gives different commands for interacting with Github and Heroku
21
22
  5. [Working with Users](#working-with-users)
22
23
  1. [Audit](#audit)
23
24
  2. [Commits](#commits)
24
- 6. [Working with Make Repos Uptodate](#working-with-make-repos-uptodate)
25
+ 6. [Make Repos Uptodate](#make-repos-uptodate)
25
26
  7. [Working with local Repos](#working-with-local-repos)
26
27
  1. [ls](#ls)
27
28
  8. [Testing](#testing)
28
29
 
29
- ## Getting started
30
+ ## Usage
30
31
 
31
- ### Installation
32
+ ### Installing neetob for use
32
33
 
33
- Clone the repository onto your system using the following command:
34
+ Install and update the gem using the following command:
34
35
 
35
36
  ```sh
36
- git clone https://github.com/bigbinary/neetob.git
37
+ gem install neetob && gem update neetob
37
38
  ```
38
39
 
39
- Navigate to the root of the application directory.
40
-
41
- ```sh
42
- cd neetob
43
- ```
44
-
45
- To set up `neetob`, execute the below command from the root of the application directory.
46
-
47
- ```sh
48
- bin/setup
49
- ```
50
-
51
- ## Usage
52
-
53
- Utilize the `help` keyword to access a comprehensive list of all the available commands and options.
40
+ Use the `help` keyword to access a list of all the available commands and options.
54
41
 
55
42
  ```
56
43
  neetob help
@@ -66,9 +53,7 @@ Options:
66
53
  [--sandbox] # All the commands in sandbox mode will run only on the "neeto-dummy" app.
67
54
  ```
68
55
 
69
- **By default, all commands will be executed in non-sandbox mode.**
70
-
71
- ### Useful command-line options
56
+ #### Useful command-line options
72
57
 
73
58
  | Option | Meaning |
74
59
  | ------------ | --------------------------------- |
@@ -77,11 +62,85 @@ Options:
77
62
  | --no-sandbox | Non-Sandbox mode |
78
63
  | --help | Provides information on a command |
79
64
 
80
- **Note:** The commands within `neetob` should be used with caution, as improper usage may result in unintended consequences, and some actions may not be reversible.
65
+ The commands within `neetob` should be used with caution, as improper usage may result in unintended consequences, and some actions may not be reversible. By default, all commands will be executed in non-sandbox mode.
66
+
67
+ ### For development
68
+
69
+ Clone the repository onto your system using the following command:
70
+
71
+ ```sh
72
+ git clone https://github.com/bigbinary/neetob.git
73
+ ```
74
+
75
+ Navigate to the root of the application directory.
76
+
77
+ ```sh
78
+ cd neetob
79
+ ```
80
+
81
+ To check and use the latest changes in the local repository install `neetob` like so:
82
+
83
+ ```sh
84
+ bin/setup
85
+ ```
86
+
87
+ We can use, check or debug the `neetob` locally by directly invoking the `neetob` class like so:
88
+
89
+ ```sh
90
+ ruby exe/neeetob
91
+ ```
92
+
93
+ #### Conventional commit messages
94
+
95
+ In `neetob` we are using the Google's [release please](https://github.com/googleapis/release-please) Github action to auto update the version and release the latest gem.
96
+
97
+ In order to make this action work we have to use the [conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0/).
98
+
99
+ The Conventional commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history.
100
+
101
+ Generally, we use three types of suffix in the commit messages that are as follows:
102
+
103
+ 1. `fix:` for the commit that fixes a bug in the codebase. This updates the third digit in the version. For example, `0.1.0` version will be updated to `0.1.1`.
104
+
105
+ 2. `feat:` for the commit that introduces a new feature to the codebase. This updates the second digit in the version. For example, `0.1.0` version will be updated to `0.2.0`.
106
+
107
+ 3. `BREAKING CHANGE:` for the commit that introduces a breaking API change. This updates the first digit in the version. For example, `0.1.0` version will be updated to `1.0.0`.
108
+
109
+ For more details please refer [official docs](https://www.conventionalcommits.org/en/v1.0.0/) from Conventional commits.
110
+
111
+ In `neetob` we use "squash and merge" option while merging the PR. So we have to update the commit message while squash and merge so that Github action can track that merge commit.
112
+
113
+ For example:
114
+
115
+ ![Commit message update](images/commit-message-update.png)
116
+
117
+ ## Source of truth
118
+
119
+ This [list of repos](https://github.com/bigbinary/neeto-compliance/blob/main/data/neeto_repos.json) is used as the "source of truth".
120
+
121
+ ## Passing list of heroku apps as option
122
+
123
+ `neetob` allows you to pass list of apps in the following three formats.
124
+
125
+ ```
126
+ // all staging heroku instances
127
+ --apps "neeto-*-staging"
128
+
129
+ // all production heroku instances
130
+ --apps "neeto-*-production"
131
+
132
+ // all staging and production instances
133
+ --apps "neeto-*-web"
134
+
135
+ // for local testing
136
+ --apps neeto-dummy
137
+ ```
138
+
139
+ For safety reasons all the examples given below would be using `--apps neeto-*-staging`.
81
140
 
82
141
  ## Working with GitHub
83
142
 
84
- Efficiently gain access to a comprehensive list of all the available subcommands for the `github` command by utilizing the `help` keyword.
143
+ Check the list of all the available subcommands for the `github` command by utilizing the `help` keyword.
85
144
 
86
145
  ```sh
87
146
  neetob github help
@@ -89,65 +148,79 @@ neetob github help
89
148
 
90
149
  ### Issues
91
150
 
92
- The `issues` command offers valuable insights into GitHub issues.
93
-
94
151
  ```sh
95
- # To efficiently list and count all the open issues that are currently unassigned
96
- neetob github issues list --count --state open --assignee none --apps "neeto-*-web"
152
+ # Lists and counts all the open issues that are currently unassigned
153
+ neetob github issues list --count --state open --assignee none --apps "neeto-*-staging"
97
154
 
98
- # To list, count and filter all unassigned open issues that are labeled as "bug" .
99
- neetob github issues list --count --label bug --state open --assignee none --apps "neeto-*-web"
155
+ # Lists, counts and filters all unassigned open issues that are labeled as "bug"
156
+ neetob github issues list --count --label bug --state open --assignee none \
157
+ --apps "neeto-*-staging"
100
158
  ```
101
159
 
102
160
  ### Labels
103
161
 
104
- The `labels` command provides an intuitive interface for interacting with Github labels.
162
+ The `labels` command provides an interface for interacting with Github labels.
105
163
 
106
164
  ```sh
107
- # The `list` command lists the details of all the labels in the Github repo.
108
- neetob github labels list --apps "neeto-*-web"
165
+ # Lists the details of all the labels in the Github repo
166
+ neetob github labels list --apps "neeto-*-staging"
109
167
 
110
- # The `show` command gives the details for a specific label in the Github repo.
111
- neetob github labels show --name priority --apps "neeto-*-web"
168
+ # Provides the details for a specific label in the Github repo
169
+ neetob github labels show --name priority --apps "neeto-*-staging"
112
170
 
113
- # The `update` command can be used to update the name of a label.
171
+ # Changes the name of the label
114
172
  neetob github labels update --old-name "High Priority" --new-name \
115
- "high-priority" --apps neeto-dummy
173
+ "high-priority" --all-neeto-repos
174
+
175
+ # Updates and inserts all the labels mentioned in the file "data/github-labels.json"
176
+ neetob github labels upsert --all-neeto-repos
116
177
 
117
- # The `upsert` command updates and inserts all the labels mentioned in default
118
- # labels JSON file that is "github-labels.json" file inside "data" directory.
119
- neetob github labels upsert --apps neeto-dummy
178
+ # Accepts a different JSON file using `path` option
179
+ neetob github labels upsert --path ~/Desktop/labels.json --apps "neeto-*-staging"
120
180
 
121
- # The `upsert` command can also be used with a different JSON file using `path` option.
122
- neetob github labels upsert --path ~/Desktop/labels.json --apps neeto-dummy
181
+ # Upsert a single label using `name`, `color`, and `description` options
182
+ # No `#` is required while adding `color`
183
+ neetob github labels upsert --name UI --color 8250df --description \
184
+ "UI work needed" --all-neeto-repos
123
185
 
124
- # The `delete` command deletes the given labels from the Github repos.
186
+ # Deletes the given labels from the Github repos
125
187
  neetob github labels delete --labels "High Priority" "Priority 1" "bug" \
126
- --apps neeto-dummy
188
+ --apps "neeto-*-staging"
127
189
 
128
- # The `delete_all` command deletes all the labels from the Github repos.
129
- neetob github labels delete_all --apps neeto-dummy
190
+ # Deletes all the labels from the Github repos
191
+ neetob github labels delete_all --apps "neeto-*-staging"
130
192
  ```
131
193
 
132
194
  Check out the default labels [file](data/github-labels.json) for the required JSON file structure.
133
195
 
196
+ Don't use `#` before the color code.
197
+
198
+ ```
199
+ {
200
+ "name": "0.25D",
201
+ "description": "Estimate - 2 hours",
202
+ //"color": "#9E800A", // Wrong usage
203
+ "color": "9E800A" // Correct usage
204
+ }
205
+ ```
206
+
134
207
  ### Search
135
208
 
136
- Easily search for keywords across multiple neeto projects within specified files by utilizing the `search` command.
209
+ Searches for keywords across multiple neeto projects within specified files by utilizing the `search` command.
137
210
 
138
211
  ```sh
139
- neetob github search --keyword neeto --path README.md --apps "neeto-*-web"
212
+ neetob github search --keyword neeto --path README.md --apps "neeto-*-staging"
140
213
  ```
141
214
 
142
215
  ### Protect branch
143
216
 
144
- Efficiently update branch protection rules across various neeto applications by utilizing the `protect_branch` command.
217
+ Updates branch protection rules in neeto repos by using the `protect_branch` command.
145
218
 
146
219
  ```sh
147
- neetob github protect_branch --branch main --apps neeto-dummy
220
+ neetob github protect_branch --branch main --apps "neeto-*-staging"
148
221
  ```
149
222
 
150
- By default, this [file](data/branch-protection-rules.json) will be used for updating the branch protection rules.
223
+ By default, file "data/branch-protection-rules.json" will be used for updating the branch protection rules.
151
224
 
152
225
  The `protect_branch` command can also be used with a different JSON file using `path` option.
153
226
 
@@ -160,26 +233,36 @@ For example, assume we have a file named `branch-protection-rules.json` on the `
160
233
  }
161
234
  ```
162
235
 
163
- To update the above-mentioned branch protection rules for the `main` branch of all the neeto applications, use the following command:
236
+ To update the above-mentioned branch protection rules for the `main` branch of all the neeto products, use the following command:
164
237
 
165
238
  ```sh
166
239
  neetob github protect_branch --branch main --path ~/Desktop/branch-protection-rules.json \
167
- --apps neeto-dummy
240
+ --apps "neeto-*-staging"
241
+ ```
242
+
243
+ We can also use the `--all-neeto-repos` option with the above mentioned command so that the
244
+ branch protection rules can be updated for
245
+ all [neeto repos](https://github.com/bigbinary/neeto-compliance/blob/main/data/neeto_repos.json).
246
+
247
+ ```sh
248
+ neetob github protect_branch --branch main --path ~/Desktop/branch-protection-rules.json \
249
+ --all-neeto-repos
168
250
  ```
169
251
 
170
252
  **Note:** Unfortunately, utilizing the Github API, we are unable to update the `Require deployments to succeed before merging` rule, as it is currently not defined as a parameter within the API. For further information on available options to update different branch protection rules, kindly refer to the official Github [documentation](https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection).
171
253
 
172
254
  ### Make PR
173
255
 
174
- The `make-pr` command can create pull requests across Github repos.
256
+ The `make-pr` command creates pull requests across Github repos.
175
257
 
176
258
  ```sh
177
- # The `compliance-fix` command will do a `bundle` inside all repos and create a PR.
259
+ # The `compliance-fix` command runs `bundle install` and
260
+ # `bundle exec neeto-audit -a` inside all repos and create a PR.
178
261
  neetob github make-pr compliance-fix
179
262
 
180
- # The `script` command will run the given script for each product and create a PR.
263
+ # The `script` command runs the given script for each product and create a PR
181
264
  neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
182
- --title "PR title"
265
+ --title "PR title" --description "PR description"
183
266
  ```
184
267
 
185
268
  ### Login
@@ -200,37 +283,37 @@ neetob heroku help
200
283
 
201
284
  ### Config vars
202
285
 
203
- The `config_vars` command is useful to interact with Heroku config variables.
286
+ The `config_vars` command interacts with Heroku config variables.
204
287
 
205
288
  ```sh
206
- # The `list` command lists all the Heroku config variables.
207
- neetob heroku config_vars list --apps "neeto-*-production"
289
+ # The `list` command lists all the Heroku config variables
290
+ neetob heroku config_vars list --apps "neeto-*-staging"
208
291
 
209
- # We can list specific Heroku config variables using `keys` option.
210
- neetob heroku config_vars list --apps "neeto-*-production" --keys key1 key2 key3
292
+ # List specific Heroku config variables using `keys` option
293
+ neetob heroku config_vars list --apps "neeto-*-staging" --keys key1 key2 key3
211
294
 
212
- # We can also use a file to specify required config vars for `list` command
213
- # Checkout the `data/config-vars-list.json` file for the required structure.
214
- neetob heroku config_vars list --apps "neeto-*-production" --path \
295
+ # List specific Heroku config variables using a file
296
+ # Checkout the `data/config-vars-list.json` file for the required structure
297
+ neetob heroku config_vars list --apps "neeto-*-staging" --path \
215
298
  neetob/data/config-vars-list.json
216
299
 
217
- # The `audit` command will check the config variables against the JSON file named as
300
+ # The `audit` command checks the config variables against the JSON file named as
218
301
  # `required-config-vars.json` that is present inside the `data` directory at the root of
219
- # installed `neetob` gem.
220
- neetob heroku config_vars audit --apps "neeto-*-production"
302
+ # installed `neetob` gem
303
+ neetob heroku config_vars audit --apps "neeto-*-staging"
221
304
 
222
- # The `audit` command can also be used with a different JSON file using `--path` option.
223
- neetob heroku config_vars audit --path ~/Desktop/config.json --apps "neeto-*-production"
305
+ # The `audit` command also works with a different JSON file using `--path` option
306
+ neetob heroku config_vars audit --path ~/Desktop/config.json --apps "neeto-*-staging"
224
307
 
225
- # The `upsert` command adds or updates the config variables from the
226
- # `data/config-vars-upsert.json` file present at the root of installed `neetob` gem.
308
+ # The `upsert` command adds or updates config variables from the
309
+ # `data/config-vars-upsert.json` file present at the root of installed `neetob` gem
227
310
  neetob heroku config_vars upsert --apps "neeto-*-staging"
228
311
 
229
- # The `remove` command is used to delete `config_vars`.
312
+ # The `remove` command deletes config variables
230
313
  neetob heroku config_vars remove --keys=TEST_KEY_1 TEST_KEY_2 --apps "neeto-*-staging"
231
314
  ```
232
315
 
233
- We can use a custom JSON file with `upsert` command using the `path` option.
316
+ We can use a custom JSON file with `upsert` command using the `--path` option.
234
317
 
235
318
  For example, assume we have a file named `config.json` on the Desktop, like so:
236
319
 
@@ -242,13 +325,13 @@ For example, assume we have a file named `config.json` on the Desktop, like so:
242
325
  }
243
326
  ```
244
327
 
245
- To update the above-mentioned config variables to all staging apps, we can use the upsert command like so:
328
+ To update the above-mentioned config variables to all staging apps, we can use the `upsert` command like so:
246
329
 
247
330
  ```sh
248
331
  neetob heroku config_vars upsert --path ~/Desktop/config.json --apps "neeto-*-staging"
249
332
  ```
250
333
 
251
- The `upsert` command can also be used to update and insert project-specific config variables.
334
+ The `upsert` command can also update or insert project-specific config variables.
252
335
 
253
336
  For example, assume we have a file named `config.json` on the `Desktop` with the following properties:
254
337
 
@@ -269,76 +352,76 @@ For example, assume we have a file named `config.json` on the `Desktop` with the
269
352
  To update the above-mentioned config variables under the defined project, we can use the upsert command like so:
270
353
 
271
354
  ```sh
272
- neetob heroku config_vars upsert --path_with_project_keys ~/Desktop/config.json
355
+ neetob heroku config_vars upsert --path_with_project_keys ~/Desktop/config.json --apps "neeto-*-staging"
273
356
  ```
274
357
 
275
358
  ### Access
276
359
 
277
- We can list, add, and remove users from multiple Heroku apps using the `access` command.
360
+ The `access` command list, add and remove users from multiple Heroku apps.
278
361
 
279
362
  ```sh
280
- # The `list` command retrieves a list of all the users from Heroku apps.
281
- neetob heroku access list --apps "neeto-*-production"
363
+ # List all the users from Heroku apps
364
+ neetob heroku access list --apps "neeto-*-staging"
282
365
 
283
- # Add new users to the Heroku apps.
366
+ # Add new users to the Heroku apps
284
367
  neetob heroku access add --users oliver@bigbinary.com eve@bigbinary.com --apps "neeto-*-staging"
285
368
 
286
- # Remove the users from the Heroku apps.
369
+ # Remove the users from the Heroku apps
287
370
  neetob heroku access remove --users oliver@bigbinary.com eve@bigbinary.com --apps \
288
371
  "neeto-*-staging"
289
372
  ```
290
373
 
291
374
  ### Execute
292
375
 
293
- Utilize the `execute` command to run a Heroku CLI command or a Rails console command for multiple neeto apps in one go.
376
+ The `execute` command executes a Heroku CLI command or a Rails console command for multiple neeto apps in one go.
294
377
 
295
378
  ```sh
296
- # We can check who has access to the neeto Heroku apps like so:
297
- neetob heroku execute -c "heroku access" --apps "neeto-*-production"
379
+ # Execute Heroku CLI command
380
+ neetob heroku execute -c "heroku access" --apps "neeto-*-staging"
298
381
 
299
- # We can run a command in the Rails console for different neeto Heroku apps like so:
382
+ # Execute Rails console command
300
383
  neetob heroku execute -c "Sidekiq::Cron::Job.destroy \"server_side_worker\"" --apps \
301
384
  "neeto-*-staging" --rails
302
385
  ```
303
386
 
304
387
  ## Working with users
305
388
 
306
- Using the `users` command, we can interact with the contributors of neeto applications.
389
+ The `users` command interacts with the contributors of neeto applications.
307
390
 
308
391
  ### Audit
309
392
 
310
- The `audit` command enables the ability to comprehensively audit contributors across all neeto applications by providing functionality to check for contributors with multiple emails and users with third-party domain emails.
311
-
312
- This command will search and use the neeto repos in the current working directory.
313
- To fetch and update all neeto repos execute [make_repos_uptodate](#working-with-make-repos-uptodate) command before the `audit` command.
393
+ The `audit` command checks the contributors across all neeto applications for multiple emails and third-party domain emails.
314
394
 
315
395
  ```sh
396
+ # Audit all the contributors
316
397
  neetob users audit
317
398
  ```
318
399
 
319
400
  ### Commits
320
401
 
321
- Using `commits` command we can list the commits for a user in a defined duration.
322
-
323
- This command will search and use the neeto repos in the current working directory.
324
- To fetch and update all neeto repos execute [make_repos_uptodate](#working-with-make-repos-uptodate) command before the `commits` command.
402
+ The `commits` command lists the commits for a user in a defined duration.
325
403
 
326
404
  ```sh
327
405
  # The below mentioned command will open a list of all the commits across neeto
328
- # repos made by "udai1931" in the duration of last 6 months
406
+ # product repos made by "udai1931" in the duration of last 6 months
329
407
  neetob users commits --author udai1931 --duration 6.months
330
408
 
331
- # We can list commits for a specific product using `--apps` option
409
+ # List commits for a specific product using `--apps` option
332
410
  neetob users commits --author udai1931 --duration 6.months --apps neeto-kb-web
411
+
412
+ # List commits for all neeto repos using the `--all-neeto-repos` option
413
+ neetob users commits --author udai1931 --duration 6.months --all-neeto-repos
333
414
  ```
334
415
 
335
- ## Working with Make Repos Uptodate
416
+ ## Make Repos Uptodate
336
417
 
337
- Using the `make_repos_uptodate` command, we can uptodate all neeto repos.
338
- The list of neeto repos is picked up from [neeto_compliance](https://github.com/bigbinary/neeto-compliance/blob/main/lib/neeto_compliance/neeto_repos.rb).
418
+ The `make_repos_uptodate` command updates all neeto repos.
339
419
 
340
420
  ```sh
341
421
  neetob make_repos_uptodate
422
+
423
+ # Update all neeto repos with `--all-neeto-repos`
424
+ neetob make_repos_uptodate --all-neeto-repos
342
425
  ```
343
426
 
344
427
  Executing the above mentioned command will check and clone all the missing neeto repos in the current working directory and will update all of them to the latest version. After the execution of command the directories will look something like this:
@@ -351,25 +434,21 @@ neeto-kb-web
351
434
 
352
435
  ## Working with local Repos
353
436
 
354
- Using the `local` command, we can interact with the local neeto repos.
437
+ The `local` command interacts with the local neeto repos.
355
438
 
356
439
  ### ls
357
440
 
358
- The `ls` command can list the files from all the local neeto repos.
359
-
360
- This command will search and use the neeto repos in the current working directory.
361
- To fetch and update all neeto repos execute [make_repos_uptodate](#working-with-make-repos-uptodate) command before the `ls` command.
441
+ The `ls` command lists the files from all the local neeto repos.
362
442
 
363
443
  ```sh
364
- # The `ls` command will list all the files in the root directory of neeto repos.
365
- neetob local ls --apps "*"
444
+ # List all the files in the root directory of neeto repos
445
+ neetob local ls --apps "neeto-*-web"
366
446
 
367
- # The `ls` command can also list files in a specific directory using the
368
- # `--dir` option.
369
- neetob local ls --dir public --apps "*"
447
+ # List files in a specific directory with `--dir` option
448
+ neetob local ls --dir public --apps "neeto-*-web"
370
449
 
371
- # We can also list files in a nested directory.
372
- neetob local ls --dir app/controllers --apps "*"
450
+ # List files in a nested directory
451
+ neetob local ls --dir app/controllers --apps "neeto-*-web"
373
452
  ```
374
453
 
375
454
  ## Testing
@@ -378,4 +457,4 @@ For testing `github` commands use - [neeto-dummy](https://github.com/bigbinary/n
378
457
 
379
458
  For testing `heroku` commands use - [neeto-dummy](https://dashboard.heroku.com/apps/neeto-dummy) app.
380
459
 
381
- **Note:** Contact your respective Team Lead if you don't have access..
460
+ **Note:** Contact your respective Team Lead if you don't have access.