Skip to content

Bitbucket Cloud: multi-line inline comments collapse onto their first line (inline.start_to is never sent)#3285

Description

@bannert1337

What happens

A review finding that spans several lines is posted on Bitbucket Cloud as a single-line comment anchored to the first line of the span. The rest of the range is dropped, so a finding about a whole function reads as a remark about its signature.

Why

BitbucketProvider.publish_inline_comments builds the payload as

"inline": {"path": ..., "to": position}

using only the start line. Bitbucket Cloud's comment API does accept a range: inline.start_to together with inline.to. The API validates it ("start_to" must be less than or equal to "to"; an inverted range is rejected with 400) and stores it - a GET on the created comment returns both fields.

The community post commonly cited for "Bitbucket does not support ranges" is about from/to, which are the old-side and new-side line numbers, not a span.

Suggested fix

Send the range when the finding has one: inline.start_to = relevant_lines_start, inline.to = relevant_lines_end, falling back to the single-line form when they are equal or the end line is missing.

Verified against a live Bitbucket Cloud pull request on 2026-09-10: a comment published with relevant_lines_start=10, relevant_lines_end=16 comes back from the API as {"path": ..., "start_to": 10, "to": 16} and renders spanning those lines.

We carry this as a patch on v0.45.0 and are happy to open a pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions