Use new jql endpoint with token based paging#468
Use new jql endpoint with token based paging#468bobbrodie merged 10 commits intosumoheavy:masterfrom
Conversation
|
Thanks for working on this @fuzzkat! I've added a note about the |
|
@fuzzkat 👍 I didn't even noticed the projects jql. Thanks for the acknowledgement. In my testing I did hit a wall with very very large jql queries. I would get a 429 rate limiting. So I was working on checking for 429 codes. But gave up I'll will be withdrawing my pr for this one |
Yes, I'm not sure how that should be handled. I'm using v2 (the default) and you can pass in the required fields, but that behaviour may surprise users if all formerly visible fields disappear! It didn't take me long to realise that the Since the gem is providing a somewhat standardised interface to the API, perhaps it's okay for fields to be a required parameter for all versions. The alternative would be to parse all the navigable fields and build a fields param internally, but that seems like a retrograde step. |
My personal use-case has been solved, as we don't request that much data, but I can see that for general use this solution is sub-optimal. Bringing rate-limiting inside the gem is certainly a side-effect of hiding the workings of the API behind the gem's interface. Options that I can think of;
Probably the latter is the most sane option, it's just a shame that it renders all old versions incompatible. Mind you, that's really down to Atlassian making a breaking change on an old API version! |
|
It would be good to get a steer from @bobbrodie about which option would be preferred by sumoheavy. |
|
Thank you so much @fuzzkat -- I'm thinking this through :) |
|
This PR, along with adding gem 'jira-ruby', github: 'sumoheavy/jira-ruby', ref: 'refs/pull/468/head'Thanks, @fuzzkat and @levindixon! |
|
Thanks @ashkulz you've saved my skin there! We depend pretty heavily on this package for a lot of pretty critical stuff, is there anything I can do to help with getting this in @bobbrodie ? |
|
This is looking great, @fuzzkat -- thanks for the contribution! This gem doesn't get a ton of traction these days, so I really appreciate it :) Just one small thing - could you update Once we merge, I think we could do a real release of 3.0.0 and take it out of beta. |
|
I have had a thought about the 429 rate limiting. I have gotten around this by doing the JQL call in batches. JQL key between 1-499 sleep 1 second. then call key 500 -> 999 etc I think there needs to be an example of this new method + examples on how to rate limit using jql queries |
Fixes Naming/PredicateMethod rubocop failure by returning issue/s Rather than returning true to represent success, it is fairly common to return the entity or entities added. Assuming this will be part of a major version change, it should be okay to change the interface.
b6640cf to
74e79f3
Compare
|
@bobbrodie hey! Thanks for merging this fix. I was corious of the timeline to release this as part of 3.0.0? Any chance we can have a pre-release tag in case it's not ready? |
|
Hey of course @kikin81 , an even bigger thanks to everyone who worked on this. The gem doesn't get a ton of attention from folks these days, but it feels like Rails is having a bit of a comeback which I like to see :) We're working on getting this tagged and up to RubyGems today! |
|
And 3.0.0 is live! If anyone runs into any issues, please give me a shout and I'll take a look. Thank you all again so much for the kind contributions, I really, really appreciate it. And, it's nice to see the gem getting some use! |
|
@bobbrodie thank you so much for this! Really appreciate it! |
|
for those whom are reading .. version 3 has breaking changes.. duh... love how this got snuck into version 3 ❤️ Thanks @fuzzkat for taking my idea and putting it on another level. the amount of time this has saved me. if we ever meet.. 🍺 is yours. |
|
Thanks @bobbrodie for getting this merged into v3.0.0, we all appreciate the fast turnaround - there's plenty of us who still love Rails! |
Based on an idea in #467 by @freibuis
This change affects versions 2 and 3 of the API.
The Jira API has been updated so that the search endpoint with
?jqlparameter has been completely removed (it was deprecated back in October 2024). This endpoint was replaced with a more performant one atsearch/jql?jql=. As well as moving the endpoint, the format and parameters has changed. Most critically the endpoint now returns anextPageTokenwhich must be used to request the next page of data.This fix modifies the Issue.jql method to loop through the pages inside the gem, instead of expecting the
start_atparameter to be passed in. This avoids returning the nextPageToken back to the consumer, which would mean introducing a new return object type or structure.