Create System Note for imported resource events - Bitbucket Server
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Resource events should be labeled as imported
as per [the UI Design]
I've done some testing with a local BB Server instance. The only thing we import that this fix would apply to is MR merge events
From our docs:
Pull requests, including comments, user mentions, reviewers, and merge events
However these are not being shown as imported with the fix for DT that has fixed other importers:
Unlike the other importers, the merge event isn't part of the disscussions.json
, which is where the MR comments/activity is shown.
Instead (I think) the front end is getting the info in the cached_widet.json
payload:
GET /root/bb-server-project/-/merge_requests/2/cached_widget.json HTTP/1.1
Sample truncated cached_widget.json response
{
"id": 173,
"iid": 2,
"description": "*Created by: elephant*\n\nFacilisi cras fermentum odio eu. Quis risus sed vulputate odio ut enim blandit volutpat maecenas. Vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Vel quam elementum pulvinar etiam non. Scelerisque eu ultrices vitae auctor eu augue ut. Pretium viverra suspendisse potenti nullam ac tortor. Mauris cursus mattis molestie a iaculis at erat pellentesque. Amet tellus cras adipiscing enim eu turpis egestas pretium. Morbi blandit cursus risus at. Turpis nunc eget lorem dolor sed viverra.",
"title": "online edit to readme",
"state": "merged",
"merged_commit_sha": "5af574edd0cf7c09063137176b49b477e6b87c57",
"short_merged_commit_sha": "5af574ed",
"merge_user_id": null,
"source_branch": "elephant/READMEmd-1719408072982",
"source_project_id": 24,
"target_branch": "main",
"target_branch_sha": "5af574edd0cf7c09063137176b49b477e6b87c57",
"target_project_id": 24,
"squash": false,
"rebase_in_progress": false,
"default_squash_commit_message": "online edit to readme",
"merge_ongoing": false,
"remove_source_branch": null,
"source_branch_exists": true,
"merge_status": "can_be_merged",
"commits_without_merge_commits": [
{
"message": "online edit to readme\n",
"short_id": "9847d05e",
"title": "online edit to readme"
}
],
"diff_head_sha": "9847d05e61c968fabaa3d3a2b1a8ae6e03534008",
"metrics": {
"closed_at": null,
"merged_at": "2024-06-26T13:22:40Z",
"closed_by": null,
"merged_by": {
"id": 1,
"username": "root",
"name": "Administrator",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/232629b044261dc88102052d04fc940a16e8ea38cb508fa8c01ec8c4d8a8f457?s=80&d=identicon",
"web_url": "http://gdk.test:3000/root",
"show_status": false,
"path": "/root"
}
},
...
A previous MR !157507 (merged) updated BB Server to show "imported" on MR comments.
This returns an array of items which include notes.
Proposed solution
See Luke's comment in #475233 (comment 2079914626)