neetob 0.5.54 → 0.5.55

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: 46660ea26f353aff09b346158f9f0f7db9eddd281b435e7ca481b95f31b64c41
4
+ data.tar.gz: c9467a84568b6adef2bc63729e336978fedecdf4fd4ebad8486e83af5148218e
5
5
  SHA512:
6
- metadata.gz: 9235966af33701a93529148fda3908bc18d03b80fdbaf3170892e64027c28f0b645e217d5492194a834153542e8dee82d7a8470ab36c72fbaec2447befb3411a
7
- data.tar.gz: bb1f5ec040198ec437a1b79039341eb157bae920472a462fa55cbd114b2cb11f7665417277e76c3624986c0ef1d649cf056809e485cc8f798f8e41b7c6d9f80c
6
+ metadata.gz: d9b62e4cada32b74ce2ef9204e79600fe2f87608613059a041c8f8996df38acd58e55aa52cd34c8869f53ee0c49f729aae2878a1363a458f7ecbb9ee6eedbd1a
7
+ data.tar.gz: '020887410c816037a5c72618da92d7855470db977d1ae1c86b6ab9fd175003ae83c4080d86343562b11d57dc2bce8a95286db538a01f2da536713cd487dfe560'
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.55)
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
@@ -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.55"
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.55
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-01 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