This repository was archived by the owner on Apr 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
Fix labels being removed when other fields are updated but labels is not changed. #106
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ba73645
Test to verify lables are not removed when other fields are updated.
forest e89374d
Check more label conditions.
forest 531c2c1
Default labels to nil instead of empty array
forest ba64193
Use the latest dist for CI
forest a68c973
Turn off test task warning to make CI happy
forest 1c4dec4
Typo
forest 6a56a65
Update rubys for building
forest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
test/vcr/cassettes/client_get_limited_stories_with_no_pagination.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/epics/1087314?fields=%3Adefault%2Clabel_id","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.2.3 (x86_64-darwin15; ruby) TrackerApi/0.2.12 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Content-Type":["application/json; charset=utf-8"],"Status":["200 OK"],"Cache-Control":["max-age=0, private, must-revalidate"],"Date":["Sat, 13 Feb 2016 23:35:52 GMT"],"X-Tracker-Project-Version":["110"],"X-Request-Id":["798d97291a0d37c3945ad19ecb8ca7cc"],"X-UA-Compatible":["IE=Edge,chrome=1"],"ETag":["\"16fa2db17e653781a8158dcd83c85549\""],"X-Runtime":["0.056851"],"X-Rack-Cache":["miss"],"X-Powered-By":["Phusion Passenger Enterprise"],"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":["12"]},"body":{"encoding":"UTF-8","string":"{\"id\":1087314,\"kind\":\"epic\",\"created_at\":\"2014-03-02T07:11:07Z\",\"updated_at\":\"2014-03-02T07:11:07Z\",\"project_id\":1027488,\"name\":\"Admin Users\",\"label_id\":7849080,\"description\":\"Get the Admin users working on the site\",\"url\":\"https://www.pivotaltracker.com/epic/show/1087314\",\"label\":{\"id\":7849080,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"admin\",\"created_at\":\"2014-03-02T07:11:04Z\",\"updated_at\":\"2014-03-02T07:11:04Z\"}}"},"http_version":null},"recorded_at":"Sat, 13 Feb 2016 23:35:52 GMT"}],"recorded_with":"VCR 2.9.3"} | ||
{"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/epics/1087314?fields=%3Adefault%2Clabel_id","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.3.1 (x86_64-darwin15; ruby) TrackerApi/1.7.0 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"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":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 03 May 2017 23:29:50 GMT"],"Etag":["\"16fa2db17e653781a8158dcd83c85549\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["83a1d5edaef1ef6083fcb6068dd06bfb"],"X-Runtime":["0.057815"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["241"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["102072a1-25b8-4ba6-4773-560f7eb224b8"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["420"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"id\":1087314,\"kind\":\"epic\",\"created_at\":\"2014-03-02T07:11:07Z\",\"updated_at\":\"2014-03-02T07:11:07Z\",\"project_id\":1027488,\"name\":\"Admin Users\",\"label_id\":7849080,\"description\":\"Get the Admin users working on the site\",\"url\":\"https://www.pivotaltracker.com/epic/show/1087314\",\"label\":{\"id\":7849080,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"admin\",\"created_at\":\"2014-03-02T07:11:04Z\",\"updated_at\":\"2014-03-02T07:11:04Z\"}}"},"http_version":null},"recorded_at":"Wed, 03 May 2017 23:29:50 GMT"}],"recorded_with":"VCR 2.9.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/stories/66728004?fields=%3Adefault%2Cowned_by","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.2.3 (x86_64-darwin15; ruby) TrackerApi/0.2.12 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Content-Type":["application/json; charset=utf-8"],"Status":["200 OK"],"Cache-Control":["max-age=0, private, must-revalidate"],"Date":["Sat, 13 Feb 2016 23:35:36 GMT"],"X-Tracker-Project-Version":["107"],"X-Request-Id":["a8861b6b68bd9e9bbb4829391334f828"],"X-UA-Compatible":["IE=Edge,chrome=1"],"ETag":["\"64f7e7eb0899d244453e1aed4be1cc3a\""],"X-Runtime":["0.060215"],"X-Rack-Cache":["miss"],"X-Powered-By":["Phusion Passenger Enterprise"],"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":["12"]},"body":{"encoding":"UTF-8","string":"{\"kind\":\"story\",\"id\":66728004,\"created_at\":\"2014-02-17T00:00:00Z\",\"updated_at\":\"2016-02-12T23:45:31Z\",\"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,\"owned_by\":{\"kind\":\"person\",\"id\":1266314,\"name\":\"Tracker API User1\",\"email\":\"forestcarlisle+trackerapi1@gmail.com\",\"initials\":\"TU1\",\"username\":\"trackerapi1\"},\"owner_ids\":[1266314,1266316],\"labels\":[{\"id\":11049868,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label1\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"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\"}]}"},"http_version":null},"recorded_at":"Sat, 13 Feb 2016 23:35:35 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects//stories//comments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.2.3 (x86_64-darwin15; ruby) TrackerApi/0.2.12 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":404,"message":null},"headers":{"Content-Type":["application/json; charset=utf-8"],"Status":["404 Not Found"],"Date":["Mon, 15 Feb 2016 19:50:24 GMT"],"X-Request-Id":["1c5eedf378a6959173ad03e7747e40be"],"X-Runtime":["0.041317"],"X-Rack-Cache":["miss"],"X-Powered-By":["Phusion Passenger Enterprise"],"Server":["nginx + Phusion Passenger"]},"body":{"encoding":"UTF-8","string":"{\"code\":\"route_not_found\",\"kind\":\"error\",\"error\":\"The path you requested has no valid endpoint.\"}"},"http_version":null},"recorded_at":"Mon, 15 Feb 2016 19:50:24 GMT"}],"recorded_with":"VCR 2.9.3"} | ||
{"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/stories/66728004?fields=%3Adefault%2Cowned_by","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.3.1 (x86_64-darwin15; ruby) TrackerApi/1.7.0 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"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":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 03 May 2017 23:30:03 GMT"],"Etag":["\"ecbeb5a97319b337e5f11374e371b2be\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["95f9c3475f72a6044bb0aed45924b35d"],"X-Runtime":["0.082890"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["242"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["f97d056d-d0ba-4fa5-6bfb-37eb812ddc38"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["993"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"story\",\"id\":66728004,\"created_at\":\"2014-02-17T00:00:00Z\",\"updated_at\":\"2017-05-03T23:30:01Z\",\"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,\"owned_by\":{\"kind\":\"person\",\"id\":1266314,\"name\":\"Tracker API User1\",\"email\":\"forestcarlisle+trackerapi1@gmail.com\",\"initials\":\"TU1\",\"username\":\"trackerapi1\"},\"owner_ids\":[1266314,1266316],\"labels\":[{\"id\":11049868,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label1\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"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\"}]}"},"http_version":null},"recorded_at":"Wed, 03 May 2017 23:30:03 GMT"}],"recorded_with":"VCR 2.9.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"Test creating a comment\"}"},"headers":{"User-Agent":["Ruby/2.2.3 (x86_64-darwin14; ruby) TrackerApi/1.4.1 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"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":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 16 Nov 2016 14:17:47 GMT"],"Etag":["\"05a4afa88e8d89128c99e3803eb746cd\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"X-Powered-By":["Phusion Passenger"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["c64522554bfcacb90f63fea5c9025473"],"X-Runtime":["0.148598"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["155"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["27b5c8de-19f9-46c8-42b0-8fd3f82ed5cb"],"Content-Length":["178"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":155658605,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2016-11-16T14:17:47Z\",\"updated_at\":\"2016-11-16T14:17:47Z\"}"},"http_version":null},"recorded_at":"Wed, 16 Nov 2016 14:17:48 GMT"}],"recorded_with":"VCR 3.0.3"} | ||
{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"Test creating a comment\"}"},"headers":{"User-Agent":["Ruby/2.3.1 (x86_64-darwin15; ruby) TrackerApi/1.7.0 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"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":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 03 May 2017 23:29:39 GMT"],"Etag":["\"da92c553a8b55689359d240720a6f827\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["6d3b5cb0981a0bc97a2d9f0961324dcc"],"X-Runtime":["0.205489"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["232"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["dadd7537-fe99-477d-653f-1951652b588e"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["178"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":170363243,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:29:39Z\",\"updated_at\":\"2017-05-03T23:29:39Z\"}"},"http_version":null},"recorded_at":"Wed, 03 May 2017 23:29:39 GMT"}],"recorded_with":"VCR 2.9.3"} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason defaulting the labels attribute fixes this issue has to do with the
UpdateRepersenter
class that specifies that an empty collection should be rendered. This is done so that if you want to clear all the labels you can setstory.labels = []
and it will get rendered to json instead of ignored.collection :labels, class: Label, decorator: Label::UpdateRepresenter, render_empty: true
Here is some example code and output that shows the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whysthatso does this make sense?
I am actually working on another branch that will remove the existing dirty tracking. It has caused way more issues than it is worth. IMO.