neetob 0.1.5 → 0.2.0
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/CHANGELOG.md +7 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -2
- data/README.md +18 -2
- data/lib/neetob/cli/base.rb +5 -0
- data/lib/neetob/cli/github/commands.rb +4 -0
- data/lib/neetob/cli/github/gems/commands.rb +22 -0
- data/lib/neetob/cli/github/gems/release.rb +52 -0
- data/lib/neetob/cli/github/make_pr/base.rb +4 -0
- data/lib/neetob/cli/github/make_pr/commands.rb +6 -7
- data/lib/neetob/cli/github/make_pr/compliance_fix.rb +7 -4
- data/lib/neetob/cli/github/make_pr/script.rb +7 -3
- data/lib/neetob/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db01d1b2016e6c59d67ae056f53722b919ff42d02a90cad6870c2899dff4936f
|
4
|
+
data.tar.gz: e7f7f4d09faa15c778012285c6db15cc257b588951b8b2fdd1946b305131dd75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e004714a7fc30663a27cdd3c1a0268a6b33ad54476724897a40b10425fa36cedcafb62435a4a97bd8701ec594701b159e60717839b6a20126105777375c1cc55
|
7
|
+
data.tar.gz: 373e1262f481fa4a0a5126c15c75ff188830723def4273713710e122df18ecf3df8487075733db6af94ab30b62959dcc3e50b43c4694a5199807d13817f124ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.0](https://www.github.com/bigbinary/neetob/compare/v0.1.5...v0.2.0) (2023-03-01)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* Added release gems command ([#188](https://www.github.com/bigbinary/neetob/issues/188)) ([0485cb1](https://www.github.com/bigbinary/neetob/commit/0485cb11e4f13d5eb4f6b7439d34725f509c482d))
|
9
|
+
|
3
10
|
### [0.1.5](https://www.github.com/bigbinary/neetob/compare/v0.1.4...v0.1.5) (2023-03-01)
|
4
11
|
|
5
12
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neetob (0.
|
4
|
+
neetob (0.2.0)
|
5
5
|
dotenv (~> 2.8.1)
|
6
6
|
launchy (~> 2.5.0)
|
7
7
|
octokit (~> 4.0)
|
@@ -107,6 +107,7 @@ GEM
|
|
107
107
|
faraday-net_http (3.0.2)
|
108
108
|
faraday-retry (2.0.0)
|
109
109
|
faraday (~> 2.0)
|
110
|
+
fury (0.0.1)
|
110
111
|
globalid (1.0.1)
|
111
112
|
activesupport (>= 5.0)
|
112
113
|
hashdiff (1.0.1)
|
@@ -245,6 +246,7 @@ DEPENDENCIES
|
|
245
246
|
chronic
|
246
247
|
dotenv (~> 2.8.1)
|
247
248
|
faraday-retry
|
249
|
+
fury
|
248
250
|
minitest (~> 5.0)
|
249
251
|
minitest-reporters
|
250
252
|
mocha
|
@@ -260,4 +262,4 @@ DEPENDENCIES
|
|
260
262
|
webmock
|
261
263
|
|
262
264
|
BUNDLED WITH
|
263
|
-
2.
|
265
|
+
2.4.7
|
data/README.md
CHANGED
@@ -14,8 +14,9 @@ The `neetob` gem gives different commands for interacting with Github repos, Her
|
|
14
14
|
3. [Search](#search)
|
15
15
|
4. [Protect Branch](#protect-branch)
|
16
16
|
5. [Make PR](#make-pr)
|
17
|
-
6. [
|
18
|
-
|
17
|
+
6. [Gems](#gems)
|
18
|
+
7. [Login](#login)
|
19
|
+
5. [Working with Heroku](#working-with-heroku)
|
19
20
|
1. [Config Vars](#config-vars)
|
20
21
|
2. [Access](#access)
|
21
22
|
3. [Execute](#execute)
|
@@ -260,11 +261,26 @@ The `make-pr` command creates pull requests across Github repos.
|
|
260
261
|
# `bundle exec neeto-audit -a` inside all repos and create a PR.
|
261
262
|
neetob github make-pr compliance-fix
|
262
263
|
|
264
|
+
# Fix compliance for nanos
|
265
|
+
neetob github make-pr compliance-fix --nanos
|
266
|
+
|
263
267
|
# The `script` command runs the given script for each product and create a PR
|
264
268
|
neetob github make-pr script --path ~/Desktop/fix-folders.sh --branch "neetob-test" \
|
265
269
|
--title "PR title" --description "PR description"
|
266
270
|
```
|
267
271
|
|
272
|
+
### Gems
|
273
|
+
|
274
|
+
The `gems release` command releases the lastest gem for all neeto nanos.
|
275
|
+
|
276
|
+
```sh
|
277
|
+
# Releases the latest gem for all nanos
|
278
|
+
neetob github gems release
|
279
|
+
|
280
|
+
# Releases the latest gem for given nanos
|
281
|
+
neetob github gems release --nanos neeto-monitor-ruby neeto-bugtrap-ruby
|
282
|
+
```
|
283
|
+
|
268
284
|
### Login
|
269
285
|
|
270
286
|
Authenticate through your browser and update your Github access token by utilizing the `login` command.
|
data/lib/neetob/cli/base.rb
CHANGED
@@ -93,5 +93,10 @@ module Neetob
|
|
93
93
|
NeetoCompliance::NeetoRepos::mobile_apps +
|
94
94
|
NeetoCompliance::NeetoRepos::other_repos
|
95
95
|
end
|
96
|
+
|
97
|
+
def find_all_matching_gems(gems = ["*"])
|
98
|
+
all_available_gems = NeetoCompliance::NeetoRepos.nanos_backend
|
99
|
+
match_apps(gems || ["*"], all_available_gems)
|
100
|
+
end
|
96
101
|
end
|
97
102
|
end
|
@@ -7,6 +7,7 @@ require_relative "search"
|
|
7
7
|
require_relative "protect_branch"
|
8
8
|
require_relative "login"
|
9
9
|
require_relative "make_pr/commands"
|
10
|
+
require_relative "gems/commands"
|
10
11
|
|
11
12
|
module Neetob
|
12
13
|
class CLI
|
@@ -21,6 +22,9 @@ module Neetob
|
|
21
22
|
desc "make-pr", "Create PRs across multiple Github repos"
|
22
23
|
subcommand "make_pr", MakePr::Commands
|
23
24
|
|
25
|
+
desc "gems", "Interact with the neeto gems"
|
26
|
+
subcommand "gems", Gems::Commands
|
27
|
+
|
24
28
|
desc "search", "Find the lines matching the given keyword in the specified file across all the neeto apps"
|
25
29
|
option :apps, type: :array, aliases: "-a", required: true, desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
|
26
30
|
option :keyword, type: :string, aliases: "-k", desc: "Keyword which needs to be searched", required: true
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
|
5
|
+
require_relative "release"
|
6
|
+
require_relative "../../sub_command_base"
|
7
|
+
|
8
|
+
module Neetob
|
9
|
+
class CLI
|
10
|
+
module Github
|
11
|
+
module Gems
|
12
|
+
class Commands < SubCommandBase
|
13
|
+
desc "release", "Release all the neeto nanos"
|
14
|
+
option :nanos, type: :array, aliases: "-n", desc: "List of nanos you want to release"
|
15
|
+
def release
|
16
|
+
Release.new(options[:nanos], options[:sandbox]).run
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
|
5
|
+
require_relative "../make_pr/base"
|
6
|
+
|
7
|
+
module Neetob
|
8
|
+
class CLI
|
9
|
+
module Github
|
10
|
+
module Gems
|
11
|
+
class Release < MakePr::Base
|
12
|
+
attr_accessor :gems, :sandbox
|
13
|
+
|
14
|
+
def initialize(gems, sandbox = false)
|
15
|
+
super()
|
16
|
+
@gems = gems
|
17
|
+
@sandbox = sandbox
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
matching_gems = find_all_matching_gems(gems)
|
22
|
+
delete_and_create_temp_neetob_dir
|
23
|
+
matching_gems.each do |gem|
|
24
|
+
ui.info("\nWorking on #{gem}\n")
|
25
|
+
begin
|
26
|
+
clone_app_in_tmp_dir("bigbinary/#{gem}")
|
27
|
+
build_gem(gem)
|
28
|
+
release_gem(gem)
|
29
|
+
if $?.success?
|
30
|
+
ui.success("Gem \"#{gem}\" released successfully")
|
31
|
+
end
|
32
|
+
rescue StandardError => e
|
33
|
+
ExceptionHandler.new(e).process
|
34
|
+
end
|
35
|
+
end
|
36
|
+
`rm -rf /tmp/neetob`
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def build_gem(gem)
|
42
|
+
ui.info(`#{cd_to_app_in_tmp_dir(gem)} && gem build`)
|
43
|
+
end
|
44
|
+
|
45
|
+
def release_gem(gem)
|
46
|
+
ui.info(`#{cd_to_app_in_tmp_dir(gem)} && fury push #{gem}-*.gem --as unnitallman`)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -11,15 +11,14 @@ module Neetob
|
|
11
11
|
module Github
|
12
12
|
module MakePr
|
13
13
|
class Commands < SubCommandBase
|
14
|
-
class_option :apps,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
14
|
+
class_option :apps, type: :array, aliases: "-a", default: ["*"],
|
15
|
+
desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
|
16
|
+
class_option :nanos, type: :boolean, aliases: "-n", default: false,
|
17
|
+
desc: "Use this flag to make PRs for the neeto gems"
|
19
18
|
|
20
19
|
desc "compliance-fix", "Create PRs for fixing neeto compliance in all products"
|
21
20
|
def compliance_fix
|
22
|
-
ComplianceFix.new(options[:apps], options[:sandbox]).run
|
21
|
+
ComplianceFix.new(options[:apps], options[:nanos], options[:sandbox]).run
|
23
22
|
end
|
24
23
|
|
25
24
|
desc "script", "Create PRs after running the given script for each product."
|
@@ -30,7 +29,7 @@ module Neetob
|
|
30
29
|
option :description, type: :string, aliases: "-d", desc: "Description of the PR"
|
31
30
|
def script
|
32
31
|
Script.new(
|
33
|
-
options[:apps], options[:path], options[:title], options[:branch], options[:description],
|
32
|
+
options[:apps], options[:path], options[:title], options[:branch], options[:description], options[:nanos],
|
34
33
|
options[:sandbox]).run
|
35
34
|
end
|
36
35
|
end
|
@@ -9,19 +9,22 @@ module Neetob
|
|
9
9
|
module Github
|
10
10
|
module MakePr
|
11
11
|
class ComplianceFix < Base
|
12
|
-
attr_accessor :apps, :sandbox
|
12
|
+
attr_accessor :apps, :sandbox, :should_fix_nanos
|
13
13
|
|
14
|
-
def initialize(apps, sandbox = false)
|
14
|
+
def initialize(apps, should_fix_nanos = false, sandbox = false)
|
15
15
|
super()
|
16
16
|
@apps = apps
|
17
17
|
@sandbox = sandbox
|
18
|
+
@should_fix_nanos = should_fix_nanos
|
18
19
|
end
|
19
20
|
|
20
21
|
def run
|
21
|
-
matching_apps =
|
22
|
+
matching_apps = should_fix_nanos ?
|
23
|
+
add_org_suffix(find_all_matching_gems) :
|
24
|
+
find_all_matching_apps(apps, :github, sandbox)
|
22
25
|
delete_and_create_temp_neetob_dir
|
23
26
|
matching_apps.each do |app|
|
24
|
-
ui.info("\
|
27
|
+
ui.info("\nWorking on #{app}\n")
|
25
28
|
begin
|
26
29
|
clone_app_in_tmp_dir(app)
|
27
30
|
check_and_delete_remote_branch(app)
|
@@ -9,18 +9,22 @@ module Neetob
|
|
9
9
|
module Github
|
10
10
|
module MakePr
|
11
11
|
class Script < Base
|
12
|
-
attr_accessor :apps, :sandbox, :path_to_the_script_file, :pr_description
|
12
|
+
attr_accessor :apps, :sandbox, :path_to_the_script_file, :pr_description, :should_fix_nanos
|
13
13
|
|
14
|
-
def initialize(apps, path_to_the_script_file, pr_title,
|
14
|
+
def initialize(apps, path_to_the_script_file, pr_title,
|
15
|
+
branch_name, pr_description, should_fix_nanos, sandbox = false)
|
15
16
|
super(pr_title, branch_name)
|
16
17
|
@apps = apps
|
17
18
|
@sandbox = sandbox
|
18
19
|
@path_to_the_script_file = path_to_the_script_file
|
19
20
|
@pr_description = pr_description
|
21
|
+
@should_fix_nanos = should_fix_nanos
|
20
22
|
end
|
21
23
|
|
22
24
|
def run
|
23
|
-
matching_apps =
|
25
|
+
matching_apps = should_fix_nanos ?
|
26
|
+
add_org_suffix(find_all_matching_gems) :
|
27
|
+
find_all_matching_apps(apps, :github, sandbox)
|
24
28
|
delete_and_create_temp_neetob_dir
|
25
29
|
matching_apps.each do |app|
|
26
30
|
ui.info("\n Working on #{app} \n")
|
data/lib/neetob/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neetob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Udai Gupta
|
@@ -116,6 +116,8 @@ files:
|
|
116
116
|
- lib/neetob/cli/github/auth.rb
|
117
117
|
- lib/neetob/cli/github/base.rb
|
118
118
|
- lib/neetob/cli/github/commands.rb
|
119
|
+
- lib/neetob/cli/github/gems/commands.rb
|
120
|
+
- lib/neetob/cli/github/gems/release.rb
|
119
121
|
- lib/neetob/cli/github/issues/commands.rb
|
120
122
|
- lib/neetob/cli/github/issues/create.rb
|
121
123
|
- lib/neetob/cli/github/issues/list.rb
|