-
-
@servicedesk Please propose a solution. What we're trying to use: existing code, UX elements, etc.
We do not want to compromise on speed and performance.
Don't assume. Ask high-level clarifying questions if needed.
- Numbered questions (1, 2, 3, etc)
- Lettered answer options (A, B, C, etc)
- Pros and Cons? Your recommendation?
-
@zaakiy Proposed approach below, plus clarifying questions.
Proposed solution
Reuse the same commit-hash UX already used on PR update activities (
PullRequestUpdatePanel) and commit info (CommitInfoPanel):- abbreviated hash via
GitUtils.abbreviateSHA - link to
CommitDetailPageviaViewStateAwarePageLink - one-click copy via
CopyToClipboardLink
Render that control next to the merge activity line in
PullRequestChangePanelwhen the change is aPullRequestMergeData.Data source (no git lookup)
For merges performed through OneDev,
PullRequest.mergePreview.mergeCommitHashis already persisted on the PR after merge (DefaultPullRequestService.merge/closeAsMerged(..., false)). Reading that field at render time:- needs no schema/migration
- needs no git resolution
- is already loaded with the PR (embedded
MergePreview) — no extra query / no performance cost on the Activities tab
PullRequestMergeDatatoday only stores an optional reason string ("merged"/"merged pull request"), not a hash. Externally detected merges clearmergePreview, so those would not show a hash under a preview-only approach.Recommendation
UI-only change: show hash+copy+link from existing
mergePreview.mergeCommitHashwhen present. Matches the issue scope (“merged through OneDev”), reuses existing UX components, and preserves speed/performance.Optional hardening later (not required for the stated need): also store the hash on
PullRequestMergeDataat merge time so it stays on the activity even if preview data were cleared.Clarifying questions
-
Which merges should show the hash?
- A. Only merges through OneDev (where
mergePreview.mergeCommitHashexists) — recommended; matches issue description - B. Also attempt externally detected merges when a commit can be inferred
- C. Store hash on merge activity data going forward, and fall back to
mergePreviewfor older OneDev merges
Pros/cons: A is cheapest and sufficient; B adds complexity/edge cases; C is more durable but needs a small model change for new merges.
- A. Only merges through OneDev (where
-
Where should the hash appear on the activity line?
- A. Inline after the verb:
User merged a1b2c3d [copy] N ago— recommended; matches the screenshot callout - B. Trailing actions style like update commit rows (hash + copy on the right)
- C. Other placement you prefer
- A. Inline after the verb:
-
Historical already-merged PRs?
- A. Show whenever
mergePreview.mergeCommitHashis still present (covers existing OneDev-merged PRs with no backfill) — recommended - B. Only show for merges after this fix ships
- C. A + also persist hash on new merge activities for future durability
- A. Show whenever
-
Notifications / emails?
- A. Activities UI only — recommended for this minor improvement
- B. Also include the hash in merge notification text
Please reply with your choices (e.g.
1A, 2A, 3A, 4A) or adjustments. - abbreviated hash via
-
Name Previous Value Current Value Assignee
robin
cwh
-
-
Implemented the requested Activities UI update. Merge activities now show the abbreviated merge commit hash inline with a link to the commit and a one-click copy control whenever the persisted merge preview hash is available. This reuses the existing commit UX and performs no additional repository lookup.
Validated with
mvn -Pce -pl server-core -am -DskipTests compile(BUILD SUCCESS).Submitted as pr OD-101.
| Type |
Improvement
|
| Priority |
Minor
|
| Assignee | |
| Labels |
No labels
|
Summary
When a pull request is merged through OneDev, the merge activity line (e.g. "User merged N ago") does not show the resulting merge commit ID. Users cannot copy that hash in one click from the activity stream.
Filed from issue OD-2921.
Requested behavior
On the PR Activities tab, when a merge activity is recorded for a merge performed through OneDev, show the merge commit hash next to the activity (similar to how commit hashes appear elsewhere), with a one-click copy control and a link to the commit.
Context
Today the hash is only available indirectly (checkout merge preview, target-branch commits view, or REST merge-preview API), which is too many steps for a common need.