Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Search (POST) support. #461

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mari-crl
Copy link

@mari-crl mari-crl commented Jun 10, 2022

Description

  • The What: Jira has support for the Search API to be called via a POST request for long queries that would be too long for the URL limit. This change adds support for that POST API.
  • The Why: A tool I was writing using go-jira needs to search with very long queries with a lot of issue keys to select from. These queries are rejected by the Jira Cloud server because they're too long.
  • Type of change: New feature (upgrade to the existing search feature).
  • Breaking change: Client code will continue working. Tests may break if a test makes a long query and its mocks assume that all search requests will be GET requests.
  • Related to an issue: No
  • Jira Version + Type: v2 Cloud

Example:

This happens behind the scenes when a search is issued that would result in a GET request longer than 2000 characters. To verify it's happening, pass JQL longer than 2000 characters or log the HTTP requests the client is making.

keys := LongSliceOfKeys()
issues, res, err := client.Issue.Search(
	fmt.Sprintf("type = Bug AND project = AREA AND Key IN (%s)", strings.Join(keys, ",")),
	opt)

Checklist


This change is Reviewable

This adds support for the POST search endpoint for long queries on Jira.
The client interface does not change; the request to the server will be
upgraded to a POST request behind the scenes if the URL would be more
than 2000 characters long.
@andygrunwald
Copy link
Owner

Hey,

I am very sorry that this pull request has been open for a long time with no final feedback or merge/decline. We work on this project in our spare time, and sometimes, other priorities take over. This is the typical open source dilemma.

However, there is news: We are kicking off v2 of this library 🚀

To provide visibility, we created the Road to v2 Milestone and calling for your feedback in #489

The development will take some time; however, I hope you can benefit from the changes.
If you seek priority development for your pull request + you like to sponsor it, please contact me.

What does this mean for my pull request?

We will work on this pull request indirectly.
We might merge it during the development or pull parts of it into the new version.
This means that during the development phase, we aim to tackle it.
Maybe in a different way like it is currently handled.
Please understand that this will take a while because we are running this in our spare time.

Final words

Thanks for using and contributing to this library.
If there is anything else you would like to tell us, let us know!

Copy link
Author

@mari-crl mari-crl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the update, and I appreciate that this library will finally be getting some big love! :)

Reviewable status: 0 of 2 files reviewed, all discussions resolved

@github-actions github-actions bot added the conflicts Indicates merge conflicts label Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Indicates merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants