tracker_api 1.13.0 → 1.14.0

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: 6d6e9b2c5ba26b416431288d39fe55c9309b753f8ba59572975cf5f424a328a4
4
- data.tar.gz: 18f138d620e770815349ddad72c728055c7ca35cfdfa89170daf410c4f3db39e
3
+ metadata.gz: 849c1d3fe22b5b812ed7144d3d0703a7a6f3701d575f5d794cf9f9dc8caf6643
4
+ data.tar.gz: d142dccb5a2eec0474e54262f351e4ea148651dd7c0c7a28fcb93acdbb9f3d25
5
5
  SHA512:
6
- metadata.gz: fbd90b8f2549b18d5d22f4f1dbf743db182db643be68b4920daaff25f68ebdf3664785903118afc106edf44ae58474e54ac1b582e3b063428f7e6c5f47ec1096
7
- data.tar.gz: ab1c688fbf08697ecb2705031f82a842357756ff812e0295ffd1dcbac43131db038379225e4265bc554fdc16852af8a205a16d2c0a46978024ee4a5a29cae84a
6
+ metadata.gz: 62a6cab610b4c3e4b43ff6b7ca007e477e0478e6c1e3821b2d49a1052a830d030dbf7bfcebb91158a2493cc589e8d7ca0155f3621a0e52119ff40fba560a243a
7
+ data.tar.gz: a030d836b14d017f57c2eaf91f12cb7b9202c23a0cabd6e2e08b425c5185f10cb477b1ec3e598c19cdf63889dcaf23ae5c3ede9dfdc28adc562aac4f9785ad17
@@ -9,11 +9,24 @@ on:
9
9
  jobs:
10
10
  test:
11
11
 
12
+ name: Specs - Ruby ${{ matrix.ruby-version }} ${{matrix.gemfile}}
12
13
  runs-on: ubuntu-latest
14
+ env:
15
+ CC_TEST_REPORTER_ID: 2a6849be8214739deef0090b810b945ce9a550a4d8279d242cb03242d1ad53c5
16
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
13
17
 
14
18
  strategy:
15
19
  matrix:
16
- ruby-version: [2.7, 2.6, 2.5]
20
+ gemfile:
21
+ - faraday-1
22
+ - faraday-2
23
+ ruby-version:
24
+ - "3.1"
25
+ - "3.0"
26
+ - "2.7"
27
+ - "2.6"
28
+ - jruby
29
+ - truffleruby
17
30
 
18
31
  steps:
19
32
  - uses: actions/checkout@v2
@@ -26,9 +39,5 @@ jobs:
26
39
  - name: Run tests
27
40
  run: bundle exec rake test
28
41
  - name: Upload Coverage
29
- uses: paambaati/codeclimate-action@v2.7.5
30
- env:
31
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
32
- with:
33
- coverageLocations: ${{github.workspace}}/coverage/.resultset.json:simplecov
34
- if: matrix.ruby-version == '2.7'
42
+ uses: paambaati/codeclimate-action@v3.0.0
43
+ if: matrix.ruby-version == '3.1' && matrix.gemfile == 'faraday-2'
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in tracker_api.gemspec
4
4
  gemspec
5
-
6
- # pinned until code climate figures out the new output format https://github.com/codeclimate/test-reporter/issues/418
7
- gem 'simplecov', '< 0.18', require: false, group: :test
data/LICENSE.txt CHANGED
@@ -1,22 +1,21 @@
1
- Copyright (c) 2014 Dash of Code
2
-
3
1
  MIT License
4
2
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
3
+ Copyright (c) [2021] [ProductPlan]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TrackerApi
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/tracker_api.png)](http://badge.fury.io/rb/tracker_api)
3
+ [![Gem Version](https://badge.fury.io/rb/tracker_api.svg)](http://badge.fury.io/rb/tracker_api)
4
4
  [![Build Status](https://github.com/ProductPlan/tracker_api/actions/workflows/ruby-tests.yml/badge.svg?branch=master)](https://github.com/ProductPlan/tracker_api/actions)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/c4602f519cd748d53492/maintainability)](https://codeclimate.com/github/ProductPlan/tracker_api/maintainability)
6
6
  [![Test Coverage](https://api.codeclimate.com/v1/badges/c4602f519cd748d53492/test_coverage)](https://codeclimate.com/github/ProductPlan/tracker_api/test_coverage)
@@ -9,8 +9,11 @@ This gem allows you to easily use the [Pivotal Tracker v5 API](https://www.pivot
9
9
 
10
10
  It’s powered by [Faraday](https://github.com/lostisland/faraday) and [Virtus](https://github.com/solnic/virtus).
11
11
 
12
- ## Demonstration
13
- [Dash of Agile](https://www.dashofagile.com) uses `tracker_api` to create agile dashboards from Pivotal Tracker projects.
12
+ ## Compatibility
13
+
14
+ This gem is tested against the following officially supported Ruby versions:
15
+ - Minimum Ruby Version: 2.6.x
16
+ - Latest Ruby Supported: 3.1.x
14
17
 
15
18
  ## Installation
16
19
 
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'faraday', '~> 1.10'
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'faraday', '~> 2.2'
4
+
5
+ gemspec path: '../'
@@ -25,7 +25,7 @@ module TrackerApi
25
25
  @url = Addressable::URI.parse(url).to_s
26
26
  @api_version = options.fetch(:api_version, '/services/v5')
27
27
  @logger = options.fetch(:logger, ::Logger.new(nil))
28
- adapter = options.fetch(:adapter) { defined?(JRUBY_VERSION) ? :net_http : :excon }
28
+ adapter = options.fetch(:adapter, :net_http)
29
29
  connection_options = options.fetch(:connection_options, { ssl: { verify: true } })
30
30
  @auto_paginate = options.fetch(:auto_paginate, true)
31
31
  @token = options[:token]
@@ -1,5 +1,5 @@
1
1
  module TrackerApi
2
- class Logger < Faraday::Response::Middleware
2
+ class Logger < Faraday::Middleware
3
3
  extend Forwardable
4
4
 
5
5
  def initialize(app, logger = nil)
@@ -0,0 +1,22 @@
1
+ module TrackerApi
2
+ module Resources
3
+ class PullRequest
4
+ include Shared::Base
5
+
6
+ attribute :client
7
+
8
+ attribute :id, Integer
9
+ attribute :story_id, Integer
10
+ attribute :epic_id, Integer
11
+ attribute :owner, String
12
+ attribute :repo, String
13
+ attribute :number, Integer
14
+ attribute :host_url, String
15
+ attribute :original_url, String
16
+ attribute :status, String
17
+ attribute :created_at, DateTime
18
+ attribute :updated_at, DateTime
19
+ attribute :kind, String
20
+ end
21
+ end
22
+ end
@@ -30,6 +30,7 @@ module TrackerApi
30
30
  attribute :owners, [Person]
31
31
  attribute :planned_iteration_number, Integer
32
32
  attribute :project_id, Integer
33
+ attribute :pull_requests, [PullRequest]
33
34
  attribute :requested_by, Person
34
35
  attribute :requested_by_id, Integer
35
36
  attribute :reviews, [Review]
@@ -1,3 +1,3 @@
1
1
  module TrackerApi
2
- VERSION = '1.13.0'
2
+ VERSION = '1.14.0'
3
3
  end
data/lib/tracker_api.rb CHANGED
@@ -2,7 +2,7 @@ require 'tracker_api/version'
2
2
 
3
3
  # dependencies
4
4
  require 'faraday'
5
- require 'faraday_middleware'
5
+ require 'faraday/multipart'
6
6
  require 'pathname'
7
7
  require 'mini_mime'
8
8
 
@@ -90,6 +90,7 @@ module TrackerApi
90
90
  autoload :PrimaryResource, 'tracker_api/resources/primary_resource'
91
91
  autoload :Project, 'tracker_api/resources/project'
92
92
  autoload :ProjectMembership, 'tracker_api/resources/project_membership'
93
+ autoload :PullRequest, 'tracker_api/resources/pull_request'
93
94
  autoload :Workspace, 'tracker_api/resources/workspace'
94
95
  autoload :SearchResultContainer, 'tracker_api/resources/search_result_container'
95
96
  autoload :StoriesSearchResult, 'tracker_api/resources/stories_search_result'
data/test/story_test.rb CHANGED
@@ -319,4 +319,16 @@ describe TrackerApi::Resources::Story do
319
319
  end
320
320
  end
321
321
  end
322
+
323
+ describe '.pull_requests' do
324
+ it 'gets all pull requests for the story' do
325
+ pull_requests = VCR.use_cassette('get story with pull requests', record: :new_episodes) do
326
+ project.story(story_id, fields: ':default,pull_requests').pull_requests
327
+ end
328
+
329
+ _(pull_requests).wont_be_empty
330
+ pull_request = pull_requests.first
331
+ _(pull_request).must_be_instance_of TrackerApi::Resources::PullRequest
332
+ end
333
+ end
322
334
  end
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004?fields=%3Adefault%2Cpull_requests","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.7.2 (x86_64-darwin19; ruby) TrackerApi/1.13.0 Faraday/1.4.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Accept":["application/json"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Content-Type":["application/json; charset=utf-8"],"Status":["200 OK"],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Tracker-Project-Version":["728"],"X-Request-Id":["e17a5715-671b-487e-b1c2-561cc87c09bd"],"ETag":["W/\"d8502383608d12d511d24d83e41e7948\""],"X-Frame-Options":["SAMEORIGIN"],"X-Runtime":["0.066465"],"X-Content-Type-Options":["nosniff, nosniff"],"Date":["Fri, 23 Apr 2021 21:44:02 GMT"],"X-Powered-By":["Phusion Passenger"],"Server":["nginx + Phusion Passenger"],"Access-Control-Allow-Origin":["*"],"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"X-Tracker-Client-Pinger-Interval":["20"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-XSS-Protection":["1; mode=block"],"Via":["1.1 google"],"Alt-Svc":["clear"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"story\",\"id\":66728004,\"created_at\":\"2014-02-17T00:00:00Z\",\"updated_at\":\"2021-04-23T21:23:18Z\",\"story_type\":\"bug\",\"name\":\"Some product photos not scaled properly when browsing products+++++++++++++++++++++++++++\",\"description\":\"++++++++++++++++\",\"current_state\":\"started\",\"requested_by_id\":1266314,\"url\":\"https://www.pivotaltracker.com/story/show/66728004\",\"project_id\":1027488,\"owner_ids\":[1266314,1266316],\"labels\":[{\"id\":11049870,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label2\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"id\":14060665,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"super-special-label\",\"created_at\":\"2016-02-12T23:45:13Z\",\"updated_at\":\"2016-02-12T23:45:13Z\"}],\"pull_requests\":[{\"id\":1606521,\"kind\":\"pull_request\",\"story_id\":66728004,\"owner\":\"ProductPlan\",\"repo\":\"tracker_api\",\"host_url\":\"https://github.com/\",\"original_url\":\"https://github.com/ProductPlan/tracker_api/pull/148\",\"status\":\"unknown\",\"number\":148,\"created_at\":\"2021-04-23T21:23:18Z\",\"updated_at\":\"2021-04-23T21:23:18Z\"}],\"owned_by_id\":1266314}"}},"recorded_at":"Fri, 23 Apr 2021 21:44:02 GMT"}],"recorded_with":"VCR 6.0.0"}
data/tracker_api.gemspec CHANGED
@@ -6,11 +6,11 @@ require 'tracker_api/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'tracker_api'
8
8
  spec.version = TrackerApi::VERSION
9
- spec.authors = ['Forest Carlisle']
10
- spec.email = ['forestcarlisle@gmail.com']
9
+ spec.authors = ['ProductPlan']
10
+ spec.email = ['development@productplan.com']
11
11
  spec.summary = %q{API client for the Pivotal Tracker v5 API}
12
12
  spec.description = %q{This gem allows you to easily use the Pivotal Tracker v5 API.}
13
- spec.homepage = 'https://github.com/dashofcode/tracker_api'
13
+ spec.homepage = 'https://github.com/ProductPlan/tracker_api'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -24,13 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'mocha'
25
25
  spec.add_development_dependency 'awesome_print'
26
26
  spec.add_development_dependency 'vcr'
27
+ spec.add_development_dependency 'simplecov'
27
28
  # spec.add_development_dependency 'minitest-byebug'
28
29
 
29
30
  spec.add_dependency 'addressable'
30
31
  spec.add_dependency 'virtus'
31
- spec.add_dependency 'faraday'
32
- spec.add_dependency 'faraday_middleware'
33
- spec.add_dependency 'excon'
32
+ spec.add_dependency 'faraday', ['>= 1.10', '< 3.0']
33
+ spec.add_dependency 'faraday-multipart'
34
34
  spec.add_dependency 'equalizer'
35
35
  spec.add_dependency 'representable'
36
36
  spec.add_dependency 'multi_json'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
- - Forest Carlisle
8
- autorequire:
7
+ - ProductPlan
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,13 +95,13 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: addressable
98
+ name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
- type: :runtime
104
+ type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: virtus
112
+ name: addressable
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: faraday
126
+ name: virtus
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,21 +137,27 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: faraday_middleware
140
+ name: faraday
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '1.10'
146
+ - - "<"
147
+ - !ruby/object:Gem::Version
148
+ version: '3.0'
146
149
  type: :runtime
147
150
  prerelease: false
148
151
  version_requirements: !ruby/object:Gem::Requirement
149
152
  requirements:
150
153
  - - ">="
151
154
  - !ruby/object:Gem::Version
152
- version: '0'
155
+ version: '1.10'
156
+ - - "<"
157
+ - !ruby/object:Gem::Version
158
+ version: '3.0'
153
159
  - !ruby/object:Gem::Dependency
154
- name: excon
160
+ name: faraday-multipart
155
161
  requirement: !ruby/object:Gem::Requirement
156
162
  requirements:
157
163
  - - ">="
@@ -222,7 +228,7 @@ dependencies:
222
228
  version: '0'
223
229
  description: This gem allows you to easily use the Pivotal Tracker v5 API.
224
230
  email:
225
- - forestcarlisle@gmail.com
231
+ - development@productplan.com
226
232
  executables: []
227
233
  extensions: []
228
234
  extra_rdoc_files: []
@@ -234,6 +240,8 @@ files:
234
240
  - LICENSE.txt
235
241
  - README.md
236
242
  - Rakefile
243
+ - gemfiles/faraday-1.gemfile
244
+ - gemfiles/faraday-2.gemfile
237
245
  - lib/core_ext/object/blank.rb
238
246
  - lib/tracker_api.rb
239
247
  - lib/tracker_api/client.rb
@@ -290,6 +298,7 @@ files:
290
298
  - lib/tracker_api/resources/primary_resource.rb
291
299
  - lib/tracker_api/resources/project.rb
292
300
  - lib/tracker_api/resources/project_membership.rb
301
+ - lib/tracker_api/resources/pull_request.rb
293
302
  - lib/tracker_api/resources/release.rb
294
303
  - lib/tracker_api/resources/review.rb
295
304
  - lib/tracker_api/resources/review_type.rb
@@ -372,6 +381,7 @@ files:
372
381
  - test/vcr/cassettes/get_story_reviews.json
373
382
  - test/vcr/cassettes/get_story_transitions.json
374
383
  - test/vcr/cassettes/get_story_with_owners.json
384
+ - test/vcr/cassettes/get_story_with_pull_requests.json
375
385
  - test/vcr/cassettes/get_story_with_tasks.json
376
386
  - test/vcr/cassettes/get_tasks.json
377
387
  - test/vcr/cassettes/get_tasks_for_story.json
@@ -451,11 +461,11 @@ files:
451
461
  - test/vcr/x-cassettes/update_story_to_create_activity.json
452
462
  - test/workspace_test.rb
453
463
  - tracker_api.gemspec
454
- homepage: https://github.com/dashofcode/tracker_api
464
+ homepage: https://github.com/ProductPlan/tracker_api
455
465
  licenses:
456
466
  - MIT
457
467
  metadata: {}
458
- post_install_message:
468
+ post_install_message:
459
469
  rdoc_options: []
460
470
  require_paths:
461
471
  - lib
@@ -470,8 +480,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
470
480
  - !ruby/object:Gem::Version
471
481
  version: '0'
472
482
  requirements: []
473
- rubygems_version: 3.1.4
474
- signing_key:
483
+ rubygems_version: 3.2.32
484
+ signing_key:
475
485
  specification_version: 4
476
486
  summary: API client for the Pivotal Tracker v5 API
477
487
  test_files:
@@ -541,6 +551,7 @@ test_files:
541
551
  - test/vcr/cassettes/get_story_reviews.json
542
552
  - test/vcr/cassettes/get_story_transitions.json
543
553
  - test/vcr/cassettes/get_story_with_owners.json
554
+ - test/vcr/cassettes/get_story_with_pull_requests.json
544
555
  - test/vcr/cassettes/get_story_with_tasks.json
545
556
  - test/vcr/cassettes/get_tasks.json
546
557
  - test/vcr/cassettes/get_tasks_for_story.json