buildkit 1.5.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8339dc16de1e244cb46b37924cd05249fa82bca44697d99df391081949c60dc
4
- data.tar.gz: ef4616aa820bc0a1b54b76a95b368472c4aee761bfc8bf5f30d625a07928827b
3
+ metadata.gz: 6e0e8f1334155df0287e1c1ea8b99bd03234f10681f87bea60ddf471474952a9
4
+ data.tar.gz: 0cc70aa70b57a0f6754460257dbc127f936d11f6a35e01bcaa8cd9b677223078
5
5
  SHA512:
6
- metadata.gz: bddd63cad980a59feda2502fb22af7773f651f13e5f897ed6bb60e15f8f90457fbbafae671c3f0bc8588db2431b5b949ddc2d1468c8baf156f198877389e845d
7
- data.tar.gz: '0028f6cb9fed067344e067d36d835c8fdae534d37799e28f04ef3d05a1a9b740b1fe814b20adbb63507fd02931e864247f7db317f1055b094c2c409ce1449dce'
6
+ metadata.gz: f48d7763085376ec590cb490ec8eca0c3b971aead37e3e9bc12e037627af4ff4122fdb242ebf20a3d4030c59f01ec7f4333078e8e33a4da097e628dccf91632e
7
+ data.tar.gz: 2f738d7d0437b8f6c2d37a68a240dfde0e37ac912de2bda9e74d8dba9e75f113b1c5c61705dddccd9cf050871afe3c8d622fdb17bb14e3a08757d002990f575c
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
8
+ insecure-external-code-execution: allow
9
+ registries: "*"
@@ -6,7 +6,7 @@ jobs:
6
6
  runs-on: ubuntu-latest
7
7
  strategy:
8
8
  matrix:
9
- ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ]
9
+ ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3' ]
10
10
  name: Ruby ${{ matrix.ruby }}
11
11
  steps:
12
12
  - uses: actions/checkout@v2
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/.rubocop.yml CHANGED
@@ -1,8 +1,5 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- AllCops:
4
- TargetRubyVersion: 2.3
5
-
6
3
  Metrics/LineLength:
7
4
  Max: 120
8
5
 
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.5
data/Gemfile CHANGED
@@ -8,8 +8,8 @@ gem 'yard'
8
8
 
9
9
  group :test do
10
10
  gem 'rspec', '~> 3.2'
11
- gem 'rubocop', '~> 0.81.0'
12
- gem 'vcr', '~> 3.0'
11
+ gem 'rubocop', '~> 1.28.2'
12
+ gem 'vcr', '~> 6.0'
13
13
  end
14
14
 
15
15
  gemspec
data/buildkit.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
23
 
24
- spec.required_ruby_version = '>= 2.3'
24
+ spec.required_ruby_version = '>= 2.5'
25
25
 
26
26
  spec.add_dependency 'sawyer', '>= 0.6'
27
27
  spec.add_development_dependency 'bundler'
data/dev.yml CHANGED
@@ -3,7 +3,7 @@ name: buildkit
3
3
  type: ruby
4
4
 
5
5
  up:
6
- - ruby: 2.5.5
6
+ - ruby
7
7
  - bundler
8
8
 
9
9
  commands:
@@ -47,6 +47,26 @@ module Buildkit
47
47
  def job_log(org, pipeline, build, job, options = {})
48
48
  get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/log", options)
49
49
  end
50
+
51
+ # Unblock a job
52
+ #
53
+ # @param org [String] Organization slug.
54
+ # @param pipeline [String] Pipeline slug.
55
+ # @param build [Integer] Build number.
56
+ # @param job [String] Job id.
57
+ # @return [Array<Sawyer::Resource>] Hashes representing Buildkite job.
58
+ # @see https://buildkite.com/docs/apis/rest-api/jobs#unblock-a-job
59
+ # @example
60
+ # Buildkit.unblock('my-great-org', 'great-pipeline', 123, 'my-job-id', {
61
+ # "unblocker" => "id-of-unblocker",
62
+ # "fields" => {
63
+ # "name": "Liam Neeson",
64
+ # "email": "liam@evilbatmanvillans.com"
65
+ # }
66
+ # })
67
+ def unblock(org, pipeline, build, job, options = {})
68
+ put("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/unblock", options)
69
+ end
50
70
  end
51
71
  end
52
72
  end
@@ -91,6 +91,18 @@ module Buildkit
91
91
  def unarchive_pipeline(org, pipeline)
92
92
  post("/v2/organizations/#{org}/pipelines/#{pipeline}/unarchive")
93
93
  end
94
+
95
+ # Delete a pipeline
96
+ #
97
+ # @param org [String] Organization slug.
98
+ # @param pipeline [String] pipeline slug.
99
+ # @see https://buildkite.com/docs/apis/rest-api/pipelines#delete-a-pipeline
100
+ # @example
101
+ # Buildkit.delete_pipeline('my-great-org', 'great-pipeline')
102
+ #
103
+ def delete_pipeline(org, pipeline)
104
+ delete("/v2/organizations/#{org}/pipelines/#{pipeline}")
105
+ end
94
106
  end
95
107
  end
96
108
  end
@@ -148,6 +148,7 @@ module Buildkit
148
148
  response.concat @last_response.data
149
149
 
150
150
  break if @last_response.headers[:link].nil?
151
+
151
152
  link_header = parse_link_header(@last_response.headers[:link])
152
153
  break if link_header[:next].nil?
153
154
 
@@ -170,7 +171,7 @@ module Buildkit
170
171
  http.headers[:accept] = 'application/json'
171
172
  http.headers[:content_type] = 'application/json'
172
173
  http.headers[:user_agent] = "Buildkit v#{Buildkit::VERSION}"
173
- if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new("1.7.1")
174
+ if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('1.7.1')
174
175
  http.request :authorization, 'Bearer', @token
175
176
  else
176
177
  http.authorization 'Bearer', @token
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Buildkit
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -38,18 +38,21 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description:
41
+ description:
42
42
  email:
43
43
  - jean.boussier@shopify.com
44
44
  executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".github/dependabot.yml"
48
49
  - ".github/workflows/ci.yml"
50
+ - ".github/workflows/cla.yml"
49
51
  - ".gitignore"
50
52
  - ".rspec"
51
53
  - ".rubocop.yml"
52
54
  - ".rubocop_todo.yml"
55
+ - ".ruby-version"
53
56
  - Gemfile
54
57
  - LICENSE.txt
55
58
  - README.md
@@ -75,7 +78,7 @@ licenses:
75
78
  - MIT
76
79
  metadata:
77
80
  allowed_push_host: https://rubygems.org
78
- post_install_message:
81
+ post_install_message:
79
82
  rdoc_options: []
80
83
  require_paths:
81
84
  - lib
@@ -83,15 +86,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
86
  requirements:
84
87
  - - ">="
85
88
  - !ruby/object:Gem::Version
86
- version: '2.3'
89
+ version: '2.5'
87
90
  required_rubygems_version: !ruby/object:Gem::Requirement
88
91
  requirements:
89
92
  - - ">="
90
93
  - !ruby/object:Gem::Version
91
94
  version: '0'
92
95
  requirements: []
93
- rubygems_version: 3.2.20
94
- signing_key:
96
+ rubygems_version: 3.5.18
97
+ signing_key:
95
98
  specification_version: 4
96
99
  summary: Ruby toolkit for working with the Buildkite API
97
100
  test_files: []