neetob 0.1.2 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/.semaphore/semaphore.yml +4 -5
- data/CHANGELOG.md +21 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +15 -1
- data/README.md +197 -118
- data/bookmarks.md +30 -0
- data/data/branch-protection-rules.json +1 -1
- data/data/github-labels.json +54 -29
- data/images/commit-message-update.png +0 -0
- data/lib/neetob/cli/base.rb +22 -10
- data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -3
- data/lib/neetob/cli/github/auth.rb +3 -3
- data/lib/neetob/cli/github/base.rb +7 -0
- data/lib/neetob/cli/github/commands.rb +6 -2
- data/lib/neetob/cli/github/labels/commands.rb +18 -10
- data/lib/neetob/cli/github/labels/delete.rb +5 -3
- data/lib/neetob/cli/github/labels/delete_all.rb +5 -3
- data/lib/neetob/cli/github/labels/list.rb +5 -3
- data/lib/neetob/cli/github/labels/show.rb +5 -3
- data/lib/neetob/cli/github/labels/update.rb +16 -4
- data/lib/neetob/cli/github/labels/upsert.rb +43 -7
- data/lib/neetob/cli/github/make_pr/base.rb +2 -1
- data/lib/neetob/cli/github/make_pr/commands.rb +4 -1
- data/lib/neetob/cli/github/make_pr/compliance_fix.rb +6 -1
- data/lib/neetob/cli/github/make_pr/script.rb +4 -3
- data/lib/neetob/cli/github/protect_branch.rb +5 -3
- data/lib/neetob/cli/heroku/config_vars/upsert.rb +6 -2
- data/lib/neetob/cli/heroku/execute.rb +2 -2
- data/lib/neetob/cli/ui.rb +1 -1
- data/lib/neetob/cli/users/commands.rb +3 -1
- data/lib/neetob/cli/users/commits.rb +71 -22
- data/lib/neetob/cli.rb +3 -1
- data/lib/neetob/exception_handler.rb +3 -1
- data/lib/neetob/version.rb +1 -1
- data/neetob.gemspec +1 -1
- metadata +8 -57
- data/LICENSE.txt +0 -21
- data/env.sample +0 -1
- data/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
- data/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
- data/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
- data/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
- data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
- data/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
- data/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
- data/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
- data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
- data/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
- data/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
- data/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
- data/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
- data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
- data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
- data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
- data/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
- data/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
- data/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
- data/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
- data/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
- data/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
- data/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
- data/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
- data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
- data/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
- data/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
- data/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 641eee79e8d05537132030cc9db2ca8d4a57e60e480552dcb1a904fd00e542f5
|
4
|
+
data.tar.gz: a4c674222429b42cff84e1eeb7a66212b32da60f4248a36a4dae5b03439cc649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57951a8d15b4514b7468b7994094c42ff8b0786f6dee034091db26b71d909094c90235855f208a1b1bbc1cc4125add4a53afb6869e82e255baadbe22846220a7
|
7
|
+
data.tar.gz: e47da7744b3a4d92aa23881673f88d6cd9e1b795d92ddb67d0be5676229b82ea194b43125d0f8904bbf009c054f52884d1e5e43e2ecdff4d06eccea9e6bf227b
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.3
|
data/.semaphore/semaphore.yml
CHANGED
@@ -9,7 +9,7 @@ global_job_config:
|
|
9
9
|
prologue:
|
10
10
|
commands:
|
11
11
|
- checkout
|
12
|
-
- sem-version ruby 3.
|
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:
|
24
|
+
- name: Linters | Tests
|
25
25
|
task:
|
26
26
|
jobs:
|
27
|
-
- name:
|
27
|
+
- name: Checks
|
28
28
|
commands:
|
29
|
-
-
|
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.
|
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
|
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. [
|
8
|
-
1. [
|
9
|
-
2. [
|
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. [
|
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
|
-
##
|
30
|
+
## Usage
|
30
31
|
|
31
|
-
###
|
32
|
+
### Installing neetob for use
|
32
33
|
|
33
|
-
|
34
|
+
Install and update the gem using the following command:
|
34
35
|
|
35
36
|
```sh
|
36
|
-
|
37
|
+
gem install neetob && gem update neetob
|
37
38
|
```
|
38
39
|
|
39
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
#
|
96
|
-
neetob github issues list --count --state open --assignee none --apps "neeto-*-
|
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
|
-
#
|
99
|
-
neetob github issues list --count --label bug --state open --assignee none
|
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
|
162
|
+
The `labels` command provides an interface for interacting with Github labels.
|
105
163
|
|
106
164
|
```sh
|
107
|
-
#
|
108
|
-
neetob github labels list --apps "neeto-*-
|
165
|
+
# Lists the details of all the labels in the Github repo
|
166
|
+
neetob github labels list --apps "neeto-*-staging"
|
109
167
|
|
110
|
-
#
|
111
|
-
neetob github labels show --name priority --apps "neeto-*-
|
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
|
-
#
|
171
|
+
# Changes the name of the label
|
114
172
|
neetob github labels update --old-name "High Priority" --new-name \
|
115
|
-
"high-priority" --
|
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
|
-
#
|
118
|
-
|
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
|
-
#
|
122
|
-
|
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
|
-
#
|
186
|
+
# Deletes the given labels from the Github repos
|
125
187
|
neetob github labels delete --labels "High Priority" "Priority 1" "bug" \
|
126
|
-
--apps neeto
|
188
|
+
--apps "neeto-*-staging"
|
127
189
|
|
128
|
-
#
|
129
|
-
neetob github labels delete_all --apps neeto
|
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
|
-
|
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-*-
|
212
|
+
neetob github search --keyword neeto --path README.md --apps "neeto-*-staging"
|
140
213
|
```
|
141
214
|
|
142
215
|
### Protect branch
|
143
216
|
|
144
|
-
|
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
|
220
|
+
neetob github protect_branch --branch main --apps "neeto-*-staging"
|
148
221
|
```
|
149
222
|
|
150
|
-
By default,
|
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
|
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
|
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
|
256
|
+
The `make-pr` command creates pull requests across Github repos.
|
175
257
|
|
176
258
|
```sh
|
177
|
-
# The `compliance-fix` command
|
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
|
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
|
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-*-
|
289
|
+
# The `list` command lists all the Heroku config variables
|
290
|
+
neetob heroku config_vars list --apps "neeto-*-staging"
|
208
291
|
|
209
|
-
#
|
210
|
-
neetob heroku config_vars list --apps "neeto-*-
|
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
|
-
#
|
213
|
-
# Checkout the `data/config-vars-list.json` file for the required structure
|
214
|
-
neetob heroku config_vars list --apps "neeto-*-
|
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
|
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-*-
|
302
|
+
# installed `neetob` gem
|
303
|
+
neetob heroku config_vars audit --apps "neeto-*-staging"
|
221
304
|
|
222
|
-
# The `audit` command
|
223
|
-
neetob heroku config_vars audit --path ~/Desktop/config.json --apps "neeto-*-
|
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
|
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
|
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
|
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
|
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
|
-
|
360
|
+
The `access` command list, add and remove users from multiple Heroku apps.
|
278
361
|
|
279
362
|
```sh
|
280
|
-
#
|
281
|
-
neetob heroku access list --apps "neeto-*-
|
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
|
-
|
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
|
-
#
|
297
|
-
neetob heroku execute -c "heroku access" --apps "neeto-*-
|
379
|
+
# Execute Heroku CLI command
|
380
|
+
neetob heroku execute -c "heroku access" --apps "neeto-*-staging"
|
298
381
|
|
299
|
-
#
|
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
|
-
|
389
|
+
The `users` command interacts with the contributors of neeto applications.
|
307
390
|
|
308
391
|
### Audit
|
309
392
|
|
310
|
-
The `audit` command
|
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
|
-
|
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
|
-
#
|
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
|
-
##
|
416
|
+
## Make Repos Uptodate
|
336
417
|
|
337
|
-
|
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
|
-
|
437
|
+
The `local` command interacts with the local neeto repos.
|
355
438
|
|
356
439
|
### ls
|
357
440
|
|
358
|
-
The `ls` command
|
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
|
-
#
|
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
|
-
#
|
368
|
-
|
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
|
-
#
|
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.
|