neetob 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/.semaphore/semaphore.yml +4 -5
  5. data/CHANGELOG.md +21 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +15 -1
  8. data/README.md +197 -118
  9. data/bookmarks.md +30 -0
  10. data/data/branch-protection-rules.json +1 -1
  11. data/data/github-labels.json +54 -29
  12. data/images/commit-message-update.png +0 -0
  13. data/lib/neetob/cli/base.rb +22 -10
  14. data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -3
  15. data/lib/neetob/cli/github/auth.rb +3 -3
  16. data/lib/neetob/cli/github/base.rb +7 -0
  17. data/lib/neetob/cli/github/commands.rb +6 -2
  18. data/lib/neetob/cli/github/labels/commands.rb +18 -10
  19. data/lib/neetob/cli/github/labels/delete.rb +5 -3
  20. data/lib/neetob/cli/github/labels/delete_all.rb +5 -3
  21. data/lib/neetob/cli/github/labels/list.rb +5 -3
  22. data/lib/neetob/cli/github/labels/show.rb +5 -3
  23. data/lib/neetob/cli/github/labels/update.rb +16 -4
  24. data/lib/neetob/cli/github/labels/upsert.rb +43 -7
  25. data/lib/neetob/cli/github/make_pr/base.rb +2 -1
  26. data/lib/neetob/cli/github/make_pr/commands.rb +4 -1
  27. data/lib/neetob/cli/github/make_pr/compliance_fix.rb +6 -1
  28. data/lib/neetob/cli/github/make_pr/script.rb +4 -3
  29. data/lib/neetob/cli/github/protect_branch.rb +5 -3
  30. data/lib/neetob/cli/heroku/config_vars/upsert.rb +6 -2
  31. data/lib/neetob/cli/heroku/execute.rb +2 -2
  32. data/lib/neetob/cli/ui.rb +1 -1
  33. data/lib/neetob/cli/users/commands.rb +3 -1
  34. data/lib/neetob/cli/users/commits.rb +71 -22
  35. data/lib/neetob/cli.rb +3 -1
  36. data/lib/neetob/exception_handler.rb +3 -1
  37. data/lib/neetob/version.rb +1 -1
  38. data/neetob.gemspec +1 -1
  39. metadata +8 -57
  40. data/LICENSE.txt +0 -21
  41. data/env.sample +0 -1
  42. data/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
  43. data/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
  44. data/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
  45. data/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
  46. data/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
  47. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
  48. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
  49. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
  50. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
  51. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
  52. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
  53. data/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
  54. data/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
  55. data/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
  56. data/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
  57. data/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
  58. data/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
  59. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
  60. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
  61. data/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
  62. data/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
  63. data/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
  64. data/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
  65. data/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
  66. data/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
  67. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
  68. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
  69. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
  70. data/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
  71. data/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
  72. data/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
  73. data/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
  74. data/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
  75. data/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
  76. data/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
  77. data/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
  78. data/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
  79. data/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
  80. data/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
  81. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
  82. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
  83. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
  84. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
  85. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
  86. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
  87. data/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
  88. data/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
  89. data/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
  90. data/neeto_compliance/lib/neeto_compliance/version.rb +0 -5
@@ -26,6 +26,7 @@ module Neetob
26
26
  clone_app_in_tmp_dir(app)
27
27
  check_and_delete_remote_branch(app)
28
28
  bundle_install(app)
29
+ fix_neeto_audit(app)
29
30
  ui.info(add_commmit_and_push_changes(app))
30
31
  delete_local_feature_branch(app)
31
32
  res = client.create_pull_request(app, "main", BRANCH_NAME, PR_TITLE)
@@ -40,7 +41,11 @@ module Neetob
40
41
  private
41
42
 
42
43
  def bundle_install(app)
43
- `#{cd_to_app_in_tmp_dir(app)} && bundle`
44
+ `#{cd_to_app_in_tmp_dir(app)} && bundle install`
45
+ end
46
+
47
+ def fix_neeto_audit(app)
48
+ `#{cd_to_app_in_tmp_dir(app)} && bundle exec neeto-audit -a`
44
49
  end
45
50
  end
46
51
  end
@@ -9,13 +9,14 @@ 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
12
+ attr_accessor :apps, :sandbox, :path_to_the_script_file, :pr_description
13
13
 
14
- def initialize(apps, path_to_the_script_file, pr_title, branch_name, sandbox = false)
14
+ def initialize(apps, path_to_the_script_file, pr_title, branch_name, pr_description, sandbox = false)
15
15
  super(pr_title, branch_name)
16
16
  @apps = apps
17
17
  @sandbox = sandbox
18
18
  @path_to_the_script_file = path_to_the_script_file
19
+ @pr_description = pr_description
19
20
  end
20
21
 
21
22
  def run
@@ -30,7 +31,7 @@ module Neetob
30
31
  execute_script(app)
31
32
  ui.info(add_commmit_and_push_changes(app))
32
33
  delete_local_feature_branch(app)
33
- res = client.create_pull_request(app, "main", branch_name, pr_title)
34
+ res = client.create_pull_request(app, "main", branch_name, pr_title, pr_description)
34
35
  ui.success("PR created in \"#{app}\" project successfully.")
35
36
  rescue StandardError => e
36
37
  ExceptionHandler.new(e).process
@@ -6,18 +6,20 @@ module Neetob
6
6
  class CLI
7
7
  module Github
8
8
  class ProtectBranch < Base
9
- attr_accessor :branch_name, :required_rules_json_file_path, :apps, :sandbox
9
+ attr_accessor :branch_name, :required_rules_json_file_path, :apps, :sandbox, :all_neeto_repos
10
10
 
11
- def initialize(branch_name, apps, required_rules_json_file_path = "", sandbox = false)
11
+ def initialize(branch_name, apps, required_rules_json_file_path = "", sandbox = false, all_neeto_repos = false)
12
12
  super()
13
13
  @branch_name = branch_name
14
14
  @required_rules_json_file_path = required_rules_json_file_path
15
15
  @apps = apps
16
16
  @sandbox = sandbox
17
+ @all_neeto_repos = all_neeto_repos
17
18
  end
18
19
 
19
20
  def run
20
- matching_apps = find_all_matching_apps(apps, :github, sandbox)
21
+ check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
22
+ matching_apps = find_all_matching_apps(apps, :github, sandbox, false, all_neeto_repos)
21
23
  inform_about_default_rules_file
22
24
  matching_apps.each do |app|
23
25
  ui.info("\n Working on \"#{app}\" repo")
@@ -29,7 +29,9 @@ required_config_vars_with_project_keys_json_file_path, sandbox = false)
29
29
  inform_about_default_config_vars_file
30
30
 
31
31
  apps_to_be_updated.each do |app|
32
- required_config = apps.nil? ? app[1] : read_json_file(required_config_vars_json_file_path || default_config_vars_upsert_file_path)
32
+ required_config = apps.nil? ?
33
+ app[1]
34
+ : read_json_file(required_config_vars_json_file_path || default_config_vars_upsert_file_path)
33
35
  app = app[0] if apps.nil?
34
36
 
35
37
  if apps.nil? && sandbox && app != "neeto-dummy"
@@ -69,7 +71,9 @@ required_config_vars_with_project_keys_json_file_path, sandbox = false)
69
71
  end
70
72
 
71
73
  def inform_about_default_config_vars_file
72
- if !apps.nil? && required_config_vars_with_project_keys_json_file_path.nil? && required_config_vars_json_file_path.nil?
74
+ if !apps.nil? &&
75
+ required_config_vars_with_project_keys_json_file_path.nil? && required_config_vars_json_file_path.nil?
76
+
73
77
  ui.info("Upserting config vars from the \"neetob/data/config-vars-upsert.json\" file")
74
78
  end
75
79
  end
@@ -18,11 +18,11 @@ module Neetob
18
18
 
19
19
  def run
20
20
  matching_apps = find_all_matching_apps(apps, :heroku, sandbox)
21
- rails_runner_command = "heroku run rails runner '#{command_to_execute}'"
21
+ rails_runner_command = "rails runner '#{command_to_execute}'"
22
22
  heroku_command = should_run_in_rails_console ? rails_runner_command : command_to_execute
23
23
  matching_apps.each do |app|
24
24
  ui.info("\n Working on #{app}\n")
25
- output = `#{heroku_command} -a #{app}`
25
+ output = `heroku run "#{heroku_command}" -a #{app}`
26
26
  unless $?.success?
27
27
  ui.error("There is a problem in accessing the app with name \"#{app}\" in your account.")
28
28
  ui.error("Please check the specified app name and ensure you're authorized to view that app.")
data/lib/neetob/cli/ui.rb CHANGED
@@ -18,7 +18,7 @@ module Neetob
18
18
  end
19
19
 
20
20
  def ask(question, echo = true)
21
- shell.ask(question, echo: echo)
21
+ shell.ask(question, echo:)
22
22
  end
23
23
 
24
24
  def yes?(question)
@@ -17,10 +17,12 @@ module Neetob
17
17
  option :apps, type: :array, aliases: "-a", default: ["*"], desc: "Github app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\""
18
18
  option :author, type: :string, required: true, desc: "Github username of the person whose commits you want to list"
19
19
  option :duration, type: :string, required: true, desc: "Duration for which you want to list the commits. Example: \"6.months\" \"10.days\""
20
+ option :all_neeto_repos, type: :boolean, aliases: "--all",
21
+ desc: "Use this flag for working with all neeto repos", default: false
20
22
  def commits
21
23
  Commits.new(
22
24
  options[:author], options[:duration], options[:apps],
23
- options[:sandbox]).run
25
+ options[:sandbox], options[:all_neeto_repos]).run
24
26
  end
25
27
  end
26
28
  end
@@ -1,19 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../base"
3
+ require "chronic"
4
+ require "active_support/core_ext/numeric/time"
5
+
6
+ require_relative "../github/base"
4
7
 
5
8
  module Neetob
6
9
  class CLI
7
10
  module Users
8
- class Commits < Base
9
- attr_accessor :sandbox, :apps, :author, :duration
11
+ class Commits < Github::Base
12
+ include ActionView::Helpers::DateHelper
13
+
14
+ attr_accessor :sandbox, :apps, :author, :duration, :all_neeto_repos
10
15
 
11
- def initialize(author, duration, apps = ["*"], sandbox = false)
16
+ def initialize(author, duration, apps = ["*"], sandbox = false, all_neeto_repos = false)
12
17
  super()
13
18
  @sandbox = sandbox
14
19
  @apps = apps
15
20
  @author = author
16
21
  @duration = duration
22
+ @all_neeto_repos = all_neeto_repos
17
23
  end
18
24
 
19
25
  def run
@@ -26,38 +32,49 @@ module Neetob
26
32
  private
27
33
 
28
34
  def build_commit_rows
29
- find_all_matching_apps(apps, :github, sandbox, true).map do |app|
35
+ commits = find_all_matching_apps(apps, :github, sandbox, true, all_neeto_repos).map do |app|
30
36
  commits = commits_within_range(app)
31
- if commits.empty?
32
- ui.error("No commits found in \"#{app}\" for the given author and duration.")
37
+ if commits&.empty?
38
+ ui.info("No commits found in \"#{app}\" for the given author and duration.")
33
39
  next
34
40
  end
35
-
36
- build_table_rows(app, commits)
41
+ ui.success("Commits found in \"#{app}\".\n")
42
+ commits
37
43
  end
44
+ sorted_commits = commits.compact.flatten.sort_by { |obj| obj.dig(:commit, :author, :date) }.reverse
45
+ build_table_rows(sorted_commits)
38
46
  end
39
47
 
40
48
  def commits_within_range(app)
41
- `git -C ./#{app_name_without_org_suffix(app)} log --pretty=format:"%H:::%ae:::%ar:::%s" --author=#{author} --since=#{duration} --no-merges`
49
+ fetch_commits(app, 1)
42
50
  end
43
51
 
44
- def build_table_rows(app, commits)
45
- commits.split("\n").map { |commit| html_table_row(app, *commit.split(":::")) }
52
+ def build_table_rows(commits)
53
+ commits.map do |commit|
54
+ app = commit[:html_url].split("/")[4]
55
+ commit_id = commit[:sha]
56
+ email = commit.dig(:commit, :author, :email)
57
+ time = distance_of_time_in_words(commit.dig(:commit, :author, :date), Time.current) + " ago"
58
+ date = commit.dig(:commit, :author, :date).strftime("%B %d, %Y")
59
+ title = commit.dig(:commit, :message).split("\n")[0]
60
+ html_table_row(app, commit_id, email, time, date, title)
61
+ end
46
62
  end
47
63
 
48
64
  def app_name_without_org_suffix(app)
49
65
  app.split("/")[1]
50
66
  end
51
67
 
52
- def html_table_row(app, commit, email, time, title)
53
- starting_7_characters_of_commit = commit[0..6]
68
+ def html_table_row(app, commit_id, email, time, date, title)
69
+ starting_7_characters_of_commit = commit_id[0..6]
54
70
  "<tr>
55
- <td class='commit'><a href='https://github.com/#{app}/commit/#{commit}'
56
- target='_blank'>#{starting_7_characters_of_commit}</a></td>
57
- <td class='project'>#{app_name_without_org_suffix(app)}</td>
58
- <td class='email'>#{email}</td>
71
+ <td class='commit'><a href='https://github.com/bigbinary/#{app}/commit/#{commit_id}'
72
+ target='_blank'>#{starting_7_characters_of_commit}</a></td>
73
+ <td class='project'>#{app}</td>
59
74
  <td class='time'>#{time}</td>
60
75
  <td class='title'>#{title}</td>
76
+ <td class='time'>#{date}</td>
77
+ <td class='email'>#{email}</td>
61
78
  </tr>"
62
79
  end
63
80
 
@@ -66,8 +83,10 @@ module Neetob
66
83
  <html>
67
84
  <body>
68
85
  <style>
69
- table {
86
+ body{
70
87
  font-family: arial, sans-serif;
88
+ }
89
+ table {
71
90
  border-collapse: collapse;
72
91
  width: 100%;
73
92
  }
@@ -95,16 +114,25 @@ module Neetob
95
114
  .title {
96
115
  color: lightcoral
97
116
  }
117
+ .info{
118
+ font-size: larger;
119
+ margin-bottom: 10px;
120
+ }
98
121
  </style>
122
+ <div class='info'>
123
+ Github user id: <strong>#{author}</strong> <br/>
124
+ Duration: <strong>#{duration}</strong>
125
+ </div>
99
126
  <table>
100
127
  <tr>
101
128
  <th>Commit</th>
102
- <th>Product</th>
103
- <th>Email</th>
129
+ <th>Repo</th>
104
130
  <th>Created at</th>
105
131
  <th>Title</th>
132
+ <th>Commited on</th>
133
+ <th>Email</th>
106
134
  </tr>
107
- #{table_rows.empty? ? "<tr><td>No commits found in the given duration</td></tr>" : table_rows.join}
135
+ #{table_rows&.compact&.empty? ? "<tr><td>No commits found in the given duration</td></tr>" : table_rows.join}
108
136
  </table>
109
137
  </body>
110
138
  </html>"
@@ -119,6 +147,27 @@ module Neetob
119
147
  def open_html_file_in_default_system_application
120
148
  `open ./commits.html`
121
149
  end
150
+
151
+ def since_duration(duration)
152
+ Chronic.parse(duration.split(".").join(" ") + " ago")&.iso8601
153
+ end
154
+
155
+ def fetch_commits(app, page = 1)
156
+ begin
157
+ commits = client.commits(
158
+ app, "main",
159
+ { author:, since: since_duration(duration), per_page: 100, page: })
160
+ rescue => exception
161
+ ui.error(exception.message)
162
+ commits = []
163
+ end
164
+
165
+ if commits.length == 100
166
+ commits + fetch_commits(app, page + 1)
167
+ else
168
+ commits
169
+ end
170
+ end
122
171
  end
123
172
  end
124
173
  end
data/lib/neetob/cli.rb CHANGED
@@ -33,8 +33,10 @@ module Neetob
33
33
  subcommand "local", Local::Commands
34
34
 
35
35
  desc "make_repos_uptodate", "Uptodate all neeto repos"
36
+ option :all_neeto_repos, type: :boolean, aliases: "--all", desc: "Use this flag for working with all neeto repos",
37
+ default: false
36
38
  def make_repos_uptodate
37
- FetchorupdateRepos::Execute.new(options[:sandbox]).run
39
+ FetchorupdateRepos::Execute.new(options[:sandbox], options[:all_neeto_repos]).run
38
40
  end
39
41
  end
40
42
  end
@@ -26,7 +26,9 @@ module Neetob
26
26
  when Octokit::UnprocessableEntity
27
27
  ui.error(
28
28
  "Failed to complete the given request."\
29
- " Make sure that the given entity is correct and processable")
29
+ " Make sure that the given entity is correct and processable"\
30
+ "#{exception.message}."
31
+ )
30
32
  when Octokit::Unauthorized
31
33
  ui.error(
32
34
  "You are unauthorized to make API calls,"\
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.5"
5
5
  end
data/neetob.gemspec CHANGED
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  Dir.chdir(submodule_path) do
42
42
  required_submodule_files = `git ls-files -z`
43
43
  .split("\x0")
44
- .select { |file| file.match("lib/neeto_compliance*") }
44
+ .select { |file| file.match("lib/neeto_compliance*|data/*") }
45
45
  .map { |file| "#{submodule_path}/#{file}" }
46
46
  .map { |file| file.gsub "#{File.dirname(__FILE__)}/", "" }
47
47
  spec.files += required_submodule_files
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.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-10 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -98,16 +98,16 @@ files:
98
98
  - CODE_OF_CONDUCT.md
99
99
  - Gemfile
100
100
  - Gemfile.lock
101
- - LICENSE.txt
102
101
  - README.md
103
102
  - Rakefile
103
+ - bookmarks.md
104
104
  - data/branch-protection-rules.json
105
105
  - data/config-vars-audit.json
106
106
  - data/config-vars-list.json
107
107
  - data/config-vars-upsert.json
108
108
  - data/github-labels.json
109
- - env.sample
110
109
  - exe/neetob
110
+ - images/commit-message-update.png
111
111
  - install.sh
112
112
  - lib/neetob.rb
113
113
  - lib/neetob/cli.rb
@@ -155,55 +155,6 @@ files:
155
155
  - lib/neetob/exception_handler.rb
156
156
  - lib/neetob/utils.rb
157
157
  - lib/neetob/version.rb
158
- - neeto_compliance/lib/neeto_compliance/github_access.rb
159
- - neeto_compliance/lib/neeto_compliance/neeto_apps.rb
160
- - neeto_compliance/lib/neeto_compliance/neeto_commons.rb
161
- - neeto_compliance/lib/neeto_compliance/runner.rb
162
- - neeto_compliance/lib/neeto_compliance/skippable.rb
163
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb
164
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb
165
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb
166
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb
167
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb
168
- - neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb
169
- - neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb
170
- - neeto_compliance/lib/neeto_compliance/verifiers/base.rb
171
- - neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb
172
- - neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb
173
- - neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb
174
- - neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb
175
- - neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb
176
- - neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb
177
- - neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb
178
- - neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb
179
- - neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb
180
- - neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb
181
- - neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb
182
- - neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb
183
- - neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb
184
- - neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb
185
- - neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb
186
- - neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb
187
- - neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb
188
- - neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb
189
- - neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb
190
- - neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb
191
- - neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb
192
- - neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb
193
- - neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb
194
- - neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb
195
- - neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb
196
- - neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb
197
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb
198
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb
199
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb
200
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb
201
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb
202
- - neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb
203
- - neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb
204
- - neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb
205
- - neeto_compliance/lib/neeto_compliance/verifiers_list.rb
206
- - neeto_compliance/lib/neeto_compliance/version.rb
207
158
  - neetob.gemspec
208
159
  - overcommit.yml
209
160
  - scripts/delete_unused_assets.rb
@@ -214,7 +165,7 @@ metadata:
214
165
  homepage_uri: https://github.com/bigbinary/neetob
215
166
  source_code_uri: https://github.com/bigbinary/neetob
216
167
  changelog_uri: https://github.com/bigbinary/neetob/blob/main/CHANGELOG.md
217
- post_install_message:
168
+ post_install_message:
218
169
  rdoc_options: []
219
170
  require_paths:
220
171
  - lib
@@ -229,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
180
  - !ruby/object:Gem::Version
230
181
  version: '0'
231
182
  requirements: []
232
- rubygems_version: 3.4.6
233
- signing_key:
183
+ rubygems_version: 3.3.26
184
+ signing_key:
234
185
  specification_version: 4
235
186
  summary: Provides a set of helper scripts for Github and Heroku.
236
187
  test_files: []
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2022 Udai Gupta
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
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"}'
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "base64"
4
-
5
- module NeetoCompliance
6
- class GithubAccess
7
- def self.token
8
- Base64.decode64(
9
- File.read("Gemfile.common.rb")
10
- .split("encoded_github_auth_string =")[1]
11
- .split("%{")[1]
12
- .split("}")[0]
13
- .gsub("\\r", "\r")
14
- .gsub("\\n", "\n")
15
- ).split(":")[1]
16
- end
17
-
18
- def self.latest_commit_sha(uri)
19
- JSON.parse(get(uri))["sha"]
20
- end
21
-
22
- def self.get(uri)
23
- response = Net::HTTP.get_response(
24
- URI(uri), {
25
- "Authorization" => "Bearer #{token}"
26
- }).body
27
- end
28
- end
29
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- class NeetoApps
5
- def self.list
6
- [ "neetoWheel",
7
- "neetoChat",
8
- "neetoDesk",
9
- "neetoKB",
10
- "neetoForm",
11
- "neetoInvoice",
12
- "neetoChangelog",
13
- "neetoInvisible",
14
- "neetoSocial",
15
- "neetoWireframe",
16
- "neetoRunner",
17
- "neetoPlanner",
18
- "neetoCourse",
19
- "neetoCrm",
20
- "neetoCal",
21
- "neetoAuth",
22
- "neetoReplay",
23
- "neetoQuiz",
24
- "neetoTestify",
25
- "neetoSite",
26
- "neetoDeploy",
27
- "neetoMonitor",
28
- "neetoCI",
29
- "neetoSign",
30
- "neetoBugtrap",
31
- "neetoGit"
32
- ]
33
- end
34
- end
35
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "base64"
4
-
5
- module NeetoCompliance
6
- class NeetoCommons
7
- def self.path
8
- @@_neeto_commons_path ||= get_path
9
- end
10
-
11
- def self.get_path
12
- path = `bundle info neeto-commons-backend`.split(" ").last
13
- Pathname.new(path).join("lib", "neeto_commons_backend")
14
- end
15
- end
16
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- class Runner
5
- def verifiers
6
- app_name == "neeto-auth-web" ? VerifiersList.neeto_auth : VerifiersList.neeto_apps
7
- end
8
-
9
- def process
10
- results = verifiers.map do |verifier|
11
- verifier.new.process
12
- end
13
-
14
- results.all? ? exit(0) : exit(1)
15
- end
16
-
17
- def auto_correct
18
- puts "Running auto_correct ...".yellow
19
- results = verifiers.map do |verifier|
20
- verifier.new.auto_correct!
21
- end
22
-
23
- puts %(
24
- Auto fixing got completed \n
25
- Please run bundle exec neeto-audit once again to fix other errors manually if any \n
26
- ).yellow
27
-
28
- results.all? ? exit(0) : exit(1)
29
- end
30
-
31
- def app_name
32
- @_app_name ||= `git config --get remote.origin.url`.split("/").last.strip.split(".git").first
33
- end
34
- end
35
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Skippable
4
- def self.included(base)
5
- base.class_eval do
6
- include InstanceMethods
7
- end
8
- end
9
-
10
- module InstanceMethods
11
- def skip?
12
- `git config --get remote.origin.url`.split("/").last.strip.include? "neeto-auth-web"
13
- end
14
-
15
- def app_is?(git_repo)
16
- `git config --get remote.origin.url`.split("/").last.strip.include? "#{git_repo}"
17
- end
18
- end
19
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "neeto_compliance/github_access"
4
- require "neeto_compliance/sync_neeto_commons"
5
-
6
- module NeetoCompliance
7
- class SyncNeetoCommons
8
- class SyncBin
9
- def self.BIN_FILES
10
- [
11
- "bin/bundle",
12
- "bin/setup",
13
- "bin/update",
14
- "bin/webpacker",
15
- "bin/webpacker-dev-server",
16
- "bin/yarn"
17
- ]
18
- end
19
-
20
- def self.process
21
- sync_bin_files
22
- end
23
-
24
- def self.sync_bin_files
25
- self.BIN_FILES.each do |file|
26
- print "Downloading #{file}...\n"
27
- system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
28
- end
29
- end
30
- end
31
- end
32
- end