neetob 0.5.54 → 0.5.56

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 462aabe15043331ebd306de4ad4a1f1032c13e1a23af4ca04db5708670b76c8b
4
- data.tar.gz: d65d134217d3d93c6b446f7942a82e07450cd3e4d7f5ba3903dfff1082c4a076
3
+ metadata.gz: 6a6d0f5f14328fd58d78796801b804ecb554c8e5137742b4c3a359d7ac4abca8
4
+ data.tar.gz: 3edc72355b7c37b83440f5688ca35fb22cd402797c1a07a04e8873bd9a341a63
5
5
  SHA512:
6
- metadata.gz: 9235966af33701a93529148fda3908bc18d03b80fdbaf3170892e64027c28f0b645e217d5492194a834153542e8dee82d7a8470ab36c72fbaec2447befb3411a
7
- data.tar.gz: bb1f5ec040198ec437a1b79039341eb157bae920472a462fa55cbd114b2cb11f7665417277e76c3624986c0ef1d649cf056809e485cc8f798f8e41b7c6d9f80c
6
+ metadata.gz: 0bf8a602943256423a313aa3571bd3b38a6d5782b583308adb77619bbdec342ed7b329600019bdd6d6f8f99db1823168cf18c4469bdff41eb5bdb4c4d38d0dbe
7
+ data.tar.gz: 79fff223b0850291dedb17617ba02a962238bdcbd387a1e92832e34b1e25c09de122ee302eade527900dc1ea457781c2700094a38c1515eb904c12898629ed1b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetob (0.5.54)
4
+ neetob (0.5.56)
5
5
  actionview
6
6
  activesupport
7
7
  brakeman (~> 5.0)
data/bookmarks.md CHANGED
@@ -137,6 +137,7 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
137
137
  - [Praveen's Board](https://github.com/orgs/bigbinary/projects/100/views/1)
138
138
  - [Avinash's Board](https://github.com/orgs/bigbinary/projects/97/views/2)
139
139
  - [Rishad's Board](https://github.com/orgs/bigbinary/projects/105/views/1)
140
+ - [Yedhin's Board](https://github.com/orgs/bigbinary/projects/106/views/1)
140
141
 
141
142
  ## Products checklist
142
143
 
@@ -33,6 +33,8 @@ module Neetob
33
33
  all_engine_repos(sandbox_mode)
34
34
  elsif apps == ["nanos"]
35
35
  all_nano_repos(sandbox_mode)
36
+ elsif apps == ["products"]
37
+ all_product_repos(sandbox_mode)
36
38
  else
37
39
  match_apps(apps || ["*"], all_available_apps)
38
40
  end
@@ -54,6 +56,12 @@ module Neetob
54
56
  NeetoCompliance::NeetoRepos.nanos_backend.map { |repo| "bigbinary/#{repo}" }
55
57
  end
56
58
 
59
+ def all_product_repos(sandbox_mode)
60
+ sandbox_mode ?
61
+ testing_apps(:github) :
62
+ NeetoCompliance::NeetoRepos::products.keys.map { |repo| "bigbinary/#{repo}" }
63
+ end
64
+
57
65
  def all_nano_repos(sandbox_mode)
58
66
  sandbox_mode ?
59
67
  testing_apps(:github) :
@@ -4,6 +4,8 @@ require "thor"
4
4
 
5
5
  require_relative "list"
6
6
  require_relative "create"
7
+ require_relative "create_product_sub_issues"
8
+
7
9
  require_relative "../../sub_command_base"
8
10
 
9
11
  module Neetob
@@ -11,13 +13,15 @@ module Neetob
11
13
  module Github
12
14
  module Issues
13
15
  class Commands < SubCommandBase
14
- class_option :repos,
15
- {
16
- type: :array, aliases: "-r", required: true,
17
- desc: "Github repo names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\", also providing \"all\" as value matches all neeto repos."
18
- }
16
+ REPOS_OPTION = {
17
+ type: :array,
18
+ aliases: "-r",
19
+ required: true,
20
+ desc: 'Github repo names. Can be matched using the "*" wildcard. Example: "neeto*" "neeto-cal-web". Providing "all" matches all neeto repos.'
21
+ }.freeze
19
22
 
20
23
  desc "list", "List the issues in the Github repos"
24
+ option :repos, **REPOS_OPTION
21
25
  option :state, type: :string, default: "open", aliases: "-s", desc: "State of the issues. Can be open or closed."
22
26
  option :assignee, type: :string, desc: "Username of the current assignee. Can also use \"none\"."
23
27
  option :label, type: :string, aliases: "-l", desc: "Label name to filter out the issues"
@@ -30,6 +34,7 @@ module Neetob
30
34
  end
31
35
 
32
36
  desc "create", "Create a issue in the Github repos"
37
+ option :repos, **REPOS_OPTION
33
38
  option :title, type: :string, aliases: "-t", desc: "Title of the issue"
34
39
  option :description, type: :string, aliases: "-d", desc: "Description of the issue"
35
40
  option :assignee, type: :string, desc: "Username of the user you want to assign this issue."
@@ -44,6 +49,12 @@ module Neetob
44
49
  options[:sandbox]
45
50
  ).run
46
51
  end
52
+
53
+ desc "create_product_sub_issues", "Given an issue number from the neeto-engineering-web repo, create corresponding issues with the same title and description in all product repositories"
54
+ option :issue_number, type: :numeric, aliases: "-n", required: true, desc: "Issue number in the neeto-engineering-web repository"
55
+ def create_product_sub_issues
56
+ CreateProductSubIssues.new(options[:issue_number], options[:sandbox]).run
57
+ end
47
58
  end
48
59
  end
49
60
  end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../base"
4
+
5
+ module Neetob
6
+ class CLI
7
+ module Github
8
+ module Issues
9
+ class CreateProductSubIssues < Base
10
+ SOURCE_REPO = "bigbinary/neeto-engineering-web"
11
+
12
+ def initialize(issue_number, sandbox = false)
13
+ super()
14
+ @issue_number = issue_number
15
+ @target_repos = find_all_matching_apps_or_repos(["products"], :github, sandbox)
16
+ end
17
+
18
+ def run
19
+ ui.info("Fetching issue ##{@issue_number} from #{SOURCE_REPO}")
20
+
21
+ begin
22
+ source_issue = fetch_issue
23
+ ui.info("Creating sub-issues in product repos...")
24
+
25
+ body = source_issue[:body]
26
+
27
+ @target_repos.each do |repo|
28
+ created_issue = create_issue_in(repo, source_issue, body)
29
+
30
+ link_sub_issue(
31
+ parent_issue_number: @issue_number,
32
+ child_issue_id: created_issue[:id]
33
+ )
34
+
35
+ ui.success("✔️ Created issue ##{created_issue[:number]} in #{repo}")
36
+ end
37
+ rescue StandardError => e
38
+ ExceptionHandler.new(e).process
39
+ end
40
+ end
41
+
42
+ private
43
+
44
+ def fetch_issue
45
+ client.issue(SOURCE_REPO, @issue_number)
46
+ end
47
+
48
+ def create_issue_in(repo, source_issue, body)
49
+ client.create_issue(repo, source_issue[:title], body)
50
+ end
51
+
52
+ def link_sub_issue(parent_issue_number:, child_issue_id:)
53
+ client.post(
54
+ "/repos/#{SOURCE_REPO}/issues/#{parent_issue_number}/sub_issues",
55
+ {
56
+ sub_issue_id: child_issue_id
57
+ }
58
+ )
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -22,20 +22,24 @@ module Neetob
22
22
  vulnerabilities_found = "No"
23
23
  audit_passed = "No"
24
24
  comments = nil
25
- if yarn_audit_result && yarn_audit_result.include?("0 vulnerabilities found")
25
+ severity = yarn_audit_result.split("\n").select { |line|
26
+ line.include?("Severity:") }.first.strip.gsub("|", ",")
27
+ if yarn_audit_result && !is_high_critical_vulnerabilities_found?(severity)
26
28
  audit_passed = "Yes"
27
29
  else
28
30
  vulnerabilities_found = "Yes"
29
31
  vulnerabilities = yarn_audit_result.split("\n").select { |line|
30
32
  line.include?("vulnerabilities found") }.first.strip
31
- severity = yarn_audit_result.split("\n").select { |line|
32
- line.include?("Severity:") }.first.strip.gsub("|", ",")
33
33
  comments = "#{vulnerabilities}<br>#{severity}"
34
34
  end
35
35
  repo_data << [repo, vulnerabilities_found, comments, audit_passed]
36
36
  end
37
37
  ui.print_table(repo_data)
38
38
  end
39
+
40
+ def is_high_critical_vulnerabilities_found?(severity)
41
+ severity&.include?("High") || severity&.include?("Critical")
42
+ end
39
43
  end
40
44
  end
41
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.5.54"
4
+ VERSION = "0.5.56"
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.5.54
4
+ version: 0.5.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -243,6 +243,7 @@ files:
243
243
  - lib/neetob/cli/github/gems/release.rb
244
244
  - lib/neetob/cli/github/issues/commands.rb
245
245
  - lib/neetob/cli/github/issues/create.rb
246
+ - lib/neetob/cli/github/issues/create_product_sub_issues.rb
246
247
  - lib/neetob/cli/github/issues/list.rb
247
248
  - lib/neetob/cli/github/labels/commands.rb
248
249
  - lib/neetob/cli/github/labels/delete.rb