Skip to content

[#73887] Add backlog buckets to API#23534

Merged
EinLama merged 12 commits into
devfrom
feature/73887-display-backlog-bucket-in-work-package-page
Jun 10, 2026
Merged

[#73887] Add backlog buckets to API#23534
EinLama merged 12 commits into
devfrom
feature/73887-display-backlog-bucket-in-work-package-page

Conversation

@EinLama

@EinLama EinLama commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/AGILE-192

What are you trying to accomplish?

Make backlog buckets readable/writable in the work package details view. This also works for a large number of buckets since pagination is set to "no limit" (similar to Sprints).

Establish an API for backlog buckets.

Filtering and grouping is out of scope for this PR.

Screenshots

image

Known bugs

When you try to assign a Backlog Bucket to a work package that is already assigned to a Sprint: https://community.openproject.org/wp/AGILE-275

The backlog bucket attribute might be missing from the WP details page depending on which user populates the cache. There is a fix for Sprints that can also be applied to Backlog Buckets, but #23523 has to be merged first. -> Bugfix applied to this PR.

What approach did you choose and why?

Most of this work is based on the introduction of Sprints into the API and work package details view (#22328)

As for naming, the API routes are currently called backlog_bucket instead of the short form bucket, since the API is different to the regular routing in that it does not offer a namespace for the backlogs module. The API route for buckets is /projects/:id/backlog_buckets. If shortened to /projects/:id/buckets, it might be too ambiguous. On the other hand, this creates an inconsistency. It could be better to use the short form and accept that bucket is a well established term in our code base.

The ACs state that the manage_sprint_items permission is necessary to write the backlog_bucket attribute on WorkPackage. This was already established prior to this PR and was tested in modules/backlogs/spec/contracts/work_packages/shared_contract_examples.rb. There is no explicit feature test for backlog buckets ensuring that the contract is really used for the WP details page.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@EinLama EinLama force-pushed the feature/73887-display-backlog-bucket-in-work-package-page branch from a95f465 to e0bea95 Compare June 3, 2026 12:21
Comment thread modules/backlogs/app/models/backlog_buckets/scopes/visible.rb Outdated
@EinLama EinLama force-pushed the feature/73887-display-backlog-bucket-in-work-package-page branch 2 times, most recently from 48f8e65 to 5315e95 Compare June 5, 2026 05:49
@EinLama EinLama marked this pull request as ready for review June 5, 2026 05:57
@EinLama EinLama force-pushed the feature/73887-display-backlog-bucket-in-work-package-page branch 2 times, most recently from 3e288ae to 19ca6c9 Compare June 5, 2026 18:34
@EinLama EinLama force-pushed the feature/73887-display-backlog-bucket-in-work-package-page branch from 19ca6c9 to 318e359 Compare June 8, 2026 10:39

@toy toy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM overall, see comments

Comment thread modules/backlogs/app/models/queries/backlog_buckets.rb
module V3
module BacklogBuckets
class BacklogBucketRepresenter < ::API::Decorators::Single
include API::Decorators::LinkedResource

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unrelated to PR - this should be automatically included by API::V3::Workspaces::LinkedResource

https://community.openproject.org/wp/AGILE-282

Comment thread spec/support/edit_fields/edit_field.rb Outdated
@EinLama

EinLama commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Applied almost all of your suggestions. Will merge once CI is green 🟢

Comment thread spec/support/mocked_permission_helper.rb
…empty project

It should not grant all permissions if the project argument is `nil`.
@EinLama EinLama force-pushed the feature/73887-display-backlog-bucket-in-work-package-page branch from 1582732 to 735bba8 Compare June 10, 2026 13:53
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/projects/project_autocomplete_spec.rb[1:1]

@EinLama EinLama merged commit 61c5224 into dev Jun 10, 2026
18 checks passed
@EinLama EinLama deleted the feature/73887-display-backlog-bucket-in-work-package-page branch June 10, 2026 17:47
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants