neetob 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.semaphore/semaphore.yml +3 -4
  3. data/CHANGELOG.md +14 -0
  4. data/Gemfile +10 -0
  5. data/Gemfile.lock +17 -4
  6. data/README.md +64 -36
  7. data/bookmarks.md +5 -0
  8. data/data/branch-protection-rules.json +1 -1
  9. data/data/github-labels.json +7 -2
  10. data/lib/neetob/cli/base.rb +22 -10
  11. data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -3
  12. data/lib/neetob/cli/github/base.rb +7 -0
  13. data/lib/neetob/cli/github/commands.rb +6 -2
  14. data/lib/neetob/cli/github/labels/commands.rb +18 -10
  15. data/lib/neetob/cli/github/labels/delete.rb +5 -3
  16. data/lib/neetob/cli/github/labels/delete_all.rb +5 -3
  17. data/lib/neetob/cli/github/labels/list.rb +5 -3
  18. data/lib/neetob/cli/github/labels/show.rb +5 -3
  19. data/lib/neetob/cli/github/labels/update.rb +5 -3
  20. data/lib/neetob/cli/github/labels/upsert.rb +41 -7
  21. data/lib/neetob/cli/github/make_pr/base.rb +2 -1
  22. data/lib/neetob/cli/github/make_pr/commands.rb +4 -1
  23. data/lib/neetob/cli/github/make_pr/compliance_fix.rb +6 -1
  24. data/lib/neetob/cli/github/make_pr/script.rb +4 -3
  25. data/lib/neetob/cli/github/protect_branch.rb +5 -3
  26. data/lib/neetob/cli/heroku/config_vars/upsert.rb +6 -2
  27. data/lib/neetob/cli/heroku/execute.rb +2 -2
  28. data/lib/neetob/cli/users/commands.rb +3 -1
  29. data/lib/neetob/cli/users/commits.rb +71 -22
  30. data/lib/neetob/cli.rb +3 -1
  31. data/lib/neetob/version.rb +1 -1
  32. data/neetob.gemspec +50 -0
  33. metadata +7 -56
  34. data/LICENSE.txt +0 -21
  35. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
  36. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
  37. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
  38. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
  39. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
  40. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
  41. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
  42. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
  43. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
  44. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
  45. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
  46. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
  47. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
  48. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
  49. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
  50. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
  51. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
  52. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
  53. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
  54. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
  55. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
  56. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
  57. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
  58. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
  59. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
  60. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
  61. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
  62. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
  63. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
  64. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
  65. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
  66. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
  67. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
  68. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
  69. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
  70. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
  71. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
  72. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
  73. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
  74. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
  75. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
  76. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
  77. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
  78. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
  79. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
  80. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
  81. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
  82. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
  83. data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/version.rb +0 -5
  84. data/env.sample +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c206bcf956ef7c1b49115339feafec9ec613e7a00a905852bedf49e341dbcb97
4
- data.tar.gz: cfa31777fd27276320f421715ff853495c8cd6ab81e9e44b1c57927ed76b83cd
3
+ metadata.gz: 341391d50e6f4be4c69fe7608c6cdcdad8ffecb7fbf55aac1bdcf0fa307a51dd
4
+ data.tar.gz: 2984a090795cf1f51a05e8dfd18957ba74172469f432cef6f8f217f2739dbbf2
5
5
  SHA512:
6
- metadata.gz: acf04fc283b7a215c50d8316ffff94f684289952cfe8ecc0cff7a2c3a7a33eb6a3a34324243571f8629e9f73c691ab9909dd1ff6eb0adc2d36dfbd960d105821
7
- data.tar.gz: 932a3938fff9465bb9806c12a967648454beb96c1035b4056d4041a340b95679d07c3e02e0070ec4ebbcbc0fdc21f663f752e0196c20e9866f57346a6b636135
6
+ metadata.gz: e2f7b80a100686409a27f851aa9abc9f74bcbe101ebe6a635619bd9c6a5db9e8ed39804444207f63703db4e207a7f886272117a6287c8cfc3421ac3ba81dde3a
7
+ data.tar.gz: 19ca0f250839ef5c0c47ec51520fbdfd7af5ae344e9efedbefb6f8a9579c4675307f0a11a50a029de83709f2ba02ce8f0017e3814289719c09289f5a6b8676fd
@@ -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,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [0.1.4](https://www.github.com/bigbinary/neetob/compare/v0.1.3...v0.1.4) (2023-02-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Fixed the readme ([#176](https://www.github.com/bigbinary/neetob/issues/176)) ([7770273](https://www.github.com/bigbinary/neetob/commit/7770273f7e11e7b8006dfc5e37f6746eb4229eb3))
9
+
10
+ ## 0.1.3 (2023-02-23)
11
+
12
+
13
+ ### Features
14
+
15
+ * Added workflow to autorelease gem ([#156](https://www.github.com/bigbinary/neetob/issues/156)) ([bb7f5c9](https://www.github.com/bigbinary/neetob/commit/bb7f5c9081d0734f3a3086facbf28216a10151c3))
16
+
3
17
  ## [0.1.0] - 2022-10-28
4
18
 
5
19
  - 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.0)
4
+ neetob (0.1.4)
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
@@ -103,8 +114,8 @@ GEM
103
114
  concurrent-ruby (~> 1.0)
104
115
  iniparse (1.5.0)
105
116
  json (2.6.3)
106
- launchy (2.5.0)
107
- addressable (~> 2.7)
117
+ launchy (2.5.2)
118
+ addressable (~> 2.8)
108
119
  loofah (2.19.1)
109
120
  crass (~> 1.0.2)
110
121
  nokogiri (>= 1.5.9)
@@ -226,15 +237,17 @@ GEM
226
237
 
227
238
  PLATFORMS
228
239
  x86_64-darwin-21
229
- x86_64-darwin-22
230
240
  x86_64-linux
231
241
 
232
242
  DEPENDENCIES
243
+ byebug
244
+ chronic
233
245
  dotenv (~> 2.8.1)
234
246
  faraday-retry
235
247
  minitest (~> 5.0)
236
248
  minitest-reporters
237
249
  mocha
250
+ neeto-compliance!
238
251
  neetob!
239
252
  overcommit (~> 0.59.1)
240
253
  pry
data/README.md CHANGED
@@ -1,6 +1,6 @@
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 and Heroku instances of existing neeto products, nanos and [repos](https://github.com/bigbinary/neeto-compliance/blob/main/data/neeto_repos.json).
4
4
 
5
5
  ## Table of Contents
6
6
 
@@ -89,51 +89,65 @@ neetob github help
89
89
 
90
90
  ### Issues
91
91
 
92
- The `issues` command offers valuable insights into GitHub issues.
93
-
94
92
  ```sh
95
- # To efficiently list and count all the open issues that are currently unassigned
93
+ # Lists and counts all the open issues that are currently unassigned
96
94
  neetob github issues list --count --state open --assignee none --apps "neeto-*-web"
97
95
 
98
- # To list, count and filter all unassigned open issues that are labeled as "bug" .
96
+ # Lists, counts and filters all unassigned open issues that are labeled as "bug"
99
97
  neetob github issues list --count --label bug --state open --assignee none --apps "neeto-*-web"
100
98
  ```
101
99
 
102
100
  ### Labels
103
101
 
104
- The `labels` command provides an intuitive interface for interacting with Github labels.
102
+ The `labels` command provides an interface for interacting with Github labels.
105
103
 
106
104
  ```sh
107
- # The `list` command lists the details of all the labels in the Github repo.
105
+ # Lists the details of all the labels in the Github repo
108
106
  neetob github labels list --apps "neeto-*-web"
109
107
 
110
- # The `show` command gives the details for a specific label in the Github repo.
108
+ # Provides the details for a specific label in the Github repo
111
109
  neetob github labels show --name priority --apps "neeto-*-web"
112
110
 
113
- # The `update` command can be used to update the name of a label.
111
+ # Changes the name of the label
114
112
  neetob github labels update --old-name "High Priority" --new-name \
115
- "high-priority" --apps neeto-dummy
113
+ "high-priority" --all-neeto-repos
114
+
115
+ # Updates and inserts all the labels mentioned in the file "data/github-labels.json"
116
+ neetob github labels upsert --all-neeto-repos
116
117
 
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
118
+ # Accepts a different JSON file using `path` option
119
+ neetob github labels upsert --path ~/Desktop/labels.json --apps "neeto-*-web"
120
120
 
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
121
+ # The `upsert` command can also upsert a single label using `name`, `color`
122
+ # and `description` options
123
+ # No `#` is required while adding `color`
124
+ neetob github labels upsert --name UI --color 8250df --description \
125
+ "UI work needed" --all-neeto-repos
123
126
 
124
- # The `delete` command deletes the given labels from the Github repos.
127
+ # Deletes the given labels from the Github repos
125
128
  neetob github labels delete --labels "High Priority" "Priority 1" "bug" \
126
- --apps neeto-dummy
129
+ --apps "neeto-*-web"
127
130
 
128
- # The `delete_all` command deletes all the labels from the Github repos.
129
- neetob github labels delete_all --apps neeto-dummy
131
+ # Deletes all the labels from the Github repos
132
+ neetob github labels delete_all --apps "neeto-*-web"
130
133
  ```
131
134
 
132
135
  Check out the default labels [file](data/github-labels.json) for the required JSON file structure.
133
136
 
137
+ Don't use `#` before the color code.
138
+
139
+ ```
140
+ {
141
+ "name": "0.25D",
142
+ "description": "Estimate - 2 hours",
143
+ //"color": "#9E800A", // Wrong usage
144
+ "color": "9E800A" // Correct usage
145
+ }
146
+ ```
147
+
134
148
  ### Search
135
149
 
136
- Easily search for keywords across multiple neeto projects within specified files by utilizing the `search` command.
150
+ Searches for keywords across multiple neeto projects within specified files by utilizing the `search` command.
137
151
 
138
152
  ```sh
139
153
  neetob github search --keyword neeto --path README.md --apps "neeto-*-web"
@@ -141,13 +155,13 @@ neetob github search --keyword neeto --path README.md --apps "neeto-*-web"
141
155
 
142
156
  ### Protect branch
143
157
 
144
- Efficiently update branch protection rules across various neeto applications by utilizing the `protect_branch` command.
158
+ Updates branch protection rules in neeto repos by using the `protect_branch` command.
145
159
 
146
160
  ```sh
147
161
  neetob github protect_branch --branch main --apps neeto-dummy
148
162
  ```
149
163
 
150
- By default, this [file](data/branch-protection-rules.json) will be used for updating the branch protection rules.
164
+ By default, file "data/branch-protection-rules.json" will be used for updating the branch protection rules.
151
165
 
152
166
  The `protect_branch` command can also be used with a different JSON file using `path` option.
153
167
 
@@ -160,26 +174,36 @@ For example, assume we have a file named `branch-protection-rules.json` on the `
160
174
  }
161
175
  ```
162
176
 
163
- To update the above-mentioned branch protection rules for the `main` branch of all the neeto applications, use the following command:
177
+ To update the above-mentioned branch protection rules for the `main` branch of all the neeto products, use the following command:
164
178
 
165
179
  ```sh
166
180
  neetob github protect_branch --branch main --path ~/Desktop/branch-protection-rules.json \
167
- --apps neeto-dummy
181
+ --apps "neeto-*-staging"
182
+ ```
183
+
184
+ We can also use the `--all-neeto-repos` option with the above mentioned command so that the
185
+ branch protection rules can be updated for
186
+ all [neeto repos](https://github.com/bigbinary/neeto-compliance/blob/main/data/neeto_repos.json).
187
+
188
+ ```sh
189
+ neetob github protect_branch --branch main --path ~/Desktop/branch-protection-rules.json \
190
+ --all-neeto-repos
168
191
  ```
169
192
 
170
193
  **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
194
 
172
195
  ### Make PR
173
196
 
174
- The `make-pr` command can create pull requests across Github repos.
197
+ The `make-pr` command creates pull requests across Github repos.
175
198
 
176
199
  ```sh
177
- # The `compliance-fix` command will do a `bundle` inside all repos and create a PR.
200
+ # The `compliance-fix` command runs `bundle install` and
201
+ # `bundle exec neeto-audit -a` inside all repos and create a PR.
178
202
  neetob github make-pr compliance-fix
179
203
 
180
- # The `script` command will run the given script for each product and create a PR.
204
+ # The `script` command runs the given script for each product and create a PR
181
205
  neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
182
- --title "PR title"
206
+ --title "PR title" --description "PR description"
183
207
  ```
184
208
 
185
209
  ### Login
@@ -203,10 +227,10 @@ neetob heroku help
203
227
  The `config_vars` command is useful to interact with Heroku config variables.
204
228
 
205
229
  ```sh
206
- # The `list` command lists all the Heroku config variables.
230
+ # The `list` command lists all the Heroku config variables
207
231
  neetob heroku config_vars list --apps "neeto-*-production"
208
232
 
209
- # We can list specific Heroku config variables using `keys` option.
233
+ # We can list specific Heroku config variables using `keys` option
210
234
  neetob heroku config_vars list --apps "neeto-*-production" --keys key1 key2 key3
211
235
 
212
236
  # We can also use a file to specify required config vars for `list` command
@@ -320,16 +344,16 @@ neetob users audit
320
344
 
321
345
  Using `commits` command we can list the commits for a user in a defined duration.
322
346
 
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.
325
-
326
347
  ```sh
327
348
  # 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
349
+ # product repos made by "udai1931" in the duration of last 6 months.
329
350
  neetob users commits --author udai1931 --duration 6.months
330
351
 
331
- # We can list commits for a specific product using `--apps` option
352
+ # We can list commits for a specific product using `--apps` option.
332
353
  neetob users commits --author udai1931 --duration 6.months --apps neeto-kb-web
354
+
355
+ # We can list commits for all neeto repos using the `--all-neeto-repos` option.
356
+ neetob users commits --author udai1931 --duration 6.months --all-neeto-repos
333
357
  ```
334
358
 
335
359
  ## Working with Make Repos Uptodate
@@ -339,6 +363,10 @@ The list of neeto repos is picked up from [neeto_compliance](https://github.com/
339
363
 
340
364
  ```sh
341
365
  neetob make_repos_uptodate
366
+
367
+ # We have a `--all-neeto-repos` option for this command too so that we can
368
+ # fetch and update all the neeto repos in the current working directory.
369
+ neetob make_repos_uptodate --all-neeto-repos
342
370
  ```
343
371
 
344
372
  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:
@@ -378,4 +406,4 @@ For testing `github` commands use - [neeto-dummy](https://github.com/bigbinary/n
378
406
 
379
407
  For testing `heroku` commands use - [neeto-dummy](https://dashboard.heroku.com/apps/neeto-dummy) app.
380
408
 
381
- **Note:** Contact your respective Team Lead if you don't have access..
409
+ **Note:** Contact your respective Team Lead if you don't have access.
data/bookmarks.md ADDED
@@ -0,0 +1,5 @@
1
+ [All UI issues](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Abigbinary+label%3Aui)
2
+
3
+ [All UX issues](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Abigbinary+label%3Aux)
4
+
5
+ [Engineer needed](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Abigbinary+label%3Aengineer-needed)
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "required_status_checks": {
5
5
  "strict": true,
6
- "contexts": ["ci/semaphoreci/push: cicheck"]
6
+ "contexts": ["ci/semaphoreci/pr: cicheck"]
7
7
  },
8
8
  "required_conversation_resolution": true,
9
9
  "has_required_deployments": true,
@@ -107,7 +107,7 @@
107
107
  {
108
108
  "name": "epic",
109
109
  "description": "Will get closed when sub-issues fixed and this issue tracked in monthly milestone.",
110
- "color": "6A5ACD"
110
+ "color": "6A5ACD"
111
111
  },
112
112
  {
113
113
  "name": "frontend",
@@ -147,7 +147,7 @@
147
147
  {
148
148
  "name": "POC",
149
149
  "description": "Proof of concept or doing spike work.",
150
- "color": "008080"
150
+ "color": "008080"
151
151
  },
152
152
  {
153
153
  "name": "PR",
@@ -184,6 +184,11 @@
184
184
  "description": "This issue is part of the UI weekly milestone.",
185
185
  "color": "366FB9"
186
186
  },
187
+ {
188
+ "name": "engineer-needed",
189
+ "description": "Engineer is needed to work on the issue",
190
+ "color": "B0C4DE"
191
+ },
187
192
  {
188
193
  "name": "working",
189
194
  "description": "This issue is part of the UI weekly milestone.",
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "neeto-compliance"
4
+
3
5
  require_relative "ui"
4
6
  require_relative "../utils"
5
- require_relative "../../../neeto_compliance/lib/neeto_compliance/neeto_apps.rb"
6
7
 
7
8
  module Neetob
8
9
  class CLI::Base
@@ -18,12 +19,12 @@ module Neetob
18
19
 
19
20
  private
20
21
 
21
- def find_all_matching_apps(apps, platform_name, sandbox_mode, quiet = false)
22
+ def find_all_matching_apps(apps, platform_name, sandbox_mode, quiet = false, all_neeto_repos = false)
22
23
  inform_about_current_working_mode(sandbox_mode, quiet)
23
24
  all_available_apps = sandbox_mode ?
24
25
  testing_apps(platform_name) :
25
- build_app_list_from_neeto_compliance(platform_name)
26
- matching_apps = match_apps(apps, all_available_apps)
26
+ build_app_list_from_neeto_compliance(platform_name, all_neeto_repos)
27
+ matching_apps = match_apps(apps || ["*"], all_available_apps)
27
28
  if matching_apps.length == 0
28
29
  error_msg = sandbox_mode ?
29
30
  "Only \"neeto-dummy\" app is available for sandbox mode. Remove the \"--sandbox\" flag to run the given command for all the neeto applications." :
@@ -36,9 +37,9 @@ module Neetob
36
37
  end
37
38
 
38
39
  def match_apps(required_apps, available_apps)
39
- apps = required_apps.map { |app| Regexp.new "#{app.gsub("*", "[-a-zA-Z0-9]*")}" }
40
+ apps = required_apps&.map { |app| Regexp.new "#{app.gsub("*", "[-a-zA-Z0-9]*")}" }
40
41
  available_apps.select do |available_app|
41
- apps.any? { |app| app.match?(available_app) }
42
+ apps&.any? { |app| app.match?(available_app) }
42
43
  end
43
44
  end
44
45
 
@@ -47,10 +48,9 @@ module Neetob
47
48
  JSON.parse(file)
48
49
  end
49
50
 
50
- def build_app_list_from_neeto_compliance(platform_name)
51
- apps = NeetoCompliance::NeetoApps.list.map { |app| camel_case_to_slug(app) }
52
- all_web_apps = suffix_slug(apps, :web)
53
- platform_name == :heroku ? add_env_suffix(all_web_apps) : prefix_org_name(all_web_apps)
51
+ def build_app_list_from_neeto_compliance(platform_name, all_neeto_repos)
52
+ apps = all_neeto_repos ? fetch_all_neeto_repos : NeetoCompliance::NeetoRepos.products.keys
53
+ platform_name == :heroku ? add_env_suffix(apps) : prefix_org_name(apps)
54
54
  end
55
55
 
56
56
  def add_env_suffix(apps)
@@ -81,5 +81,17 @@ module Neetob
81
81
  end
82
82
  ui.say(callout_message)
83
83
  end
84
+
85
+ def fetch_all_neeto_repos
86
+ NeetoCompliance::NeetoRepos::products.keys +
87
+ NeetoCompliance::NeetoRepos::nanos +
88
+ NeetoCompliance::NeetoRepos::widgets +
89
+ NeetoCompliance::NeetoRepos::chrome_extensions +
90
+ NeetoCompliance::NeetoRepos::helper_packages +
91
+ NeetoCompliance::NeetoRepos::electron_apps +
92
+ NeetoCompliance::NeetoRepos::executables +
93
+ NeetoCompliance::NeetoRepos::mobile_apps +
94
+ NeetoCompliance::NeetoRepos::other_repos
95
+ end
84
96
  end
85
97
  end
@@ -6,18 +6,20 @@ module Neetob
6
6
  class CLI
7
7
  module FetchorupdateRepos
8
8
  class Execute < Base
9
- attr_accessor :sandbox, :apps
9
+ attr_accessor :sandbox, :apps, :all_neeto_repos
10
10
 
11
- def initialize(sandbox = false, apps = ["*"])
11
+ def initialize(sandbox = false, all_neeto_repos = false, apps = ["*"])
12
12
  super()
13
13
  @sandbox = sandbox
14
14
  @apps = apps
15
+ @all_neeto_repos = all_neeto_repos
15
16
  end
16
17
 
17
18
  def run
18
- neeto_apps = find_all_matching_apps(apps, :github, sandbox)
19
+ neeto_apps = find_all_matching_apps(apps, :github, sandbox, false, all_neeto_repos)
19
20
  neeto_apps.each do |app|
20
21
  app_name = app.split("/").last
22
+ ui.info("\nWorking on #{app_name}\n")
21
23
  if directory_exists(app_name)
22
24
  checkout_to_main_and_fetch_commits(app_name)
23
25
  else
@@ -23,6 +23,13 @@ module Neetob
23
23
  @client = Octokit::Client.new(access_token: auth_client.access_token)
24
24
  end
25
25
 
26
+ def check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
27
+ if (apps.nil? && !all_neeto_repos) || (!apps.nil? && all_neeto_repos)
28
+ ui.error("Please provide either \"apps\" or \"all-neeto-repos\" option.")
29
+ exit
30
+ end
31
+ end
32
+
26
33
  private
27
34
 
28
35
  def read_and_parse_auth_params_from_env
@@ -40,9 +40,13 @@ module Neetob
40
40
  desc: "Name of the branch whose protections rules needs to be updated", required: true
41
41
  option :path, type: :string, aliases: "-p",
42
42
  desc: "The JSON file path which specify all the required rules for branch protection"
43
- option :apps, type: :array, aliases: "-a", required: true, desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
43
+ option :apps, type: :array, aliases: "-a", desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
44
+ option :all_neeto_repos, type: :boolean, aliases: "--all",
45
+ desc: "Use this flag for working with all neeto repos", default: false
44
46
  def protect_branch
45
- ProtectBranch.new(options[:branch], options[:apps], options[:path], options[:sandbox]).run
47
+ ProtectBranch.new(
48
+ options[:branch], options[:apps], options[:path], options[:sandbox],
49
+ options[:all_neeto_repos]).run
46
50
  end
47
51
  end
48
52
  end
@@ -16,44 +16,52 @@ module Neetob
16
16
  module Labels
17
17
  class Commands < SubCommandBase
18
18
  class_option :apps,
19
- {
20
- type: :array, aliases: "-a", required: true,
21
- desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
22
- }
19
+ type: :array, aliases: "-a",
20
+ desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
21
+ class_option :all_neeto_repos,
22
+ type: :boolean, aliases: "--all", default: false,
23
+ desc: "Use this flag for working with all neeto repos"
23
24
 
24
25
  desc "list", "List all the labels in the Github repos"
25
26
  def list
26
- List.new(options[:apps], options[:sandbox]).run
27
+ List.new(options[:apps], options[:sandbox], options[:all_neeto_repos]).run
27
28
  end
28
29
 
29
30
  desc "show", "Show details about the given label in the Github repos"
30
31
  option :name, type: :string, aliases: "-n", required: true, desc: "Name of the label"
31
32
  def show
32
- Show.new(options[:apps], options[:name], options[:sandbox]).run
33
+ Show.new(options[:apps], options[:name], options[:sandbox], options[:all_neeto_repos]).run
33
34
  end
34
35
 
35
36
  desc "upsert", "Create and update labels in the Github repos"
36
37
  option :path, type: :string, aliases: "-p", desc: "The JSON file path which has a list of all the required labels. Each label should have name. The color and description are optional"
38
+ option :name, type: :string, desc: "Name of the label you want to upsert"
39
+ option :color, type: :string, desc: "Color of the label you want to upsert"
40
+ option :description, type: :string, desc: "Description of the label you want to upsert"
37
41
  def upsert
38
- Upsert.new(options[:apps], options[:path], options[:sandbox]).run
42
+ Upsert.new(
43
+ options[:apps], options[:path], options[:sandbox], options[:all_neeto_repos], options[:name],
44
+ options[:color], options[:description]).run
39
45
  end
40
46
 
41
47
  desc "delete_all", "Delete all the labels from the Github repos"
42
48
  def delete_all
43
- DeleteAll.new(options[:apps], options[:sandbox]).run
49
+ DeleteAll.new(options[:apps], options[:sandbox], options[:all_neeto_repos]).run
44
50
  end
45
51
 
46
52
  desc "delete", "Delete some labels from the Github repos"
47
53
  option :labels, type: :array, required: true, desc: "Labels you want to delete from the repos."
48
54
  def delete
49
- Delete.new(options[:apps], options[:labels], options[:sandbox]).run
55
+ Delete.new(options[:apps], options[:labels], options[:sandbox], options[:all_neeto_repos]).run
50
56
  end
51
57
 
52
58
  desc "update", "Update a label name in Github repos"
53
59
  option :old_name, type: :string, required: true, desc: "Current label name which needs to be updated"
54
60
  option :new_name, type: :string, required: true, desc: "New name for the updated label"
55
61
  def update
56
- Update.new(options[:apps], options[:old_name], options[:new_name], options[:sandbox]).run
62
+ Update.new(
63
+ options[:apps], options[:old_name], options[:new_name], options[:sandbox],
64
+ options[:all_neeto_repos]).run
57
65
  end
58
66
  end
59
67
  end
@@ -9,17 +9,19 @@ module Neetob
9
9
  module Github
10
10
  module Labels
11
11
  class Delete < Base
12
- attr_accessor :apps, :sandbox, :labels
12
+ attr_accessor :apps, :sandbox, :labels, :all_neeto_repos
13
13
 
14
- def initialize(apps, labels, sandbox = false)
14
+ def initialize(apps, labels, sandbox = false, all_neeto_repos = false)
15
15
  super()
16
16
  @labels = labels
17
17
  @apps = apps
18
18
  @sandbox = sandbox
19
+ @all_neeto_repos = all_neeto_repos
19
20
  end
20
21
 
21
22
  def run
22
- matching_apps = find_all_matching_apps(apps, :github, sandbox)
23
+ check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
24
+ matching_apps = find_all_matching_apps(apps, :github, sandbox, false, all_neeto_repos)
23
25
  matching_apps.each do |app|
24
26
  ui.info("\n Deleting labels from #{app} repo \n")
25
27
  labels.each do |label|
@@ -9,16 +9,18 @@ module Neetob
9
9
  module Github
10
10
  module Labels
11
11
  class DeleteAll < Base
12
- attr_accessor :apps, :sandbox
12
+ attr_accessor :apps, :sandbox, :all_neeto_repos
13
13
 
14
- def initialize(apps, sandbox = false)
14
+ def initialize(apps, sandbox = false, all_neeto_repos = false)
15
15
  super()
16
16
  @apps = apps
17
17
  @sandbox = sandbox
18
+ @all_neeto_repos = all_neeto_repos
18
19
  end
19
20
 
20
21
  def run
21
- matching_apps = find_all_matching_apps(apps, :github, sandbox)
22
+ check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
23
+ matching_apps = find_all_matching_apps(apps, :github, sandbox, false, all_neeto_repos)
22
24
  matching_apps.each do |app|
23
25
  ui.info("\n Working on #{app} repo \n")
24
26
  begin
@@ -9,16 +9,18 @@ module Neetob
9
9
  module Github
10
10
  module Labels
11
11
  class List < Base
12
- attr_accessor :apps, :sandbox
12
+ attr_accessor :apps, :sandbox, :all_neeto_repos
13
13
 
14
- def initialize(apps, sandbox = false)
14
+ def initialize(apps, sandbox = false, all_neeto_repos = false)
15
15
  super()
16
16
  @apps = apps
17
17
  @sandbox = sandbox
18
+ @all_neeto_repos = all_neeto_repos
18
19
  end
19
20
 
20
21
  def run
21
- matching_apps = find_all_matching_apps(apps, :github, sandbox)
22
+ check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
23
+ matching_apps = find_all_matching_apps(apps, :github, sandbox, false, all_neeto_repos)
22
24
  matching_apps.each do |app|
23
25
  ui.info("\n Labels of #{app} \n")
24
26
  begin