neetob 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.neetoci/neetoci.yml +15 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +4 -2
- data/README.md +37 -6
- data/bookmarks.md +6 -0
- data/lib/neetob/cli/base.rb +2 -2
- data/lib/neetob/cli/github/brakeman.rb +1 -1
- data/lib/neetob/cli/github/make_pr/commands.rb +4 -2
- data/lib/neetob/cli/github/make_pr/compliance_fix.rb +4 -2
- data/lib/neetob/cli/github/make_pr/script.rb +6 -3
- data/lib/neetob/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 606aa096ff45c6dd1024738a608b607608baf9a9d9cb62111722c89c4fd30887
|
|
4
|
+
data.tar.gz: ba0fdbae18b2d77a9a6bbc6f99e2d8eeb4b455656e8a657f7b463a6873128590
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10a7ee29781e225be76678b8be259a3fdc0cd2decad3209e3ab43daa5405b00bc07fcda651a6cb167a2b58e851c7862993b1c96edc39547745165a5fd61137b3
|
|
7
|
+
data.tar.gz: f2d96ae3df227be16d29e660cf142df9c9aa5535799072922a4a0f9f29d23935e0085a3da6d08acfe796acef9508220920257d610b685bfaa79e9a2071ad74d0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: v1.0
|
|
2
|
+
name: neetob
|
|
3
|
+
global_job_config:
|
|
4
|
+
setup:
|
|
5
|
+
- checkout
|
|
6
|
+
- neetoci-version ruby 3.1.3
|
|
7
|
+
- bundle config path 'vendor/bundle'
|
|
8
|
+
- cache restore
|
|
9
|
+
- bundle install --jobs 1
|
|
10
|
+
- cache store
|
|
11
|
+
jobs:
|
|
12
|
+
- name: CiChecks
|
|
13
|
+
commands:
|
|
14
|
+
- bundle exec rubocop
|
|
15
|
+
- bundle exec rake test
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### [0.4.5](https://www.github.com/bigbinary/neetob/compare/v0.4.4...v0.4.5) (2023-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Updated make pr command to accept labels ([#265](https://www.github.com/bigbinary/neetob/issues/265)) ([d2b2315](https://www.github.com/bigbinary/neetob/commit/d2b23158a82570168974d5b4f42ebcda1689f994))
|
|
9
|
+
|
|
10
|
+
### [0.4.4](https://www.github.com/bigbinary/neetob/compare/v0.4.3...v0.4.4) (2023-05-24)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Added support for nanos mono repos ([#262](https://www.github.com/bigbinary/neetob/issues/262)) ([fd3f749](https://www.github.com/bigbinary/neetob/commit/fd3f749501a54f78e356b69e92b67771753bcac0))
|
|
16
|
+
|
|
3
17
|
### [0.4.3](https://www.github.com/bigbinary/neetob/compare/v0.4.2...v0.4.3) (2023-04-25)
|
|
4
18
|
|
|
5
19
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
neetob (0.4.
|
|
4
|
+
neetob (0.4.5)
|
|
5
5
|
brakeman (~> 5.0)
|
|
6
6
|
chronic
|
|
7
7
|
dotenv (~> 2.8.1)
|
|
@@ -13,8 +13,9 @@ PATH
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com/
|
|
15
15
|
specs:
|
|
16
|
-
neeto-compliance (1.0.
|
|
16
|
+
neeto-compliance (1.0.68)
|
|
17
17
|
colorize
|
|
18
|
+
deep_merge
|
|
18
19
|
hashdiff
|
|
19
20
|
json (~> 2.6.2)
|
|
20
21
|
|
|
@@ -101,6 +102,7 @@ GEM
|
|
|
101
102
|
crack (0.4.5)
|
|
102
103
|
rexml
|
|
103
104
|
crass (1.0.6)
|
|
105
|
+
deep_merge (1.2.2)
|
|
104
106
|
docile (1.4.0)
|
|
105
107
|
dotenv (2.8.1)
|
|
106
108
|
erubi (1.11.0)
|
data/README.md
CHANGED
|
@@ -12,10 +12,11 @@ The `neetob` gem gives a different set of commands for interacting with Github r
|
|
|
12
12
|
1. [Issues](#issues)
|
|
13
13
|
2. [Labels](#labels)
|
|
14
14
|
3. [Search](#search)
|
|
15
|
-
4. [
|
|
16
|
-
5. [
|
|
17
|
-
6. [
|
|
18
|
-
7. [
|
|
15
|
+
4. [Brakeman](#brakeman)
|
|
16
|
+
5. [Protect Branch](#protect-branch)
|
|
17
|
+
6. [Make PR](#make-pr)
|
|
18
|
+
7. [Gems](#gems)
|
|
19
|
+
8. [Login](#login)
|
|
19
20
|
4. [Working with Heroku](#working-with-heroku)
|
|
20
21
|
1. [Config Vars](#config-vars)
|
|
21
22
|
2. [Access](#access)
|
|
@@ -24,9 +25,11 @@ The `neetob` gem gives a different set of commands for interacting with Github r
|
|
|
24
25
|
1. [Audit](#audit)
|
|
25
26
|
2. [Commits](#commits)
|
|
26
27
|
6. [Make Repos Uptodate](#make-repos-uptodate)
|
|
27
|
-
7. [Working with
|
|
28
|
+
7. [Working with neeto Repos](#working-with-neeto-repos)
|
|
29
|
+
1. [Audit](#audit-1)
|
|
30
|
+
8. [Working with local Repos](#working-with-local-repos)
|
|
28
31
|
1. [ls](#ls)
|
|
29
|
-
|
|
32
|
+
9. [Testing](docs/testing.md)
|
|
30
33
|
|
|
31
34
|
## Usage
|
|
32
35
|
|
|
@@ -107,6 +110,10 @@ neetob github issues list --count --state open --assignee none --repos "neeto-*-
|
|
|
107
110
|
# Lists, counts and filters all unassigned open issues that are labeled as "bug"
|
|
108
111
|
neetob github issues list --count --label bug --state open --assignee none \
|
|
109
112
|
--repos "neeto-*-staging"
|
|
113
|
+
|
|
114
|
+
# Creates an issue in Github repos
|
|
115
|
+
# You will be prompted to enter issue title, description etc.
|
|
116
|
+
neetob github issues create --repos "neeto-*-web"
|
|
110
117
|
```
|
|
111
118
|
|
|
112
119
|
### Labels
|
|
@@ -174,6 +181,14 @@ The above command searches for all occurrences of any word matching the given re
|
|
|
174
181
|
|
|
175
182
|
We can pass the `--replace` option to replace all found instances of the keyword with another word.
|
|
176
183
|
|
|
184
|
+
### Brakeman
|
|
185
|
+
|
|
186
|
+
Run [brakeman](https://brakemanscanner.org/) on neeto repos & create issues wherever any security vulnerabilities are found.
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
neetob github brakeman --repos "neeto-*-web"
|
|
190
|
+
```
|
|
191
|
+
|
|
177
192
|
### Protect branch
|
|
178
193
|
|
|
179
194
|
Updates branch protection rules in neeto repos by using the `protect_branch` command.
|
|
@@ -225,6 +240,9 @@ neetob github make-pr compliance-fix
|
|
|
225
240
|
# Fix compliance for nanos
|
|
226
241
|
neetob github make-pr compliance-fix --nanos
|
|
227
242
|
|
|
243
|
+
# Add labels to PRs
|
|
244
|
+
neetob github make-pr compliance-fix --labels "bug,priority"
|
|
245
|
+
|
|
228
246
|
# The `script` command runs the given script for each product and create a PR
|
|
229
247
|
neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
|
|
230
248
|
--title "PR title" --description "PR description"
|
|
@@ -414,6 +432,19 @@ neeto-desk-web
|
|
|
414
432
|
neeto-kb-web
|
|
415
433
|
```
|
|
416
434
|
|
|
435
|
+
## Working with neeto Repos
|
|
436
|
+
|
|
437
|
+
The `code` command interacts with the remote neeto repos.
|
|
438
|
+
|
|
439
|
+
### Audit
|
|
440
|
+
|
|
441
|
+
The `audit` command checks and lists all tables not using `uuid` as it's Primary key.
|
|
442
|
+
|
|
443
|
+
```sh
|
|
444
|
+
# Run command on all neeto repos by passing the value `all` to`--apps` option
|
|
445
|
+
neetob code audit --apps "neeto-*-web"
|
|
446
|
+
```
|
|
447
|
+
|
|
417
448
|
## Working with local Repos
|
|
418
449
|
|
|
419
450
|
The `local` command interacts with the local neeto repos.
|
data/bookmarks.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
[Engineer needed](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Abigbinary+label%3Aengineer-needed)
|
|
6
6
|
|
|
7
|
+
[Issues across repos in bigbinary account where the last update was done before 1st Jan 2023 excluding repos jacky-winter-web, aceinvoice-web, trtle-rn, trtle-web](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Abigbinary+archived%3Afalse+updated%3A%3C2023-01-01+sort%3Aupdated-asc+-repo%3Abigbinary%2Fjacky-winter-web+-repo%3Abigbinary%2Faceinvoice-web+-repo%3Abigbinary%2Ftrtle-rn+-repo%3Abigbinary%2Ftrtle-web+)
|
|
8
|
+
|
|
9
|
+
[Issues across repos in bigbinary account where the last update was done from 1st Jan 2023 till 1st May 2023 excluding repos jacky-winter-web, aceinvoice-web, trtle-rn, trtle-web](https://github.com/issues?q=+is%3Aopen+is%3Aissue+org%3Abigbinary+archived%3Afalse+updated%3A2023-01-01..2023-04-01+sort%3Aupdated-asc+-repo%3Abigbinary%2Fjacky-winter-web+-repo%3Abigbinary%2Faceinvoice-web+-repo%3Abigbinary%2Ftrtle-rn+-repo%3Abigbinary%2Ftrtle-web+)
|
|
10
|
+
|
|
11
|
+
## Products checlist
|
|
12
|
+
|
|
7
13
|
- [ ] neeto-auth-web
|
|
8
14
|
- [ ] neeto-chat-web
|
|
9
15
|
- [ ] neeto-desk-web
|
data/lib/neetob/cli/base.rb
CHANGED
|
@@ -74,7 +74,7 @@ module Neetob
|
|
|
74
74
|
platform_name == :heroku ? ["neeto-dummy"] : ["bigbinary/neeto-dummy"]
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
def inform_about_current_working_mode(sandbox_mode, quiet)
|
|
77
|
+
def inform_about_current_working_mode(sandbox_mode, quiet = false)
|
|
78
78
|
return if quiet
|
|
79
79
|
|
|
80
80
|
callout_message = "Running in the sandbox mode. \nOnly \"neeto-dummy\" app will be available."
|
|
@@ -97,7 +97,7 @@ module Neetob
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def find_all_matching_gems(gems = ["*"])
|
|
100
|
-
all_available_gems = NeetoCompliance::NeetoRepos.nanos_backend
|
|
100
|
+
all_available_gems = NeetoCompliance::NeetoRepos.nanos_backend + NeetoCompliance::NeetoRepos.nanos_mono_repos
|
|
101
101
|
match_apps(gems || ["*"], all_available_gems)
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -25,7 +25,7 @@ module Neetob
|
|
|
25
25
|
report = run_brakeman(repo)
|
|
26
26
|
ui.success("Successfully executed brakeman for #{repo}")
|
|
27
27
|
warnings = report.split("\n\n== Warnings ==\n\n").last&.split("\n\n")
|
|
28
|
-
if !report.include?("No warnings found")
|
|
28
|
+
if !report.include?("No warnings found") && !report.blank?
|
|
29
29
|
issue = client.create_issue(repo, DESCRIPTION, parse_description(warnings))
|
|
30
30
|
ui.success("Issue created at #{issue.html_url}")
|
|
31
31
|
end
|
|
@@ -15,10 +15,12 @@ module Neetob
|
|
|
15
15
|
desc: "Github repo names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
|
|
16
16
|
class_option :nanos, type: :boolean, aliases: "-n", default: false,
|
|
17
17
|
desc: "Use this flag to make PRs for the neeto gems"
|
|
18
|
+
class_option :labels, type: :string, default: "",
|
|
19
|
+
desc: "Labels you want to add in the PRs. Example: --labels \"bug,priority\""
|
|
18
20
|
|
|
19
21
|
desc "compliance-fix", "Create PRs for fixing neeto compliance in all products"
|
|
20
22
|
def compliance_fix
|
|
21
|
-
ComplianceFix.new(options[:repos], options[:nanos], options[:sandbox]).run
|
|
23
|
+
ComplianceFix.new(options[:repos], options[:nanos], options[:sandbox], options[:labels]).run
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
desc "script", "Create PRs after running the given script for each product."
|
|
@@ -31,7 +33,7 @@ module Neetob
|
|
|
31
33
|
def script
|
|
32
34
|
Script.new(
|
|
33
35
|
options[:repos], options[:path], options[:title], options[:branch], options[:description],
|
|
34
|
-
options[:nanos], options[:frontend_packages], options[:sandbox]).run
|
|
36
|
+
options[:nanos], options[:frontend_packages], options[:sandbox], options[:labels]).run
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
end
|
|
@@ -9,14 +9,15 @@ module Neetob
|
|
|
9
9
|
module Github
|
|
10
10
|
module MakePr
|
|
11
11
|
class ComplianceFix < Base
|
|
12
|
-
attr_accessor :repos, :sandbox, :should_fix_nanos
|
|
12
|
+
attr_accessor :repos, :sandbox, :should_fix_nanos, :labels
|
|
13
13
|
|
|
14
|
-
def initialize(repos, should_fix_nanos = false, sandbox = false)
|
|
14
|
+
def initialize(repos, should_fix_nanos = false, sandbox = false, labels = "")
|
|
15
15
|
super()
|
|
16
16
|
@repos = repos
|
|
17
17
|
@sandbox = sandbox
|
|
18
18
|
@should_fix_nanos = should_fix_nanos
|
|
19
19
|
@failed_repos = []
|
|
20
|
+
@labels = labels
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def run
|
|
@@ -34,6 +35,7 @@ module Neetob
|
|
|
34
35
|
delete_local_feature_branch(repo)
|
|
35
36
|
pull_request = client.create_pull_request(repo, "main", BRANCH_NAME, PR_TITLE)
|
|
36
37
|
ui.success("PR created in \"#{repo}\" project successfully.")
|
|
38
|
+
client.add_labels_to_an_issue(repo, pull_request[:number], labels.split(","))
|
|
37
39
|
@failed_repos.delete(repo)
|
|
38
40
|
rescue StandardError => e
|
|
39
41
|
ExceptionHandler.new(e).process
|
|
@@ -10,10 +10,11 @@ module Neetob
|
|
|
10
10
|
module MakePr
|
|
11
11
|
class Script < Base
|
|
12
12
|
attr_accessor :repos, :sandbox, :path_to_the_script_file, :pr_description, :should_fix_nanos,
|
|
13
|
-
:should_fix_frontend_packages
|
|
13
|
+
:should_fix_frontend_packages, :labels
|
|
14
14
|
|
|
15
15
|
def initialize(repos, path_to_the_script_file, pr_title,
|
|
16
|
-
branch_name, pr_description, should_fix_nanos,
|
|
16
|
+
branch_name, pr_description, should_fix_nanos,
|
|
17
|
+
should_fix_frontend_packages = false, sandbox = false, labels = "")
|
|
17
18
|
super(pr_title, branch_name)
|
|
18
19
|
@repos = repos
|
|
19
20
|
@sandbox = sandbox
|
|
@@ -21,6 +22,7 @@ module Neetob
|
|
|
21
22
|
@pr_description = pr_description
|
|
22
23
|
@should_fix_nanos = should_fix_nanos
|
|
23
24
|
@should_fix_frontend_packages = should_fix_frontend_packages
|
|
25
|
+
@labels = labels
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def run
|
|
@@ -35,8 +37,9 @@ module Neetob
|
|
|
35
37
|
execute_script(repo)
|
|
36
38
|
ui.info(add_commmit_and_push_changes(repo))
|
|
37
39
|
delete_local_feature_branch(repo)
|
|
38
|
-
|
|
40
|
+
pull_request = client.create_pull_request(repo, "main", branch_name, pr_title, pr_description)
|
|
39
41
|
ui.success("PR created in \"#{repo}\" project successfully.")
|
|
42
|
+
client.add_labels_to_an_issue(repo, pull_request[:number], labels.split(","))
|
|
40
43
|
rescue StandardError => e
|
|
41
44
|
ExceptionHandler.new(e).process
|
|
42
45
|
end
|
data/lib/neetob/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neetob
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Udai Gupta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -119,6 +119,7 @@ extra_rdoc_files: []
|
|
|
119
119
|
files:
|
|
120
120
|
- ".editorconfig"
|
|
121
121
|
- ".env"
|
|
122
|
+
- ".neetoci/neetoci.yml"
|
|
122
123
|
- ".rubocop.yml"
|
|
123
124
|
- ".ruby-version"
|
|
124
125
|
- ".semaphore/semaphore.yml"
|