neetob 0.4.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a0657b62734699934769a7e533576814055ea5221ef854e3addd5c76915635c
4
- data.tar.gz: 230107c6ff888b7d8c666aea78243637bd7747ba2ab741e59527ad1528b9a7c3
3
+ metadata.gz: ebb57b0b47cb37a66163c3f96c333379baaed5d0bfcded23e28dcbcfe5040862
4
+ data.tar.gz: 9edb8a2330e9f1f3db1f9ad270c329f8b4cfe2ef67f9ff8d49598ca5ab3c82fe
5
5
  SHA512:
6
- metadata.gz: ebdb1be1339eb0ac7ae8929f8da953038c00f07aece1d39095a6cac0b7af7a0d42da21a7140fe4b5c18ec96c18269f8d6667005f0396bc6f64031b364cbf153c
7
- data.tar.gz: eae36243252b3cd4fa34cada869589339b799a6f59a1b0e0ca463094bc4ede4769daf535c0b7fb8fba0721cadd7090acc971fc9e1e3711dc4a0d3c71a9c2d378
6
+ metadata.gz: c3a3f3d127543236625384f4d8656ddcf0034cd546153ea230274b3f31044542662bf978ccfd9b9cee0706333985272be3470ed420e497a2203a8905fda23c86
7
+ data.tar.gz: 18bcc76972590fe942c543860c8a3890b625cad999c9eccf6addc6594113f2a75e19cb1ef66f74f7f4493d0c213cb8ad7e20b0081ecb1ec535c46aba622ef0ab
@@ -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.4](https://www.github.com/bigbinary/neetob/compare/v0.4.3...v0.4.4) (2023-05-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Added support for nanos mono repos ([#262](https://www.github.com/bigbinary/neetob/issues/262)) ([fd3f749](https://www.github.com/bigbinary/neetob/commit/fd3f749501a54f78e356b69e92b67771753bcac0))
9
+
10
+ ### [0.4.3](https://www.github.com/bigbinary/neetob/compare/v0.4.2...v0.4.3) (2023-04-25)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Added frontend packages option for make-pr command ([#255](https://www.github.com/bigbinary/neetob/issues/255)) ([a884e24](https://www.github.com/bigbinary/neetob/commit/a884e24a5160ba28cae90ba73e9a4853587be4e6))
16
+
3
17
  ### [0.4.2](https://www.github.com/bigbinary/neetob/compare/v0.4.1...v0.4.2) (2023-04-14)
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.2)
4
+ neetob (0.4.4)
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.1)
16
+ neeto-compliance (1.0.59)
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. [Protect Branch](#protect-branch)
16
- 5. [Make PR](#make-pr)
17
- 6. [Gems](#gems)
18
- 7. [Login](#login)
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 local Repos](#working-with-local-repos)
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
- 8. [Testing](docs/testing.md)
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.
@@ -228,6 +243,10 @@ neetob github make-pr compliance-fix --nanos
228
243
  # The `script` command runs the given script for each product and create a PR
229
244
  neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
230
245
  --title "PR title" --description "PR description"
246
+
247
+ # Create PRs using script in neeto frontend packages
248
+ neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
249
+ --title "PR title" --description "PR description" --frontend-packages
231
250
  ```
232
251
 
233
252
  ### Gems
@@ -410,6 +429,19 @@ neeto-desk-web
410
429
  neeto-kb-web
411
430
  ```
412
431
 
432
+ ## Working with neeto Repos
433
+
434
+ The `code` command interacts with the remote neeto repos.
435
+
436
+ ### Audit
437
+
438
+ The `audit` command checks and lists all tables not using `uuid` as it's Primary key.
439
+
440
+ ```sh
441
+ # Run command on all neeto repos by passing the value `all` to`--apps` option
442
+ neetob code audit --apps "neeto-*-web"
443
+ ```
444
+
413
445
  ## Working with local Repos
414
446
 
415
447
  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
@@ -97,8 +97,13 @@ 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
+
104
+ def find_all_matching_frontend_packages(packages = ["*"])
105
+ all_available_packages = NeetoCompliance::NeetoRepos.nanos_frontend
106
+ match_apps(packages || ["*"], all_available_packages)
107
+ end
103
108
  end
104
109
  end
@@ -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
@@ -78,6 +78,14 @@ module Neetob
78
78
  def add_org_suffix(repos)
79
79
  repos.map { |repo| "bigbinary/#{repo}" }
80
80
  end
81
+
82
+ def build_matching_repos_list(should_fix_nanos, should_fix_frontend_packages = false)
83
+ return add_org_suffix(find_all_matching_gems) if should_fix_nanos
84
+
85
+ return add_org_suffix(find_all_matching_frontend_packages) if should_fix_frontend_packages
86
+
87
+ find_all_matching_apps_or_repos(repos, :github, sandbox)
88
+ end
81
89
  end
82
90
  end
83
91
  end
@@ -27,10 +27,11 @@ module Neetob
27
27
  option :title, type: :string, aliases: "-t", desc: "Title for the PR"
28
28
  option :branch, type: :string, aliases: "-b", desc: "Feature branch name for the PR"
29
29
  option :description, type: :string, aliases: "-d", desc: "Description of the PR"
30
+ option :frontend_packages, type: :boolean, aliases: "-f", default: false, desc: "Use this flag to make PRs for the neeto frontend packages"
30
31
  def script
31
32
  Script.new(
32
33
  options[:repos], options[:path], options[:title], options[:branch], options[:description],
33
- options[:nanos], options[:sandbox]).run
34
+ options[:nanos], options[:frontend_packages], options[:sandbox]).run
34
35
  end
35
36
  end
36
37
  end
@@ -20,9 +20,7 @@ module Neetob
20
20
  end
21
21
 
22
22
  def run
23
- matching_repos = should_fix_nanos ?
24
- add_org_suffix(find_all_matching_gems) :
25
- find_all_matching_apps_or_repos(repos, :github, sandbox)
23
+ matching_repos = build_matching_repos_list(should_fix_nanos)
26
24
  @failed_repos = matching_repos.clone
27
25
  delete_and_create_temp_neetob_dir
28
26
  matching_repos.each do |repo|
@@ -9,22 +9,22 @@ module Neetob
9
9
  module Github
10
10
  module MakePr
11
11
  class Script < Base
12
- attr_accessor :repos, :sandbox, :path_to_the_script_file, :pr_description, :should_fix_nanos
12
+ attr_accessor :repos, :sandbox, :path_to_the_script_file, :pr_description, :should_fix_nanos,
13
+ :should_fix_frontend_packages
13
14
 
14
15
  def initialize(repos, path_to_the_script_file, pr_title,
15
- branch_name, pr_description, should_fix_nanos, sandbox = false)
16
+ branch_name, pr_description, should_fix_nanos, should_fix_frontend_packages = false, sandbox = false)
16
17
  super(pr_title, branch_name)
17
18
  @repos = repos
18
19
  @sandbox = sandbox
19
20
  @path_to_the_script_file = path_to_the_script_file
20
21
  @pr_description = pr_description
21
22
  @should_fix_nanos = should_fix_nanos
23
+ @should_fix_frontend_packages = should_fix_frontend_packages
22
24
  end
23
25
 
24
26
  def run
25
- matching_repos = should_fix_nanos ?
26
- add_org_suffix(find_all_matching_gems) :
27
- find_all_matching_apps_or_repos(repos, :github, sandbox)
27
+ matching_repos = build_matching_repos_list(should_fix_nanos, should_fix_frontend_packages)
28
28
  delete_and_create_temp_neetob_dir
29
29
  matching_repos.each do |repo|
30
30
  ui.info("\n Working on #{repo} \n")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.4"
5
5
  end
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.2
4
+ version: 0.4.4
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-04-14 00:00:00.000000000 Z
11
+ date: 2023-05-25 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"