decaporg / decaporg/decap-cms

Bitbucket workflow maxes out at 50 drafts

Open
#7,144 0 comments 0 reactions 0 assignees View on GitHub
area: extensions/backends/bitbucket area: ui/editorial-workflow type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
Using Bitbucket as a backend, only 50 pull requests are loaded for Workflow. As a result, once they created more than 50 draft articles, it no longer loads them all.

The pagelen is hard coded to 50 for pull requests (and only first page loaded) here: https://github.com/decaporg/decap-cms/blob/84ec574bb9526973627950b09c249634e7a811e3/packages/decap-cms-backend-bitbucket/src/API.ts#L656

In comparison with the Github Backend (which has 100 pull requests hard coded), we can see that Bitbucket Backend simply requests the first page of pull requests, while the Github Backend requests all pages of pull requests. https://github.com/decaporg/decap-cms/blob/84ec574bb9526973627950b09c249634e7a811e3/packages/decap-cms-backend-github/src/API.ts#L503

Therefore, I suggest that Bitbucket's backend should be updated to use a new function like the one that Github Backend uses `this.requestAllPages` https://github.com/decaporg/decap-cms/blob/84ec574bb9526973627950b09c249634e7a811e3/packages/decap-cms-backend-github/src/API.ts#L338

Should it look similar to listAllFiles? https://github.com/decaporg/decap-cms/blob/84ec574bb9526973627950b09c249634e7a811e3/packages/decap-cms-backend-bitbucket/src/API.ts#L408

**To Reproduce**
Steps to reproduce the behavior. For example:
1. Create 51 drafts in Workflow for Bitbucket
2. You can only see 50.
3. Seems that you also can't edit number 51 (is it not in memory?)

**Expected behavior**
Match other environments, which load all pages of pull requests, not simply the first one.

**Screenshots**
![image](https://github.com/decaporg/decap-cms/assets/72763/f5b48df7-814c-4ed7-82d1-53a46ded7274)
Inspecting the network requests, I can see that pagelen=50 is hard coded, and only one page is loaded. (Note that the screenshot is from https://github.com/decaporg/decap-cms/issues/7025, completely different image but the relevant thing is that pagelen=50)

**Applicable Versions:**

- Decap CMS version: netlify-cms-app 2.15.72
- Git provider: Bitbucket
- OS: Mac Ventura 13.5.1 (22G90
- Browser version Chrome Version 122.0.6261.112 (Official Build) (arm64)

**CMS configuration**
```toml
baseURL = ""
languageCode = "en-us"
title = "rougon"

timeZone = "UTC"

enableGitInfo = true
[frontmatter]
date = ["date", "publishDate", "lastmod"]
lastmod = ["lastmod", ":git", "date", "publishDate"]

[module]
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "static"
target = "static"
[[module.mounts]]
source = "node_modules"
target = "assets/node_modules"
[[module.mounts]]
source = "assets/uploads"
target = "static/uploads"

[server]
[[server.headers]]
for = '/**'
[server.headers.values]
Access-Control-Allow-Origin = "*"

[outputs]
page = ["html","json"]
home = ["html","json"]
section = ["html","json"]
term = ["json"]

[mediaTypes."text/netlify"]
suffixes = ["txt"]
delimiters = ["txt"]

[outputFormats.players]
baseName = "players"
mediatype ="application/json"
[outputFormats.redirect]
mediatype = "text/netlify"
baseName = "_redirects"

[taxonomies]
sport = "sports"
training = "trainings"

[permalinks]
page = "/:section/:title/"

[deployment]
# By default, files are uploaded in an arbitrary order.
# Files that match the regular expressions in the "Order" list
# will be uploaded first, in the listed order.
order = [".jpg$", ".gif$"]

[[deployment.targets]]
# An arbitrary name for this target.
name = "deployment-target"
# The Go Cloud Development Kit URL to deploy to. Examples:
# GCS; see https://gocloud.dev/howto/blob/#gcs
URL = ""

[[deployment.matchers]]
# Cache static assets for 1 year.
pattern = "^.+\\.(js|css|svg|ttf)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = true

[[deployment.matchers]]
pattern = "^.+\\.(png|jpg)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = false

[[deployment.matchers]]
# Set custom content type for /sitemap.xml
pattern = "^sitemap\\.xml$"
contentType = "application/xml"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.