Skip to content

[BUG] Bitbucket inline comments show visible metadata preview that breaks UI/UX #1494

@felipeduarte26

Description

@felipeduarte26

hen using Danger JS with Bitbucket Cloud and posting inline comments (with file and line parameters), Bitbucket displays a visible metadata preview at the top of each comment that includes:

  • Comment count
  • DangerID
  • File path
  • Line number

This metadata preview is visible to all users and significantly degrades the UI/UX of PR comments.

Current Behavior

When calling fail(message, file, line) or warn(message, file, line), the resulting inline comment in Bitbucket shows:

<!-- 1 failure: 🔍 Flutter Anal... 0 atenção: DangerID: danger-id-danger-bot-c872a813-0f7f-4bd5-ba3b-a; File: lib/features/branch/domain/entities/pessoa.dart; Line: 4; -->

The problem: The <!-- ... --> metadata is rendered as visible text in Bitbucket's inline comment preview, making comments look unprofessional and cluttered.

Expected Behavior

The metadata should be:

  1. Hidden in the UI (like GitHub does with HTML comments), OR
  2. Removed entirely from inline comments, OR
  3. Configurable via Danger configuration

Environment

  • Danger JS version: 12.3.3
  • Platform: Bitbucket Cloud
  • danger-js platform: @danger/bitbucket_cloud (via danger-plugin-bitbucket-cloud)
  • Node version: 22.0.0

Workaround

Currently, the only workaround is to avoid inline comments entirely by calling:

  • fail(message) without file and line parameters

This posts general PR comments instead of inline comments, which:

  • ✅ Don't show visible metadata
  • ❌ Group ALL messages into a single comment (poor UX for multiple issues)
  • ❌ Don't point to specific lines in the code

Impact

This issue affects all Bitbucket users who want to use inline comments with Danger JS:

  1. Professional image: Visible metadata makes automated comments look broken/unprofessional
  2. UX degradation: Users see technical metadata instead of clean, actionable feedback
  3. Limited functionality: Forces choice between:
    • Clean comments (general, all grouped together)
    • Useful comments (inline, per-line) with ugly metadata

Reproduction

  1. Set up Danger JS with Bitbucket Cloud
  2. Create a dangerfile with inline comments:

import { danger, fail } from 'danger';

const files = danger.git.modified_files;

files.forEach(file => {
if (file.endsWith('.dart')) {
fail('Missing documentation', file, 1);
}
});3. Run Danger on a PR
4. Check Bitbucket PR comments
5. Observe: Visible metadata preview in inline comments

Comparison with GitHub

On GitHub, the same code produces clean inline comments without visible metadata. The HTML comments are properly hidden.

Possible Solutions

  1. Remove metadata from Bitbucket inline comments entirely (simplest)
  2. Use Bitbucket API fields instead of HTML comments for tracking
  3. Make metadata optional via configuration flag
  4. Minify/encode metadata to make it less intrusive

Related Issues

This seems to be specific to Bitbucket's rendering of HTML comments in inline comment previews. GitHub handles this correctly by hiding HTML comments.

Question

Is this a known limitation of Bitbucket's API/UI? Are there any plans to address this? The current behavior makes inline comments nearly unusable for Bitbucket users who care about clean, professional PR feedback.


Would appreciate any guidance or workarounds! Thank you for the amazing tool! 🙏

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions