Skip to content

[Bitbucket] Fix pagination for cloud requests **FIX BLACK** #872

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

Merged
merged 4 commits into from
Oct 18, 2021

Conversation

sti0
Copy link
Contributor

@sti0 sti0 commented Oct 17, 2021

This fixes the black issues in #844 and make this PR work.

Shoutouts to @sergey-p3 for fixing this bug

sergey-p3 and others added 4 commits August 17, 2021 22:43
Exception raised when requesting pull requests which exceed single page: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitbucket.org/2.0/repositories/XXXX/pullrequests/?q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22&page=2/&q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22

Next argument returned by the response contains full url including original params and next page. The issue is that the params are passed as duplicates to the following request along with the trailing / after provided url.
@codecov-commenter
Copy link

Codecov Report

Merging #872 (88477bc) into master (5a3f5f1) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #872      +/-   ##
==========================================
- Coverage   36.04%   36.03%   -0.01%     
==========================================
  Files          32       32              
  Lines        6201     6202       +1     
  Branches      899      899              
==========================================
  Hits         2235     2235              
- Misses       3858     3859       +1     
  Partials      108      108              
Impacted Files Coverage Δ
atlassian/bitbucket/cloud/base.py 80.64% <0.00%> (-2.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3f5f1...88477bc. Read the comment docs.

@gonchik gonchik merged commit 24c3481 into atlassian-api:master Oct 18, 2021
@sti0 sti0 deleted the bugfix/cloud-pagination branch October 19, 2021 21:19
jnhyperion added a commit to jnhyperion/atlassian-python-api that referenced this pull request Dec 3, 2021
…ython-api

* 'master' of https://github.com/atlassian-api/atlassian-python-api: (43 commits)
  Fix delete watchers (atlassian-api#889)
  Add function for getting watchers (atlassian-api#890)
  Add functionality to delete a watcher from an issue (atlassian-api#884)
  [Jira] Implement jira.update_version (atlassian-api#878)
  Bitbucket Cloud: Support for pull request tasks (atlassian-api#874)
  [Bitbucket] Fix pagination for cloud requests **FIX BLACK** (atlassian-api#872)
  [Bitbucket] get_users - addition for start and limit (atlassian-api#868)
  Develop (atlassian-api#870)
  Crowd: add additional functions (atlassian-api#865)
  Bump version
  Fix missing data when using pullRequests.each() (atlassian-api#861)
  Added parameters to projects get request (atlassian-api#859)
  Bump version with new parameter of token
  Jira: Add support for authentication through access token (atlassian-api#856)
  change: allow editor=v1 as a parameter of the create_page function (atlassian-api#857)
  Update rest_client.py (atlassian-api#854)
  Bump version of fork method
  Removing redundant double check for simpler code to read (atlassian-api#853)
  Fix up the docs to include the functions definitions for forking repositories (atlassian-api#852)
  [Bitbucket] Adding ability to fork a repo to a different project (atlassian-api#843)
  ...

# Conflicts:
#	atlassian/jira.py
Spacetown added a commit to Spacetown/atlassian-python-api that referenced this pull request Jan 28, 2022
gonchik pushed a commit that referenced this pull request Jan 30, 2022
* Use paged get for get_branch_permission.

* Merge changes from #872 int bitbucket function _get_paged.
gonchik pushed a commit that referenced this pull request Sep 3, 2022
* [Bitbucket] Fix pagination for cloud requests

Exception raised when requesting pull requests which exceed single page: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitbucket.org/2.0/repositories/XXXX/pullrequests/?q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22&page=2/&q=state+%3D+%22OPEN%22+OR+state+%3D+%22MERGED%22+or+state%3D%22DECLINED%22

Next argument returned by the response contains full url including original params and next page. The issue is that the params are passed as duplicates to the following request along with the trailing / after provided url.

* Fix black

Co-authored-by: Sergey <sergey.pusnei@gmail.com>
Co-authored-by: Timo Schneider <timo.schneider@intersport.de>
gonchik pushed a commit that referenced this pull request Sep 3, 2022
* Use paged get for get_branch_permission.

* Merge changes from #872 int bitbucket function _get_paged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants