ci_toolkit 1.3.13 → 1.3.17
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/ci_toolkit/bitrise_client.rb +28 -29
- data/lib/ci_toolkit.rb +0 -2
- metadata +1 -2
- data/lib/ci_toolkit/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 883207d3f29050dad756ee30f072af4ee6e0d25a2ebb6739c2c7353f0fe3e7e0
|
4
|
+
data.tar.gz: 7804a7d066e5b5550d0ef373c2f55753abd62f615a69bfa47ae73607bbdda8ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a2d27d94b95f311dc675105790a19ddd81849ebad508875fe69b2a6a37326cc056fda20ebc141e29e9f54e59a099254fc0a6853b84d4d3ff869a0ef42ef3f90
|
7
|
+
data.tar.gz: 7217613bbd0774d92857d8db7b34e7e48f70c34c66285efc55c2bdf58a417582f599a7500f41d5ede9e1dba7e9868826b94d251343b1867cc9928cbab7a6d547
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# CiToolkit [](https://github.com/crvshlab/ci_toolkit/actions/workflows/lint_and_run_tests.yml) [](https://github.com/crvshlab/ci_toolkit/actions/workflows/codeql-analysis.yml.yml) [](https://sonarcloud.io/dashboard?id=crvshlab_ci_toolkit) [](https://sonarcloud.io/dashboard?id=crvshlab_ci_toolkit)
|
2
2
|
|
3
3
|
A collection of utility classes used to glue information between Github and CI (Bitrise primarily)
|
4
4
|
## Installation
|
@@ -19,51 +19,50 @@ module CiToolkit
|
|
19
19
|
@build_number = options[:build_number].to_i
|
20
20
|
@token = options[:token]
|
21
21
|
@app_slug = options[:app_slug]
|
22
|
-
@connection = faraday
|
23
|
-
configure_connection
|
22
|
+
@connection = faraday || create_connection
|
24
23
|
end
|
25
24
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
@connection = Faraday.new(
|
25
|
+
def create_connection
|
26
|
+
connection = Faraday.new(
|
30
27
|
url: "https://api.bitrise.io",
|
31
28
|
headers: { "Content-Type" => "application/json", "Authorization" => @token }
|
32
29
|
)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
connection.use Faraday::Request::UrlEncoded
|
31
|
+
connection.use Faraday::Request::Retry
|
32
|
+
connection.use FaradayMiddleware::EncodeJson
|
33
|
+
connection.use FaradayMiddleware::ParseJson
|
34
|
+
connection.use FaradayMiddleware::FollowRedirects
|
35
|
+
|
36
|
+
connection
|
38
37
|
end
|
39
38
|
|
40
39
|
def create_pull_request_build(pull_request, branch, commit, workflow)
|
41
|
-
@connection
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
40
|
+
@connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds", {
|
41
|
+
hook_info: { type: "bitrise" },
|
42
|
+
build_params: {
|
43
|
+
branch: branch,
|
44
|
+
branch_dest: "develop",
|
45
|
+
pull_request_id: pull_request,
|
46
|
+
workflow_id: workflow,
|
47
|
+
commit_hash: commit
|
48
|
+
}
|
49
|
+
})
|
51
50
|
end
|
52
51
|
|
53
52
|
def abort_pull_request_builds(pull_request, branch, commit)
|
54
53
|
find_pull_request_builds(pull_request, branch, commit).each do |build|
|
55
|
-
@connection
|
56
|
-
|
57
|
-
|
54
|
+
@connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
|
55
|
+
abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
|
56
|
+
})
|
58
57
|
end
|
59
58
|
end
|
60
59
|
|
61
60
|
def find_pull_request_builds(pull_request, branch, commit)
|
62
|
-
response = @connection
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
response = @connection.get("/#{API_VERSION}/apps/#{@app_slug}/builds", {
|
62
|
+
branch: branch,
|
63
|
+
pull_request_id: pull_request.to_i,
|
64
|
+
status: 0 # status: 0 == not finished
|
65
|
+
})
|
67
66
|
builds = response.body["data"]
|
68
67
|
filter_builds_by_commit(builds, commit)
|
69
68
|
end
|
data/lib/ci_toolkit.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gero Keller
|
@@ -210,7 +210,6 @@ files:
|
|
210
210
|
- lib/ci_toolkit/jira.rb
|
211
211
|
- lib/ci_toolkit/pr_messenger.rb
|
212
212
|
- lib/ci_toolkit/pr_messenger_text.rb
|
213
|
-
- lib/ci_toolkit/version.rb
|
214
213
|
- transform_coverage_data.rb
|
215
214
|
homepage: https://github.com/crvshlab/ci_toolkit
|
216
215
|
licenses:
|