rondabot 1.0.2 → 1.0.3
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/README.md +21 -4
- data/lib/module/Azure.rb +1 -3
- data/lib/module/Core.rb +3 -2
- data/lib/module/GitHub.rb +0 -7
- data/lib/module/GitLab.rb +28 -2
- data/lib/module/SourceControl.rb +12 -1
- data/lib/rondabot.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7060042f4e01c4351ce8340453878ac2ee4345f6277d59c7ae839de0031102fc
|
|
4
|
+
data.tar.gz: 79d433c2353e98a3f854fb1cdde1607aaa258ce5a5ace31d10c360249f5922e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83c42081bc808dc8ac66f8246d6996e702ae08b0d243acf287675c48c855d22ea0e0e852ec30544ab5743bc050d85b89af8ca640ab96c27817c6c80b2978f1ff
|
|
7
|
+
data.tar.gz: 8518d0512f2a4e2b200c2cd6fbdd096d1557917c8ae4eb86d745b2a30e80374dce9eef083f2b3c12f1cfc5ff699a0b49aada25c129c24cb38f7c4c4753040988
|
data/README.md
CHANGED
|
@@ -20,7 +20,7 @@ To get started let's create our Gemfile:
|
|
|
20
20
|
```ruby
|
|
21
21
|
source "https://rubygems.org"
|
|
22
22
|
|
|
23
|
-
gem "rondabot", "~> 1.0.
|
|
23
|
+
gem "rondabot", "~> 1.0.3"
|
|
24
24
|
gem "dependabot-omnibus", "~> 0.111.5"
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -41,7 +41,6 @@ core = Rondabot::Core.new(
|
|
|
41
41
|
# ...
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
# start bot
|
|
45
44
|
core.start()
|
|
46
45
|
```
|
|
47
46
|
|
|
@@ -53,7 +52,8 @@ core.start()
|
|
|
53
52
|
| **organization** | Name of your organization on azure devops |
|
|
54
53
|
| **project** | Name of your project on azure devops |
|
|
55
54
|
| **repository** | Name of your project to using for clone and create pull requests |
|
|
56
|
-
| **
|
|
55
|
+
| **hostname** | Only Gitlab. Your server hostname on premise. Default `gitlab.com` |
|
|
56
|
+
| **access_token** | A git credentials to clone e create pull requests. On **gitlab** is a personal access token generated in your portal |
|
|
57
57
|
| **feed_id** | Your feed id npm/yarn on azure devops. Go to Azure Devops, your project _Artifacts_ > _Connect to feed_ > _npm_ and then you can find feed id in the url looks like `https://pkgs.dev.azure.com/your organization name/you feed id to be right here/_packaging/npm-packages/npm/registry/` |
|
|
58
58
|
| **github_token** | Allows passing in a GitHub access token so that the API rate limiting is not exceeded. When the repository's visibility is public, the `github_token` must be an access token with read access to the public repositories. When repository visibility is private, the `github_token` must be an access token with full control of private repositories. |
|
|
59
59
|
|
|
@@ -70,7 +70,7 @@ core = Rondabot::Core.new(
|
|
|
70
70
|
organization: "Akatsuki",
|
|
71
71
|
project: "Digital%20Channel",
|
|
72
72
|
repository: "akatsuki-website",
|
|
73
|
-
access_token: "cm9uZGluZWxsaW1vcmFpcwcm9uZGFib3Q"
|
|
73
|
+
access_token: "cm9uZGluZWxsaW1vcmFpcwcm9uZGFib3Q",
|
|
74
74
|
feed_id: "11db190-e3b1872-1e6e6e-c97f2dd-49253",
|
|
75
75
|
github_token: "11db190e3b18721e6e6ec97f2dd49253"
|
|
76
76
|
)
|
|
@@ -99,6 +99,23 @@ core = Rondabot::Core.new(
|
|
|
99
99
|
core.start()
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
### GitLab
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
require "dependabot/omnibus"
|
|
106
|
+
require "rondabot"
|
|
107
|
+
|
|
108
|
+
core = Rondabot::Core.new(
|
|
109
|
+
provider: "gitlab",
|
|
110
|
+
hostname: "https://gitlab.devops.akatsuki.com",
|
|
111
|
+
repository: "akatsuki/software/mobile/myproject",
|
|
112
|
+
access_token: "F1nZ827g8GsAd1rKx1A8r",
|
|
113
|
+
github_token: "11db190e3b18721e6e6ec97f2dd49253"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
core.start()
|
|
117
|
+
```
|
|
118
|
+
|
|
102
119
|
# License
|
|
103
120
|
|
|
104
121
|
MIT.
|
data/lib/module/Azure.rb
CHANGED
data/lib/module/Core.rb
CHANGED
|
@@ -10,8 +10,7 @@ module Rondabot
|
|
|
10
10
|
when 'azure'
|
|
11
11
|
@source_control = Rondabot::Azure.new(params)
|
|
12
12
|
when 'gitlab'
|
|
13
|
-
|
|
14
|
-
raise ArgumentError.new("gitlab available soon :)")
|
|
13
|
+
@source_control = Rondabot::GitLab.new(params)
|
|
15
14
|
when 'github'
|
|
16
15
|
@source_control = Rondabot::GitHub.new(params)
|
|
17
16
|
else
|
|
@@ -23,6 +22,8 @@ module Rondabot
|
|
|
23
22
|
package_manager = "npm_and_yarn"
|
|
24
23
|
source = Dependabot::Source.new(
|
|
25
24
|
provider: @provider,
|
|
25
|
+
hostname: @source_control.hostname,
|
|
26
|
+
api_endpoint: @source_control.api_endpoint,
|
|
26
27
|
repo: @source_control.repository_uri
|
|
27
28
|
)
|
|
28
29
|
|
data/lib/module/GitHub.rb
CHANGED
data/lib/module/GitLab.rb
CHANGED
|
@@ -2,10 +2,36 @@ module Rondabot
|
|
|
2
2
|
class GitLab < SourceControl
|
|
3
3
|
def initialize params
|
|
4
4
|
super(params)
|
|
5
|
+
if params[:hostname].nil?
|
|
6
|
+
raise ArgumentError.new("'hostname' param is missing!")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
if params[:access_token].nil?
|
|
10
|
+
raise ArgumentError.new("'access_token' param is missing!")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
@hostname = params[:hostname] || "https://gitlab.com"
|
|
14
|
+
@credentials << {
|
|
15
|
+
"type" => "git_source",
|
|
16
|
+
"host" => @hostname,
|
|
17
|
+
"username" => "x-access-token",
|
|
18
|
+
"password" => params[:access_token]
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def hostname
|
|
23
|
+
return @hostname
|
|
5
24
|
end
|
|
6
25
|
|
|
7
|
-
def
|
|
8
|
-
|
|
26
|
+
def api_endpoint
|
|
27
|
+
return "#{@hostname}/api/v4"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def create_pull_request params
|
|
31
|
+
pull_request = super(params)
|
|
32
|
+
|
|
33
|
+
# fix gitlab PR feedback
|
|
34
|
+
puts "PR submitted"
|
|
9
35
|
end
|
|
10
36
|
end
|
|
11
37
|
end
|
data/lib/module/SourceControl.rb
CHANGED
|
@@ -27,7 +27,10 @@ module Rondabot
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def repository_uri
|
|
30
|
-
|
|
30
|
+
if @repository.nil?
|
|
31
|
+
raise ArgumentError.new("'repository' param is missing!")
|
|
32
|
+
end
|
|
33
|
+
return @repository
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
def clone source
|
|
@@ -50,6 +53,14 @@ module Rondabot
|
|
|
50
53
|
|
|
51
54
|
return pr_creator.create
|
|
52
55
|
end
|
|
56
|
+
|
|
57
|
+
def hostname
|
|
58
|
+
nil
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def api_endpoint
|
|
62
|
+
nil
|
|
63
|
+
end
|
|
53
64
|
end
|
|
54
65
|
end
|
|
55
66
|
|
data/lib/rondabot.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rondabot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rondinelli Morais
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-08-
|
|
11
|
+
date: 2020-08-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|