Skip to content

fix(bitbucket): tolerate null datacenter comment replies#792

Merged
potiuk merged 1 commit into
apache:mainfrom
KatalKavya96:fix-bitbucket-dc-null-comments
Jul 9, 2026
Merged

fix(bitbucket): tolerate null datacenter comment replies#792
potiuk merged 1 commit into
apache:mainfrom
KatalKavya96:fix-bitbucket-dc-null-comments

Conversation

@KatalKavya96

Copy link
Copy Markdown
Contributor

Summary

  • Hardens Bitbucket Data Center threaded comment normalization when the API returns an explicit comments: null value.
  • Treats both missing and null nested comment.comments fields as no replies by using raw.get("comments") or [].
  • Adds a regression test for the comments: null case so the discussion normalizer does not crash on this payload shape.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other: verified targeted Bitbucket tests with PYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py

RFC-AI-0004 compliance

  • HITL — any new mutation is gated on explicit user confirmation
  • Sandbox — no new unrestricted host access; network reach declared in the adapter
  • Vendor neutrality — keeps the Bitbucket bridge within the existing vendor-neutral contract:change-request / partial read-only path without adding new Bitbucket-specific capability prose.
  • Conversational + correctable — agentic-override path documented if behaviour is adopter-tunable
  • Write-access discipline — this is a read-only normalization hardening change and does not add any outbound write or mutation path.
  • Privacy LLM — private content does not reach a non-approved LLM; redactor invoked where needed

Linked issues

Refs #606

Notes for reviewers

This follows up on the non-blocking robustness note from the merged Bitbucket discussion PR.

Bitbucket Data Center nested replies are already flattened through _datacenter_comment_tree; this PR only hardens that path for payloads where the API returns "comments": null instead of omitting the field or returning an empty list.

The behaviour is unchanged for normal threaded replies.

@KatalKavya96

Copy link
Copy Markdown
Contributor Author

Hi @potiuk, this is a quick follow-up fix for the non-blocking robustness suggestion left after the previous Bitbucket discussion PR was merged.

It only hardens _datacenter_comment_tree for the comments: null case and adds a regression test for it. If this looks good, I’d appreciate a quick review/merge so I can move on to the next Bitbucket implementation.

Thanks again.

@potiuk potiuk merged commit cfc69b5 into apache:main Jul 9, 2026
9 checks passed
@KatalKavya96 KatalKavya96 deleted the fix-bitbucket-dc-null-comments branch July 9, 2026 15:16
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.

2 participants