is_it_done_yet 0.5.0 → 0.7.0

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: 24d08f9d4a40b523e7120e98d7e1977466a97265cfc5e9d6577e7fcc20c1f991
4
- data.tar.gz: b7d6e1f1aea1b2fcc2c6e56ef5bdfb7716867def856bb866d073fd5eba4fcddc
3
+ metadata.gz: acc0a7adff69366d84c25bbfdc1341baccf2f648cb42778a5bc7bcabaf1a2e26
4
+ data.tar.gz: 66fb306eb3ca271c5355fbefae632f924b42eaf6e9ec4d896b7fc91ce4f5780a
5
5
  SHA512:
6
- metadata.gz: d4aa43bbea3b71f689852d922ee230590c4aea724f87d82dc29bcdd03bcb4001648abbf8d0ead7bff82b0fd2456419fead68723f3d8a24938138c3db63c647c4
7
- data.tar.gz: 5ec6de5c539047fc55298b68eb76d8e6a228ae0774ed87f0406a6543551dcac972d64cd6731ec926a9f15f78f1634499e736105c183f7ce5539c899c71af7822
6
+ metadata.gz: 810ae7248094df3dfa2b23a621e85bf9a42c60a75fdde2f413e4df247f802d3a9e84106f35191b16d48ef206acf5db1af53ea1dd8dcd66bc15a18d2aca1e3149
7
+ data.tar.gz: 5acb53f6362ccba9876de3698a88fb70ed78b3e5a3af45e5f77d5d04140dee519aaa94b1c4b3b67696fb3345a2a5e5972060cce01d10349f86195a918230ddea
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ # 0.7.0
2
+
3
+ Runs on current Ruby.
4
+
5
+ * Sinatra moves from 2.x to 4.x and Rack from 2.x to 3.x. Sinatra 2 requires
6
+ ostruct, which left the standard library, so the gem could not even be loaded
7
+ on Ruby 4.
8
+ * JSON request bodies, which the README documents as the way to use this API,
9
+ returned 500 on Ruby 4. rack-contrib parses them by calling JSON.parse with
10
+ create_additions, a keyword json 3 removed, and Ruby 4 ships json 3. The app
11
+ now supplies its own parser to the middleware.
12
+ * thin and rack-token_auth are no longer dependencies. The README always said
13
+ the deployer brings their own server and auth middleware, and the library
14
+ never required either.
15
+ * Requires Ruby 3.2 or newer.
16
+ * The published gem no longer carries the Rakefile, Gemfile, CI config or
17
+ development scripts.
18
+ * The example config.ru returned a bare string where Rack needs a status,
19
+ headers and body, and used `use` where it needed `map`.
20
+
21
+ # 0.6.0
22
+
23
+ Bumping dependencies
24
+
25
+ # 0.5.0
26
+
27
+ Bumping dependencies
28
+
29
+
1
30
  # 0.4.0
2
31
 
3
32
  Features:
data/README.md CHANGED
@@ -6,7 +6,7 @@ The intended use case is when you want to use one of the build nodes as a master
6
6
 
7
7
  Specifically I built it to allow a travis job at work to do parallel tests with Knapsack and do a deploy if all tests pass.
8
8
 
9
- An example Travis build configuration that takes advantage of a deployed `is_it_done_yet` service is available in [examples](exampels/.travis.yml).
9
+ An example Travis build configuration that takes advantage of a deployed `is_it_done_yet` service is available in [examples](examples/.travis.yml).
10
10
 
11
11
  ## Installation
12
12
 
@@ -0,0 +1,21 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.2
6
+
7
+ bundler_args: --without production
8
+
9
+ env:
10
+ global:
11
+ - CI_NODE_TOTAL=2
12
+ matrix:
13
+ - CI_NODE_INDEX=0
14
+ - CI_NODE_INDEX=1
15
+
16
+ before_script: examples/ci-put BUILDING REBUILDING
17
+
18
+ script: bundle exec rake knapsack:rspec && examples/ci-sync && examples/ci-deploy
19
+
20
+ after_success: examples/ci-put OK
21
+ after_failure: examples/ci-put FAILED
data/examples/config.ru CHANGED
@@ -6,16 +6,16 @@ require 'rack/token_auth'
6
6
  require 'is_it_done_yet'
7
7
  Bundler.require
8
8
 
9
- # Shared secret authentication
9
+ # Shared secret authentication. The gem does not depend on rack-token_auth, so
10
+ # add it, and a server such as puma, to your own Gemfile. Which middleware and
11
+ # which server to run are yours to choose.
10
12
  use Rack::TokenAuth do |token, _options, _env|
11
13
  token == ENV['IIDY_TOKEN']
12
14
  end
13
15
 
14
16
  # Heartbeat endpoint
15
- use Rack::Builder.new do
16
- map '/health_check' do
17
- run ->(_env) { "success" }
18
- end
17
+ map '/health_check' do
18
+ run ->(_env) { [200, { 'content-type' => 'text/plain' }, ['success']] }
19
19
  end
20
20
 
21
21
  run IsItDoneYet.build_app
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IsItDoneYet
4
- VERSION = '0.5.0'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -2,13 +2,19 @@
2
2
 
3
3
  require 'is_it_done_yet/version'
4
4
  require 'is_it_done_yet/web_app'
5
+ require 'json'
5
6
  require 'rack/contrib'
6
7
  require 'rack'
7
8
 
8
9
  module IsItDoneYet
10
+ # rack-contrib's own parser calls JSON.parse with create_additions, which json
11
+ # 3 removed, so every JSON request body fails there on Ruby 4. The middleware
12
+ # takes a parser block, so supply one that does not use the removed keyword.
13
+ PARSE_JSON_BODY = ->(body) { JSON.parse(body) }
14
+
9
15
  def self.build_app
10
16
  Rack::Builder.app do
11
- use Rack::PostBodyContentTypeParser
17
+ use Rack::JSONBodyParser, &PARSE_JSON_BODY
12
18
  run WebApp
13
19
  end
14
20
  end
metadata CHANGED
@@ -1,99 +1,84 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_it_done_yet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Madsen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: concurrent-ruby
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '1.3'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '1.3'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: json
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '0'
32
+ version: '2.0'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: '0'
39
+ version: '2.0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: rack-contrib
41
+ name: rack
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - ">="
44
+ - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '0'
46
+ version: '3.0'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - ">="
51
+ - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '0'
53
+ version: '3.0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: rack-token_auth
55
+ name: rack-contrib
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
- - - ">="
58
+ - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '0'
60
+ version: '2.5'
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
- - - ">="
65
+ - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '0'
67
+ version: '2.5'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: sinatra
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: '2.0'
74
+ version: '4.0'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '2.0'
83
- - !ruby/object:Gem::Dependency
84
- name: thin
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
81
+ version: '4.0'
97
82
  - !ruby/object:Gem::Dependency
98
83
  name: bundler
99
84
  requirement: !ruby/object:Gem::Requirement
@@ -201,25 +186,16 @@ executables: []
201
186
  extensions: []
202
187
  extra_rdoc_files: []
203
188
  files:
204
- - ".gitignore"
205
- - ".rspec"
206
189
  - CHANGELOG.md
207
- - CODE_OF_CONDUCT.md
208
- - Gemfile
209
- - Gemfile.lock
210
190
  - LICENSE.txt
211
191
  - README.md
212
- - Rakefile
213
- - bin/console
214
- - bin/setup
215
- - config.ru
192
+ - examples/.travis.yml
216
193
  - examples/ci-clear
217
194
  - examples/ci-deploy
218
195
  - examples/ci-post
219
196
  - examples/ci-put
220
197
  - examples/ci-sync
221
198
  - examples/config.ru
222
- - is_it_done_yet.gemspec
223
199
  - lib/is_it_done_yet.rb
224
200
  - lib/is_it_done_yet/version.rb
225
201
  - lib/is_it_done_yet/web_app.rb
@@ -228,7 +204,10 @@ licenses:
228
204
  - MIT
229
205
  metadata:
230
206
  allowed_push_host: https://rubygems.org
231
- post_install_message:
207
+ source_code_uri: http://www.github.com/beatmadsen/is_it_done_yet
208
+ changelog_uri: http://www.github.com/beatmadsen/is_it_done_yet/blob/master/CHANGELOG.md
209
+ bug_tracker_uri: http://www.github.com/beatmadsen/is_it_done_yet/issues
210
+ rubygems_mfa_required: 'true'
232
211
  rdoc_options: []
233
212
  require_paths:
234
213
  - lib
@@ -236,15 +215,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
215
  requirements:
237
216
  - - ">="
238
217
  - !ruby/object:Gem::Version
239
- version: '2.0'
218
+ version: '3.2'
240
219
  required_rubygems_version: !ruby/object:Gem::Requirement
241
220
  requirements:
242
221
  - - ">="
243
222
  - !ruby/object:Gem::Version
244
223
  version: '0'
245
224
  requirements: []
246
- rubygems_version: 3.0.3
247
- signing_key:
225
+ rubygems_version: 4.0.9
248
226
  specification_version: 4
249
227
  summary: Tracks statuses of CI build nodes
250
228
  test_files: []
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- git /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
- *.gem
13
- .byebug_history
14
-
15
- .DS_Store
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at beatmadsen@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in is_it_done_yet.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,77 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- is_it_done_yet (0.5.0)
5
- concurrent-ruby
6
- json
7
- rack-contrib
8
- rack-token_auth
9
- sinatra (~> 2.0)
10
- thin
11
-
12
- GEM
13
- remote: https://rubygems.org/
14
- specs:
15
- byebug (11.0.0)
16
- coderay (1.1.2)
17
- concurrent-ruby (1.1.5)
18
- daemons (1.3.1)
19
- diff-lcs (1.3)
20
- eventmachine (1.2.7)
21
- json (2.2.0)
22
- knapsack (1.17.1)
23
- rake
24
- method_source (0.9.2)
25
- mustermann (1.0.3)
26
- pry (0.12.2)
27
- coderay (~> 1.1.0)
28
- method_source (~> 0.9.0)
29
- rack (2.0.6)
30
- rack-contrib (2.1.0)
31
- rack (~> 2.0)
32
- rack-protection (2.0.5)
33
- rack
34
- rack-test (1.1.0)
35
- rack (>= 1.0, < 3)
36
- rack-token_auth (0.1.0)
37
- rack
38
- rake (12.3.2)
39
- rspec (3.8.0)
40
- rspec-core (~> 3.8.0)
41
- rspec-expectations (~> 3.8.0)
42
- rspec-mocks (~> 3.8.0)
43
- rspec-core (3.8.0)
44
- rspec-support (~> 3.8.0)
45
- rspec-expectations (3.8.2)
46
- diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.8.0)
48
- rspec-mocks (3.8.0)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.8.0)
51
- rspec-support (3.8.0)
52
- sinatra (2.0.5)
53
- mustermann (~> 1.0)
54
- rack (~> 2.0)
55
- rack-protection (= 2.0.5)
56
- tilt (~> 2.0)
57
- thin (1.7.2)
58
- daemons (~> 1.0, >= 1.0.9)
59
- eventmachine (~> 1.0, >= 1.0.4)
60
- rack (>= 1, < 3)
61
- tilt (2.0.9)
62
-
63
- PLATFORMS
64
- ruby
65
-
66
- DEPENDENCIES
67
- bundler
68
- byebug
69
- is_it_done_yet!
70
- knapsack
71
- pry
72
- rack-test
73
- rake
74
- rspec
75
-
76
- BUNDLED WITH
77
- 1.17.2
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
- require 'knapsack'
6
-
7
- RSpec::Core::RakeTask.new(:spec)
8
-
9
- task default: :spec
10
-
11
- Knapsack.load_tasks if defined?(Knapsack)
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'is_it_done_yet'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
data/config.ru DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler'
4
- require 'rack/contrib'
5
- require 'rack/token_auth'
6
- require 'is_it_done_yet'
7
- Bundler.require
8
-
9
- # Shared secret authentication
10
- use Rack::TokenAuth do |token, _options, _env|
11
- token == ENV['IIDY_TOKEN']
12
- end
13
-
14
- # Heartbeat endpoint
15
- map '/health_check' do
16
- run ->(_env) { [200, { 'Content-Type' => 'text/plain' }, ['success']] }
17
- end
18
-
19
- run IsItDoneYet.build_app
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'is_it_done_yet/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'is_it_done_yet'
9
- spec.version = IsItDoneYet::VERSION
10
- spec.authors = ['Erik Madsen']
11
- spec.email = ['beatmadsen@gmail.com']
12
-
13
- spec.summary = 'Tracks statuses of CI build nodes'
14
- spec.description = 'In case you need to carry out build steps in one of the nodes of your CI project after the other nodes finish, e.g. deploying, then you need a way of ascertaining the status of the other nodes. This is what is_it_done_yet is for.'
15
- spec.homepage = 'http://www.github.com/beatmadsen/is_it_done_yet'
16
- spec.license = 'MIT'
17
- spec.required_ruby_version = '>= 2.0'
18
-
19
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
- # to allow pushing to a single host or delete this section to allow pushing to any host.
21
- if spec.respond_to?(:metadata)
22
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
- else
24
- raise 'RubyGems 2.0 or newer is required to protect against ' \
25
- 'public gem pushes.'
26
- end
27
-
28
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
29
- f.match(%r{^(test|spec|features)/}) ||
30
- f.match(/knapsack/) ||
31
- f.match(/travis/)
32
- end
33
- spec.bindir = 'bin'
34
- spec.require_paths = ['lib']
35
-
36
- # Always
37
- spec.add_dependency 'concurrent-ruby'
38
- spec.add_dependency 'json'
39
- spec.add_dependency 'rack-contrib'
40
- spec.add_dependency 'rack-token_auth'
41
- spec.add_dependency 'sinatra', '~> 2.0'
42
- spec.add_dependency 'thin'
43
-
44
- # Development
45
- spec.add_development_dependency 'bundler'
46
- spec.add_development_dependency 'byebug'
47
- spec.add_development_dependency 'knapsack'
48
- spec.add_development_dependency 'pry'
49
- spec.add_development_dependency 'rack-test'
50
- spec.add_development_dependency 'rake'
51
- spec.add_development_dependency 'rspec'
52
- end