Git Product home page Git Product logo

tracker_api's Introduction

TrackerApi

Gem Version Build Status Maintainability Test Coverage

This gem allows you to easily use the Pivotal Tracker v5 API.

It’s powered by Faraday and Virtus.

Compatibility

This gem is tested against the following officially supported Ruby versions:

  • Minimum Ruby Version: 2.7.x
  • Latest Ruby Supported: 3.2.x

Installation

Add this line to your application's Gemfile:

gem 'tracker_api'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install tracker_api

Basic Usage

client = TrackerApi::Client.new(token: 'my-api-token')                    # Create API client

client.me.email                                                           # Get email for the authenticated person
client.activity                                                           # Get a list of all the activity performed the authenticated person
client.notifications                                                      # Get notifications for the authenticated person

projects = client.projects                                                # Get all projects
project  = client.project(123456)                                         # Find project with given ID
project.activity                                                          # Get a list of all the activity performed on this project

project.stories                                                           # Get all stories for a project
project.stories(with_state: :unscheduled, limit: 10)                      # Get 10 unscheduled stories for a project
project.stories(filter: 'requester:OWK label:"jedi stuff"')               # Get all stories that match the given filters
project.create_story(name: 'Destroy death star')                          # Create a story with the name 'Destroy death star'

project.search('Destroy death star')                                      # Get a search result with all epics and stories relevant to the query

story = project.story(847762630)                                          # Find a story with the given ID
story.activity                                                            # Get a list of all the activity performed on this story
story.transitions                                                         # Get a list of all the story transitions on this story

story.name = 'Save the Ewoks'                                             # Update a single story attribute
story.attributes = { name: 'Save the Ewoks', description: '...' }         # Update multiple story attributes
story.add_label('Endor')                                                  # Add a new label to an existing story
story.save                                                                # Save changes made to a story

story = client.story(117596687)                                           # Get a story with story ID only

story = TrackerApi::Resources::Story.new( client:     client,
                                          project_id: 123456,
                                          id:         847762630)          # Use the Story resource to get the story
comments = story.comments                                                 #   comments without first fetching the story

comment = story.create_comment(text: "Use the force!")                    # Create a new comment on the story

comment = story.create_comment(text: "Use the force again !",             # Create a new comment on the story with
                                files: ['path/to/an/existing/file'])      #     file attachments

comment.text += " (please be careful)"
comment.save                                                              # Update text of an existing comment
comment.delete                                                            # Delete an existing comment

comment.create_attachments(files: ['path/to/an/existing/file'])           # Add attachments to existing comment
comment.delete_attachments                                                # Delete all attachments from a comment

attachments = comment.attachments                                         # Get attachments associated with a comment
attachments.first.delete                                                  # Delete a specific attachment

comment.attachments(reload: true)                                         # Re-load the attachments after modification
task = story.tasks.first                                                  # Get story tasks
task.complete = true
task.save                                                                 # Mark a task complete

review = story.reviews.first                                              # Mark a review as complete
review.status = 'pass'
review.save

epics = project.epics                                                     # Get all epics for a project
epic  = epics.first
label = epic.label                                                        # Get an epic's label

workspaces = client.workspaces                                            # Get person's multi-project workspaces

Eager Loading

See Pivotal Tracker API documentation for how to use the fields parameter.

client = TrackerApi::Client.new(token: 'my-api-token')                    # Create API client

client.project(project_id, fields: ':default,labels(name)')               # Eagerly get labels with a project
client.project(project_id, fields: ':default,epics')                      # Eagerly get epics with a project
client.project(project_id).stories(fields: ':default,tasks')              # Eagerly get stories with tasks
story.comments(fields: ':default,person')                                 # Eagerly get comments and the person that made the comment for a story

Error Handling

TrackerApi::Errors::ClientError is raised for 4xx HTTP status codes
TrackerApi::Errors::ServerError is raised for 5xx HTTP status codes

Warning

Direct mutation of an attribute value skips coercion and dirty tracking. Please use direct assignment or the specialized add_* methods to get expected behavior. https://github.com/solnic/virtus#important-note-about-member-coercions

This will cause coercion and dirty tracking to be bypassed and the new label will not be saved.

story = project.story(847762630)

label = TrackerApi::Resources::Label.new(name: 'Special Snowflake')
# BAD
story.labels << label
story.save

# GOOD
story.labels = story.labels.dup.push(label)
story.save

TODO

  • Add missing resources and endpoints
  • Add create, update, delete for resources
  • Error handling for error responses

Semantic Versioning

http://semver.org/

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards-compatible manner, and
  3. PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Contributing

Currently this client supports read-only access to Pivotal Tracker. We will be extending it as our use cases require, but are always happy to accept contributions.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

tracker_api's People

Contributors

abnegate avatar adimasuhid avatar ahmadsherif avatar bmulvihill avatar bryant1410 avatar cap10morgan avatar csepulv avatar cwperry avatar depfu[bot] avatar dpodsedly avatar drselump14 avatar forest avatar ghostsquad avatar hassaku avatar irphilli avatar jsmestad avatar jstrater avatar nicolasleger avatar pjschreifels avatar robinw777 avatar sergejovsiannikov avatar shanecav84 avatar sshaw avatar taykangsheng avatar tclem avatar timkjones avatar tlabeeuw avatar ukstudio avatar valdis avatar winston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tracker_api's Issues

Saving removes a story's labels

Steps to reproduce:

  1. Create a story with a label
  2. Load the story with tracker api
  3. Save the story without modifying any of the attributes
    --> Notice that the label is no longer present

double request when call eager loaded associations (owners, tasks, comments)

In story resource, when we eager load association (owners, tasks, comments) and the association has empty value, then it'll try to fetch the information again. Is it an expected behavior?

def owners(params = {})
     if params.blank? && @owners.present?
        @owners
     else
        @owners = Endpoints::StoryOwners.new(client).get(project_id, id, params)
     end
 end

Issue w/ JRuby cipher set

I was attempting to get this gem working with a project and ran into an issue (currently using Jruby 9.1.17.0) related to the http adapter. By default the gem will select excon adapter which throws the following error for Jruby related to ciphers.

<Faraday::ConnectionFailed wrapped=#<Excon::Error::Socket: no cipher match (OpenSSL::SSL::SSLError)>

I found this issue excon/excon#528

It seems the Excon default Cipher set is too restrictive for JRuby. We can circumvent this by specifying another adapter, but maybe if a user is on Jruby this should be by default?

Virtus patching causes unintended consequences

First off, 👍 to #98

I upgraded the tracker_api on a grape API and noticed that boolean params set to false were becoming nil. I set up a small app to demonstrate this - https://github.com/cmoylan/tracker_grape_example

# without tracker_api in the Gemfile
$ curl localhost:9292/test?my_param=false
false%
$ curl localhost:9292/test?my_param=true
true%
$ curl localhost:9292/test?my_param=asdf
my_param is invalid%


# with tracker_api in Gemfile
$ curl localhost:9292/test?my_param=false

$ curl localhost:9292/test?my_param=true
true%
$ curl localhost:9292/test?my_param=asdf
my_param is invalid%

This is happening because grape uses virtus and tracker_api is adding this bit - https://github.com/dashofcode/tracker_api/blob/master/lib/virtus/attribute/nullify_blank.rb#L17. An additional check like && output != false would solve it. Or just use this as more motivation to ditch virtus entirely.

Is the readme correct read-only support?

Currently this client supports read-only access to Pivotal Tracker. We will be extending it as our use cases require, but are always happy to accept contributions.

This seems incorrect, as further up the readme, it allows you to add labels.

Add Client#epic method

There's already a Client#story method for looking up stories without going through a Project. It would be nice to have the same capability for epics.

I'm happy to implement this myself and submit a PR if that's OK.

Update README to indicate maintainership switch + add Contrib list

SUMMARY:

It's the new year and this gem is jumpin' and jivin' and under new maintainership!

We'll add some information about protocols for contributing, set some expectations about the frequency with which you can expect us to respond, and add a list of contributors (shoulders of giants!) who made this gem what it is today.

tracker_api does not specify activemodel dependency version

tracker_api raises an exception when used with activemodel versions 3.2.x, which does not define ActiveModel::Model. The gemspec should specify a minimum version of activemodel 4.x.

~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/base.rb:10:in `<module:Base>': uninitialized constant ActiveModel::Model (NameError)
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/base.rb:7:in `<module:Resources>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/base.rb:6:in `<module:TrackerApi>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/base.rb:5:in `<top (required)>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/story.rb:4:in `<class:Story>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/story.rb:3:in `<module:Resources>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/story.rb:2:in `<module:TrackerApi>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/resources/story.rb:1:in `<top (required)>'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/endpoints/story.rb:19:in `get_story'
    from ~/.rvm/gems/ruby-2.1.5@avant_basic/gems/tracker_api-0.2.9/lib/tracker_api/client.rb:140:in `story'

My local activemodel versions:

$ gem list --local activemodel

*** LOCAL GEMS ***

activemodel (3.2.21, 3.2.19)

Workaround

To work around this issue, update activemodel:

gem update activemodel

Original label is removed upon saving a previously pulled story

Hey,
not sure if i'm using the gem in the right way.

these are they steps:

client = TrackerApi::Client.new token: token
project = client.project project_id
story = project.story story_id

story.create_comment text: comment_text
story.estimate = estimation
story.current_state = new_state
story.save
  • comment is created
  • new state is set
  • estimate is changed

but also the original label is gone. btw, the label also represents an epic.

i'm following a quite procedural approach here, so maybe there's the problem?

5xx responses from API should raise a TransientError

I would love to see 5xx responses raise a TrackerApi::TransientError to let client code handle transient errors (timeouts, etc) differently than permanent errors (auth problems, bad requests, etc). For example, I would like to retry if there is a transient error, but not if there is a permanent error.

TrackerApi::TransientError could be a child of TrackerApi::Error to preserve compatibility with existing client code.

Here are a few examples of errors our app has reported. I'm assuming that these responses were accompanied by an appropriate 5xx HTTP status code.

A TrackerApi::Error occurred in background at 2016-01-20 08:29 :

  757: unexpected token at '<h1>This website is under heavy load</h1><p>We're sorry, too many people are accessing this website at the same time. We're working on this problem. Please try again later.</p>'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/client.rb:207:in `rescue in request'
  A TrackerApi::Error occurred in background at 2016-02-04 07:11 :

  757: unexpected token at '<html><body><h1>504 Gateway Time-out</h1>
The server didn't respond in time.
</body></html>

'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/client.rb:207:in `rescue in request'

Limit is overruled by paginate

When I just want the 2 first unstarted stories, I get all of them. I think it is because the limit I set is overruled by the paginate method of the endpoint.

story add_label fails when there is no existing labels

Try on a story with no existing labels

s = client.story('__id__')
s.labels    # => nil
s.add_label("foo")  # => TypeError: can't dup NilClass
from ...tracker_api-1.4.0/lib/tracker_api/resources/story.rb:77:in `dup'

Note if the story has existing label, add_label works fine

Project labels broken

Labels on the project only returns an empty array. The reason is the API no longer has labels directly on the project response. A separate call to projects/{project_id}/labels needs to happen.
I have submitted a pull request for the fix.

A TrackerApi::Error occurred in background at 2016-01-20 08:47

 A TrackerApi::Error occurred in background at 2016-01-20 08:47 757: unexpected token at '<h1>This website is under heavy load</h1><p>We're sorry, too many people are accessing this website at the same time. We're working on this problem. Please try again later.</p>'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/client.rb:207:in `rescue in request'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/client.rb:187:in `request'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/client.rb:57:in `get'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/endpoints/story.rb:11:in `get'
  /app/vendor/bundle/ruby/2.2.0/gems/tracker_api-0.2.11/lib/tracker_api/resources/project.rb:141:in `story'
  /app/app/services/pivotal/price_tags/project_updater.rb:127:in `update_story'

This is the same error noted in Issue #61. It's actually a JSON::Parser error. I'll try to get a PR to handle it by the end of the week.

Fetching tasks give an invalid endpoint error

When fetching a story, and calling story.tasks the code gives an error:

{:status=>404, :headers=>{"server"=>"nginx/1.6.0", "date"=>"Fri, 26 Sep 2014 06:22:49 GMT", "content-type"=>"application/octet-stream", "content-length"=>"135", "connection"=>"close", "etag"=>"\"5314f7e6-87\""}, :body=>{"code"=>"route_not_found", "error"=>"The path you requested has no valid endpoint.", "kind"=>"error", "http_status"=>"404"}}
tracker_api-0.2.5/lib/tracker_api/client.rb:162:in `rescue in request'
tracker_api-0.2.5/lib/tracker_api/client.rb:149:in `request'
tracker_api-0.2.5/lib/tracker_api/client.rb:70:in `paginate'
tracker_api-0.2.5/lib/tracker_api/endpoints/tasks.rb:11:in `get'
tracker_api-0.2.5/lib/tracker_api/resources/story.rb:43:in `tasks'

It does not matter if you include tasks in the list of fields when fetching a story.

Unable to add a comment to a story

I am trying to add comments to a group of stories and have tried this code with no luck:

require 'tracker_api'
client = TrackerApi::Client.new(token: '<token>')

pivotal_project_id = <project_id>
project = client.project(pivotal_project_id)
stories = project.stories(filter: 'label:"label-here"')

stories.each do |story|
  comment = story.create_comment(text: "<text for the comment>")
  comment.save
end

I get this error:

Uncaught exception: {:status=>400, :headers=>{"Access-Control-Allow-Credentials"=>"false", "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", "Access-Control-Allow-Methods"=>"GET, POST, PUT, DELETE, OPTIONS", "Access-Control-Allow-Origin"=>"*", "Cache-Control"=>"no-cache", "Content-Type"=>"application/json; charset=utf-8", "Date"=>"Wed, 23 Nov 2016 22:46:13 GMT", "Server"=>"nginx + Phusion Passenger", "Status"=>"400 Bad Request", "Strict-Transport-Security"=>"max-age=31536000; includeSubDomains; preload", "X-Powered-By"=>"Phusion Passenger", "X-Rack-Cache"=>"invalidate, pass", "X-Request-Id"=>"009812c3d881dea8169e96255fa3c16b", "X-Runtime"=>"0.029599", "X-Tracker-Client-Pinger-Interval"=>"20", "X-Ua-Compatible"=>"IE=Edge,chrome=1", "X-Vcap-Request-Id"=>"b4e855a2-1b44-42c0-7f42-14a7d7c3d41e", "Content-Length"=>"290", "Connection"=>"keep-alive"}, :body=>{"code"=>"invalid_parameter", "kind"=>"error", "error"=>"One or more request parameters was missing or invalid.", "general_problem"=>"this endpoint requires at least one of the following parameters: file_attachment_ids_to_add, file_attachment_ids_to_remove, google_attachment_ids_to_remove, text"}}

Any help is appreciated, I was trying to follow this example:

comment = story.create_comment(text: "Use the force!")                    # Create a new comment on the story

comment.text += " (please be careful)"
comment.save                                                              # Update text of an existing comment

I hope I'm just missing something obvious. :)

Monkeypatch of Virtus for empty arrays to be coerced to nil causes unintended consequences

There was a similar issue with #113 which was fixed by patching the monkeypatch. But we are using a gem which expects empty arrays to stay as empty arrays.

The discussion here: 27599e7#r16125838 suggests that the required coercion is different from what Virtus does.

My suggestion is to create the NullifyEmpty class as suggested and move TrackerAPI specific behavior into it. Otherwise TrackerAPI is conflicting with other gems.

The behavior needed is a Custom Coersion which would be added to the Shared::Base

Integrating blockers

Dear forest,

thanks for creating this integration, well documented with good examples and annotated code. I'm currently working on a PDF-generation and was wondering if the relatively new Blockers features is something you're planning on integrating. If not, I'd start working it and submit a PR, but wanted to check in with you first. Blockers is currently marked BETA on the v5 API but is already documented (https://www.pivotaltracker.com/help/api/rest/v5#projects_project_id_stories_story_id_blockers_get).
Not sure wether it is a good idea to start implementing a beta feature at this point.

Thank you 👍

Tim

How do I remove a story's estimate?

Steps to reproduce:

story = project.create_story(name: 'Some story name')
story.estimate = 3.0
story.save
story.estimate      # => 3.0
story.estimate = nil
story.save
story.estimate      # => 3.0

I think the issue is:

https://gist.github.com/jasonnoble/80e618cf39874d26bdae884b4e79b33f#file-gistfile1-txt-L43 (works to set estimate to 3.0)

vs

https://gist.github.com/jasonnoble/80e618cf39874d26bdae884b4e79b33f#file-gistfile1-txt-L78 (does not include the request to set estimate to nil)

Long-running requests

Experiencing some very weird behaviour. A request like like this one:

TrackerApi::Client.new(token: '...').projects

…is taking about 4 minutes to complete (see log below). The response headers is reported a 0.06 second response time and the equivalent curl command is almost instantaneous.

Is there anything that could be causing this?


I, [2015-06-23T13:49:38.240879 #40724]  INFO -- : get => https://www.pivotaltracker.com/services/v5/projects
D, [2015-06-23T13:49:38.240960 #40724] DEBUG -- request: User-Agent: "Ruby/2.2.2 (x86_64-darwin14; ruby) TrackerApi/0.2.9 Faraday/0.9.1"
X-TrackerToken: "..."
D, [2015-06-23T13:49:38.240989 #40724] DEBUG -- request.body: nil

...big delay...

I, [2015-06-23T13:53:24.791875 #40724]  INFO -- : 200 <= https://www.pivotaltracker.com/services/v5/projects
D, [2015-06-23T13:53:24.792010 #40724] DEBUG -- response: Content-Type: "application/json; charset=utf-8"
Status: "200 OK"
X-UA-Compatible: "IE=Edge,chrome=1"
ETag: "\"e19989034c2a0da8d08d41ac291ad561\""
Cache-Control: "max-age=0, private, must-revalidate"
X-Request-Id: "8ea5da95a43d099af46b83da01c06900"
X-Runtime: "0.068376"
Date: "Tue, 23 Jun 2015 19:53:21 GMT"
X-Rack-Cache: "miss"
X-Powered-By: "Phusion Passenger 4.0.41"
Server: "nginx/1.6.0 + Phusion Passenger 4.0.41"
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: "12"

Fetch Story without project_id

Is there a way to fetch a story from pivotal without using a project_id.
I have multiple projects and don't want to fetch them and iterate over them.

The activity method occurs `NameError`

When I call client.activity at first, it occurs NameError: uninitialized constant TrackerApi::Resources::Activity::Virtus.

Reproduce

$ rake test TEST=test/client_test.rb TESTOPTS='--name="TrackerApi::Client::.activity#test_0001_gets all my activities"'
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Run options: "--name=TrackerApi::Client::.activity#test_0001_gets all my activities" --seed 24196

# Running:

E

Finished in 0.020668s, 48.3845 runs/s, 0.0000 assertions/s.

  1) Error:
TrackerApi::Client::.activity#test_0001_gets all my activities:
NameError: uninitialized constant TrackerApi::Resources::Activity::Virtus
    /Users/tshotoku/src/tracker_api/lib/tracker_api/resources/activity.rb:4:in `<class:Activity>'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/resources/activity.rb:3:in `<module:Resources>'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/resources/activity.rb:2:in `<module:TrackerApi>'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/resources/activity.rb:1:in `<top (required)>'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/endpoints/activity.rb:15:in `require'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/endpoints/activity.rb:15:in `block in get'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/endpoints/activity.rb:14:in `map'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/endpoints/activity.rb:14:in `get'
    /Users/tshotoku/src/tracker_api/lib/tracker_api/client.rb:203:in `activity'
    /Users/tshotoku/src/tracker_api/test/client_test.rb:214:in `block (4 levels) in <top (required)>'
    /Users/tshotoku/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/vcr-3.0.3/lib/vcr/util/variable_args_block_caller.rb:9:in `call_block'
    /Users/tshotoku/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/vcr-3.0.3/lib/vcr.rb:189:in `use_cassette'
    /Users/tshotoku/src/tracker_api/test/client_test.rb:213:in `block (3 levels) in <top (required)>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

Adding comments to a story

First off thanks for all the work -- we recently updated to the v5 api and this gem has been super helpful.

It looks to me like there's no way currently in this gem to add comments to a story. I'm happy to help implement that feature but I wanted to first check that I wasn't missing something obvious or looking in the wrong place.

I think the closest pattern to copy here is how story tasks work, so just implement save/update on Comment. Does that sound right?

Thanks again ❤️

Add integration resource and end points

Need to add:

  1. Resource integration
  2. End point - integrations list
  3. Ability to select integration by id
  4. Ability to create new integrations
  5. Ability to update integration
  6. Ability to delete integration
  7. Ability to get stories list for selected integration

Compare Person objects by their id

Two distinct copies of Person objects should compare true via == based upon their id. This would permit one to create a set of Person objects rather than maintaining a set of Person IDs and a separate mapping of ids back to the Person object.

Other objects could probably benefit from a similar addition.

Dependency on mimemagic but the author has removed it

Your bundle is locked to mimemagic (0.3.5), but that version could not be found
in any of the sources listed in your Gemfile. If you haven't changed sources,
that means the author of mimemagic (0.3.5) has removed it. You'll need to update
your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
in order to install.

Hi folks, is it viable to remove the dependency on mimemagic? Thank you!
Related: rails/rails#41750

project.search method does not work

I tried using this wrapper's search method with no luck. I tried

project.search('Destroy death star')

after setting up the client and the project variables correctly.

Tests running slow.

Tests on my machine are running super slow:

$ rake
/Users/tsaleh/.rbenv/versions/2.1.2/bin/ruby -I"lib:lib:test" -I"/Users/tsaleh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.3.2/lib" "/Users/tsaleh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb" "test/client_test.rb" "test/project_test.rb" "test/story_test.rb"
Run options: --seed 61100

# Running:

.................

Finished in 54.092713s, 0.3143 runs/s, 1.1832 assertions/s.

17 runs, 64 assertions, 0 failures, 0 errors, 0 skips`

Feels to me like VCR is hitting the network each time, but I can't imagine why. I'm not super familiar with VCR... Any tips on debugging this?

Error when trying to retrieve a story

When trying to access an individual story, I get:

>>> @pivotal.project.story(123)
NameError: uninitialized constant TrackerApi::Endpoints::Story
Did you mean?  TrackerApi::Endpoints::Stories
from /GEM_PATH_HERE/tracker_api-0.1.0/lib/tracker_api/resources/project.rb:82

Doing a manual require 'tracker_api/endpoints/story' fixes the issue though. It seems to be related to the autoloading, I believe?

Can't move story between projects

Seems like if I set the project_id for some story it fails to update the resource: it tries to PUT the story on a nested route under the new project_id, which will fail with a 404 since that story doesn't belong to that project.

Is there any know workaround for this or it'll require some tweaking on the Story object?

Stories are not being populated with `fields` information

Hi there! I'm trying to read some project stories, and also bring the "owned_by" field among others. The API seems to be responding correctly, but the objects are not being populated with that info.

project.stories(filter:filter, fields:':default,name,description,requested_by,owned_by')

This is the result

{
"kind"=>"story",
"id"=>84214708,
"created_at"=>"2014-12-09T15:53:40Z",
"updated_at"=>"2014-12-11T18:06:32Z",
"estimate"=>3,
"story_type"=>"feature",
"name"=>
 "As a user I should be able to re-login easily if my session expired ",
"description"=>
 "Design: xxxxxxx",
"current_state"=>"started",
"requested_by_id"=>1486154,
"project_id"=>1168276,
"url"=>"xxxxxxx",
"requested_by"=>
 {"kind"=>"person",
  "id"=>1486154,
  "name"=>"Emiliano Jankowski",
  "initials"=>"EJ",
  "username"=>"emilianoj"},
"owned_by"=>
 {"kind"=>"person",
  "id"=>1486158,
  "name"=>"Lucas Perez",
  "initials"=>"LP",
  "username"=>"lucasperez"},
"owner_ids"=>[1486158],
"labels"=>
 [{"id"=>9865170,
   "project_id"=>1168276,
   "kind"=>"label",
   "name"=>"portal",
   "created_at"=>"2014-10-30T20:46:16Z",
   "updated_at"=>"2014-10-30T20:46:16Z"}]
}

And the object:

@comment_ids=[],
 @created_at=
  #<DateTime: 2014-12-02T23:24:02+00:00 ((2456994j,84242s,0n),+0s,2299161j)>,
 @current_state="started",
 @deadline=nil,
 @description=nil,
 @estimate=2.0,
 @external_id=nil,
 @follower_ids=[],
 @id=83807052,
 @integration_id=nil,
 @kind="story",
 @label_ids=[],
 @labels=
  [#<TrackerApi::Resources::Label:0x007fdbec528e90
    @created_at=
     #<DateTime: 2014-11-17T21:39:13+00:00 ((2456979j,77953s,0n),+0s,2299161j)>,
    @id=10016792,
    @kind="label",
    @name="staff-portal",
    @project_id=1168276,
    @updated_at=
     #<DateTime: 2014-11-17T21:39:13+00:00 ((2456979j,77953s,0n),+0s,2299161j)>>],
 @name=
  "As a staff user I should be able to see a list of projects for each user",
 @owned_by_id=nil,
 @owners=[],
 @planned_iteration_number=nil,
 @project_id=1168276,
 @requested_by_id=1486154,
 @story_type="feature",
 @task_ids=[],
 @tasks=[],
 @updated_at=

Is it an issue or is there any other way of reading that info?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.