neetob 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +3 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +17 -4
- data/README.md +64 -36
- data/bookmarks.md +5 -0
- data/data/branch-protection-rules.json +1 -1
- data/data/github-labels.json +7 -2
- data/lib/neetob/cli/base.rb +22 -10
- data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -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 +5 -3
- data/lib/neetob/cli/github/labels/upsert.rb +41 -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/users/commands.rb +3 -1
- data/lib/neetob/cli/users/commits.rb +71 -22
- data/lib/neetob/cli.rb +3 -1
- data/lib/neetob/version.rb +1 -1
- data/neetob.gemspec +50 -0
- metadata +7 -56
- data/LICENSE.txt +0 -21
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
- data/Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/version.rb +0 -5
- data/env.sample +0 -1
@@ -1,162 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class SemaphoreciConfigVerifier < Base
|
5
|
-
def local_copy
|
6
|
-
".semaphore/semaphore.yml"
|
7
|
-
end
|
8
|
-
|
9
|
-
def auto_correct!
|
10
|
-
end
|
11
|
-
|
12
|
-
def semaphore_config
|
13
|
-
@_semaphore_config ||= YAML.load(File.open(local_copy).read, aliases: true)
|
14
|
-
end
|
15
|
-
|
16
|
-
def my_container_setup_commands
|
17
|
-
semaphore_config["global_job_config"]["prologue"]["commands"]
|
18
|
-
end
|
19
|
-
|
20
|
-
def my_jobs_config
|
21
|
-
semaphore_config["blocks"].map { |block| block["task"]["jobs"] }
|
22
|
-
end
|
23
|
-
|
24
|
-
def my_env_vars_config
|
25
|
-
semaphore_config["global_job_config"]["env_vars"]
|
26
|
-
end
|
27
|
-
|
28
|
-
def my_after_pipeline_jobs
|
29
|
-
semaphore_config["after_pipeline"]["task"]
|
30
|
-
end
|
31
|
-
|
32
|
-
def my_machine_type
|
33
|
-
semaphore_config["agent"]["machine"]["type"]
|
34
|
-
end
|
35
|
-
|
36
|
-
def machine_type
|
37
|
-
"e1-standard-2"
|
38
|
-
end
|
39
|
-
|
40
|
-
def container_setup_commands
|
41
|
-
[
|
42
|
-
"checkout",
|
43
|
-
"sem-version ruby 3.1.2",
|
44
|
-
"sem-version node 18.12",
|
45
|
-
"sem-service start postgres 13",
|
46
|
-
"sem-service start redis",
|
47
|
-
"bundle config path 'vendor/bundle'",
|
48
|
-
"cp config/database.yml.ci config/database.yml",
|
49
|
-
"bundle install --jobs 1",
|
50
|
-
]
|
51
|
-
end
|
52
|
-
|
53
|
-
def jobs_config
|
54
|
-
[
|
55
|
-
[
|
56
|
-
{
|
57
|
-
"name" => "Checks",
|
58
|
-
"commands" =>
|
59
|
-
[
|
60
|
-
"bundle exec ruby-audit check",
|
61
|
-
"bundle exec rubocop",
|
62
|
-
"bundle exec erblint --lint-all --format compact",
|
63
|
-
"curl -s -L \"https://raw.githubusercontent.com/bigbinary/wheel/main/.semaphore/commands/run_eslint_on_modified_files.sh\" | bash",
|
64
|
-
"bundle exec neeto-audit",
|
65
|
-
"bundle exec rake db:create db:schema:load --trace",
|
66
|
-
"bundle exec rake incinerator:check_for_missing_models",
|
67
|
-
"bundle exec rails test",
|
68
|
-
"bundle exec rake simplecov_coverage:publish",
|
69
|
-
"test-results publish ./test/reports",
|
70
|
-
"bundle exec rake setup"
|
71
|
-
]
|
72
|
-
}
|
73
|
-
]
|
74
|
-
]
|
75
|
-
end
|
76
|
-
|
77
|
-
def env_vars_config
|
78
|
-
[
|
79
|
-
{
|
80
|
-
"name" => "TZ",
|
81
|
-
"value" => "UTC"
|
82
|
-
},
|
83
|
-
{
|
84
|
-
"name" => "RAILS_ENV",
|
85
|
-
"value" => "test"
|
86
|
-
},
|
87
|
-
{
|
88
|
-
"name" => "RACK_ENV",
|
89
|
-
"value" => "test"
|
90
|
-
}
|
91
|
-
]
|
92
|
-
end
|
93
|
-
|
94
|
-
def after_pipeline_jobs
|
95
|
-
{
|
96
|
-
"jobs" => [
|
97
|
-
{
|
98
|
-
"name" => "Publish Results",
|
99
|
-
"commands" => ["test-results gen-pipeline-report"]
|
100
|
-
}
|
101
|
-
]
|
102
|
-
}
|
103
|
-
end
|
104
|
-
|
105
|
-
def standard_semaphore_config_file
|
106
|
-
NeetoCompliance::NeetoCommons.path.join "common_files/semaphore/semaphore.yml"
|
107
|
-
end
|
108
|
-
|
109
|
-
def semaphore_config_valid?
|
110
|
-
@semaphore_errors = []
|
111
|
-
@no_errors = true
|
112
|
-
|
113
|
-
begin
|
114
|
-
container_setup_commands.each do |cmd|
|
115
|
-
unless my_container_setup_commands.include?(cmd)
|
116
|
-
@semaphore_errors << "Missing: \"#{cmd}\" in global_job_config"
|
117
|
-
@no_errors = false
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
unless jobs_config == my_jobs_config
|
122
|
-
@semaphore_errors << "Blocks configuration should be same as in #{standard_semaphore_config_file}"
|
123
|
-
@no_errors = false
|
124
|
-
end
|
125
|
-
|
126
|
-
unless env_vars_config == my_env_vars_config
|
127
|
-
@semaphore_errors << "Env vars configuration should be same as in #{standard_semaphore_config_file}"
|
128
|
-
@no_errors = false
|
129
|
-
end
|
130
|
-
|
131
|
-
unless after_pipeline_jobs == my_after_pipeline_jobs
|
132
|
-
@semaphore_errors << "after_pipeline jobs configuration should be same as in #{standard_semaphore_config_file}"
|
133
|
-
@no_errors = false
|
134
|
-
end
|
135
|
-
|
136
|
-
unless machine_type == my_machine_type
|
137
|
-
@semaphore_errors << "Machine type should be #{machine_type}"
|
138
|
-
@no_errors = false
|
139
|
-
end
|
140
|
-
|
141
|
-
rescue => e
|
142
|
-
p e
|
143
|
-
return false
|
144
|
-
end
|
145
|
-
|
146
|
-
@no_errors
|
147
|
-
end
|
148
|
-
|
149
|
-
def autofix_suggestion
|
150
|
-
@error.yellow
|
151
|
-
end
|
152
|
-
|
153
|
-
def valid?
|
154
|
-
unless semaphore_config_valid?
|
155
|
-
@error = %{SemaphoreCI configuration (.semaphore/semaphore.yml) is incomplete/incorrect. \n#{@semaphore_errors.join("\n")} \n}
|
156
|
-
return false
|
157
|
-
end
|
158
|
-
|
159
|
-
true
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class SidekiqQueuesVerifier < Base
|
5
|
-
def local_copy
|
6
|
-
"config/sidekiq.yml"
|
7
|
-
end
|
8
|
-
|
9
|
-
def queues
|
10
|
-
@_queues ||= ["active_storage_analysis", "active_storage_purge"]
|
11
|
-
end
|
12
|
-
|
13
|
-
def valid?
|
14
|
-
@errors = []
|
15
|
-
|
16
|
-
sidekiq_yml = YAML.load(File.open(local_copy), aliases: true)
|
17
|
-
|
18
|
-
queues.map do |queue|
|
19
|
-
unless sidekiq_yml["queues"].include?(queue)
|
20
|
-
@errors << "Add #{queue} to queues in #{local_copy}"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
@errors.length == 0
|
25
|
-
end
|
26
|
-
|
27
|
-
def autofix_suggestion
|
28
|
-
@errors.join("\n").yellow
|
29
|
-
end
|
30
|
-
|
31
|
-
def auto_correct!
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class SimplecovConfigVerifier < Base
|
5
|
-
def test_helper
|
6
|
-
"test/test_helper.rb"
|
7
|
-
end
|
8
|
-
|
9
|
-
def valid?
|
10
|
-
@errors = []
|
11
|
-
|
12
|
-
check_file = Set.new(File.readlines(test_helper).collect(&:chomp))
|
13
|
-
|
14
|
-
if check_file.include?("NeetoCommonsBackend.simplecov_config")
|
15
|
-
@errors << "Remove NeetoCommons.simplecov_config from #{test_helper}"
|
16
|
-
end
|
17
|
-
|
18
|
-
@errors.length == 0
|
19
|
-
end
|
20
|
-
|
21
|
-
def autofix_suggestion
|
22
|
-
@errors.join("\n").yellow
|
23
|
-
end
|
24
|
-
|
25
|
-
def auto_correct!
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class SitemapConfigVerifier < Base
|
5
|
-
def local_copy
|
6
|
-
"public/sitemap.xml"
|
7
|
-
end
|
8
|
-
|
9
|
-
def commons_copy
|
10
|
-
NeetoCompliance::NeetoCommons.path.join "common_files", "sitemap.xml"
|
11
|
-
end
|
12
|
-
|
13
|
-
def verify_command
|
14
|
-
"diff -N #{commons_copy} #{local_copy}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def valid?
|
18
|
-
`#{verify_command}`.empty?
|
19
|
-
end
|
20
|
-
|
21
|
-
def autofix_command
|
22
|
-
"cp #{commons_copy} #{local_copy}"
|
23
|
-
end
|
24
|
-
|
25
|
-
def apps_exception_list
|
26
|
-
["neeto-kb-web.git"]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class SlugignoreFileVerifier < Base
|
5
|
-
def local_copy
|
6
|
-
".slugignore"
|
7
|
-
end
|
8
|
-
|
9
|
-
def commons_copy
|
10
|
-
NeetoCompliance::NeetoCommons.path.join local_copy
|
11
|
-
end
|
12
|
-
|
13
|
-
def verify_command
|
14
|
-
"diff -N #{commons_copy} #{local_copy}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def valid?
|
18
|
-
`#{verify_command}`.empty?
|
19
|
-
end
|
20
|
-
|
21
|
-
def autofix_command
|
22
|
-
"cp #{commons_copy} #{local_copy}"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "net/http"
|
4
|
-
require "json"
|
5
|
-
require "yaml"
|
6
|
-
|
7
|
-
require "neeto_compliance/sync_neeto_commons"
|
8
|
-
|
9
|
-
module NeetoCompliance
|
10
|
-
class SyncNeetoCommonsVerifier < Base
|
11
|
-
class BinFilesVerifier
|
12
|
-
def process
|
13
|
-
non_complied_bin_files = find_non_complied_bin_files
|
14
|
-
|
15
|
-
return false if non_complied_bin_files.any?
|
16
|
-
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def find_non_complied_bin_files
|
23
|
-
NeetoCompliance::SyncNeetoCommons::SyncBin.BIN_FILES.select do |file|
|
24
|
-
!system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "net/http"
|
4
|
-
require "json"
|
5
|
-
require "yaml"
|
6
|
-
|
7
|
-
require "neeto_compliance/sync_neeto_commons"
|
8
|
-
|
9
|
-
module NeetoCompliance
|
10
|
-
class SyncNeetoCommonsVerifier < Base
|
11
|
-
class FormatterFilesVerifier
|
12
|
-
def process
|
13
|
-
non_complied_formatter_files = find_non_complied_formatter_files
|
14
|
-
|
15
|
-
return false if non_complied_formatter_files.any?
|
16
|
-
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def find_non_complied_formatter_files
|
23
|
-
NeetoCompliance::SyncNeetoCommons::SyncFormatters.CONFIG_FILES.select do |file|
|
24
|
-
!system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "net/http"
|
4
|
-
require "json"
|
5
|
-
require "yaml"
|
6
|
-
|
7
|
-
require "neeto_compliance/sync_neeto_commons"
|
8
|
-
|
9
|
-
module NeetoCompliance
|
10
|
-
class SyncNeetoCommonsVerifier < Base
|
11
|
-
class HuskyFilesVerifier
|
12
|
-
def process
|
13
|
-
non_complied_husky_files = find_non_complied_husky_files
|
14
|
-
|
15
|
-
return false if non_complied_husky_files.any?
|
16
|
-
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def find_non_complied_husky_files
|
23
|
-
NeetoCompliance::SyncNeetoCommons::SyncHusky.HUSKY_FILES.select do |file|
|
24
|
-
!system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "net/http"
|
4
|
-
require "json"
|
5
|
-
require "yaml"
|
6
|
-
|
7
|
-
require "neeto_compliance/sync_neeto_commons"
|
8
|
-
|
9
|
-
module NeetoCompliance
|
10
|
-
class SyncNeetoCommonsVerifier < Base
|
11
|
-
class MiscFilesVerifier
|
12
|
-
def process
|
13
|
-
non_complied_misc_files = find_non_complied_misc_files
|
14
|
-
|
15
|
-
return false if non_complied_misc_files.any?
|
16
|
-
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def find_non_complied_misc_files
|
23
|
-
NeetoCompliance::SyncNeetoCommons::SyncMisc.MISC_FILES.select do |file|
|
24
|
-
!system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "neeto_compliance/sync_neeto_commons"
|
4
|
-
require "neeto_compliance/sync_neeto_commons/sync_test_support"
|
5
|
-
|
6
|
-
module NeetoCompliance
|
7
|
-
class SyncNeetoCommonsVerifier < Base
|
8
|
-
class TestSupportFilesVerifier
|
9
|
-
def process
|
10
|
-
return false unless support_folder_exist?
|
11
|
-
|
12
|
-
non_complied_test_support_files.empty?
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def support_folder_exist?
|
18
|
-
File.directory?(NeetoCompliance::SyncNeetoCommons::SyncTestSupport::SUPPORT_DIR)
|
19
|
-
end
|
20
|
-
|
21
|
-
def non_complied_test_support_files
|
22
|
-
NeetoCompliance::SyncNeetoCommons::SyncTestSupport.SUPPORT_FILES.select do |file|
|
23
|
-
!system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier"
|
4
|
-
require "neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier"
|
5
|
-
require "neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier"
|
6
|
-
require "neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier"
|
7
|
-
require "neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier"
|
8
|
-
|
9
|
-
module NeetoCompliance
|
10
|
-
class SyncNeetoCommonsVerifier < Base
|
11
|
-
def valid?
|
12
|
-
verifiers = [
|
13
|
-
BinFilesVerifier,
|
14
|
-
FormatterFilesVerifier,
|
15
|
-
HuskyFilesVerifier,
|
16
|
-
MiscFilesVerifier,
|
17
|
-
TestSupportFilesVerifier
|
18
|
-
]
|
19
|
-
|
20
|
-
results = verifiers.map do |verifier|
|
21
|
-
verifier.new.process
|
22
|
-
end
|
23
|
-
|
24
|
-
success = results.all?
|
25
|
-
end
|
26
|
-
|
27
|
-
def autofix_command
|
28
|
-
"bundle exec sync-with-neeto-commons"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class WebpackConfigurationVerifier < Base
|
5
|
-
def files_to_sync
|
6
|
-
@_files_to_sync ||= {
|
7
|
-
"config/webpack/development.js" => NeetoCompliance::NeetoCommons.path.join("webpack/development.js"),
|
8
|
-
"config/webpack/production.js" => NeetoCompliance::NeetoCommons.path.join("webpack/production.js"),
|
9
|
-
"config/webpack/staging.js" => NeetoCompliance::NeetoCommons.path.join("webpack/staging.js"),
|
10
|
-
"config/webpack/test.js" => NeetoCompliance::NeetoCommons.path.join("webpack/test.js")
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
def auto_correct!
|
15
|
-
unless valid?
|
16
|
-
@autofix_commands.each do |command|
|
17
|
-
puts command
|
18
|
-
system(command)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def autofix_suggestion
|
24
|
-
@autofix_commands.join("\n").yellow
|
25
|
-
end
|
26
|
-
|
27
|
-
def valid?
|
28
|
-
@autofix_commands = []
|
29
|
-
|
30
|
-
files_to_sync.each_pair do |local_file, common_file|
|
31
|
-
unless same_file?(local_file, common_file)
|
32
|
-
@autofix_commands << "cp #{common_file.to_s} #{local_file}"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
@autofix_commands.length == 0
|
37
|
-
end
|
38
|
-
|
39
|
-
def same_file?(local_file, common_file)
|
40
|
-
File.exist?(local_file) &&
|
41
|
-
`diff #{local_file} #{common_file.to_s}`.empty?
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class WebpackerConfigVerifier < Base
|
5
|
-
def local_copy
|
6
|
-
"config/webpacker.yml"
|
7
|
-
end
|
8
|
-
|
9
|
-
def commons_copy
|
10
|
-
NeetoCompliance::NeetoCommons.path.join "common_files/webpacker.yml"
|
11
|
-
end
|
12
|
-
|
13
|
-
def compare_files
|
14
|
-
@file_difference = `diff #{commons_copy} #{local_copy} | grep '<'`
|
15
|
-
end
|
16
|
-
|
17
|
-
def valid?
|
18
|
-
compare_files
|
19
|
-
@file_difference.empty?
|
20
|
-
end
|
21
|
-
|
22
|
-
def autofix_suggestion
|
23
|
-
warning = "Following configuration lines are missing in webpacker config (config/webpacker.yml). Please refer #{commons_copy}"
|
24
|
-
.yellow
|
25
|
-
missing_lines = @file_difference.delete("<").red
|
26
|
-
"#{warning}\n\n#{missing_lines}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NeetoCompliance
|
4
|
-
class VerifiersList
|
5
|
-
def self.neeto_auth
|
6
|
-
[
|
7
|
-
NeetoAuthGemsVerifier,
|
8
|
-
CircleciConfigVerifier,
|
9
|
-
SitemapConfigVerifier,
|
10
|
-
# CommonInitializersVerifier,
|
11
|
-
NewrelicVerifier,
|
12
|
-
RubyVersionVerifier,
|
13
|
-
DockerFileDevVerifier,
|
14
|
-
NodeVersionVerifier,
|
15
|
-
SlugignoreFileVerifier,
|
16
|
-
GitignoreFileVerifier,
|
17
|
-
WebpackConfigurationVerifier,
|
18
|
-
SidekiqQueuesVerifier,
|
19
|
-
SimplecovConfigVerifier,
|
20
|
-
PackageDependenciesVersionVerifier,
|
21
|
-
PackageJsonVerifier,
|
22
|
-
CypressConfigVerifier,
|
23
|
-
# BundlerVersionVerifier,
|
24
|
-
SyncNeetoCommonsVerifier,
|
25
|
-
CypressPluginsIndexVerifier,
|
26
|
-
WebpackerConfigVerifier
|
27
|
-
]
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.neeto_apps
|
31
|
-
[
|
32
|
-
NeetoGemsVerifier,
|
33
|
-
CircleciConfigVerifier,
|
34
|
-
SitemapConfigVerifier,
|
35
|
-
CommonGemfileVerifier,
|
36
|
-
CommonInitializersVerifier,
|
37
|
-
NewrelicVerifier,
|
38
|
-
RubyVersionVerifier,
|
39
|
-
DockerFileDevVerifier,
|
40
|
-
NodeVersionVerifier,
|
41
|
-
SlugignoreFileVerifier,
|
42
|
-
GitignoreFileVerifier,
|
43
|
-
SemaphoreciConfigVerifier,
|
44
|
-
EnvironmentConfigVerifier,
|
45
|
-
WebpackConfigurationVerifier,
|
46
|
-
SidekiqQueuesVerifier,
|
47
|
-
SimplecovConfigVerifier,
|
48
|
-
PackageDependenciesVersionVerifier,
|
49
|
-
PackageJsonVerifier,
|
50
|
-
CypressConfigVerifier,
|
51
|
-
# BundlerVersionVerifier,
|
52
|
-
SyncNeetoCommonsVerifier,
|
53
|
-
RolesVerifier,
|
54
|
-
JsconfigVerifier,
|
55
|
-
AutoUpdatePrsWithLatestMasterVerifier,
|
56
|
-
CypressPluginsIndexVerifier,
|
57
|
-
WebpackerConfigVerifier
|
58
|
-
]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/env.sample
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
AUTH_PARAMS='{"provider": "github","client_id": "9aefff37f98713262fd0","grant_type": "urn:ietf:params:oauth:grant-type:device_code","auth_uris": {"auth_req": "https://github.com/login/device/code","token_req": "https://github.com/login/oauth/access_token"},"scope": "repo,user"}'
|