From 49ee0c1092e535524df978b0f8d4cfd7e7147d2e Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Sat, 7 Jun 2025 00:17:46 +0200 Subject: [PATCH] Bug 1970967 - add git revision to bugzilla comment by bugherder The revision and url are identic to the ones for autoland but only posting a Mercurial (hg) revision in a bug can be confusing. --- bugherder/js/Config.js | 1 + bugherder/js/PushData.js | 2 ++ bugherder/js/Step.js | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bugherder/js/Config.js b/bugherder/js/Config.js index 02ff6b9..aac4bb9 100644 --- a/bugherder/js/Config.js +++ b/bugherder/js/Config.js @@ -5,6 +5,7 @@ var Config = { inMaintenanceMode : false, treeName: 'mozilla-central', + gitRevURL: "https://github.com/mozilla-firefox/firefox/commit/", hgBaseURL: "https://hg.mozilla.org/", hgURL: "https://hg.mozilla.org/mozilla-central/", hgRevURL: "https://hg.mozilla.org/mozilla-central/rev/", diff --git a/bugherder/js/PushData.js b/bugherder/js/PushData.js index 69b14e9..b0daf36 100644 --- a/bugherder/js/PushData.js +++ b/bugherder/js/PushData.js @@ -443,7 +443,9 @@ var PushData = { makePush: function PD_makePush(cset) { var push = {}; push.cset = cset.node.substring(0,12); + push.cset_git = cset.git_node; push.hgLink = Config.hgRevURL + push.cset; + push.gitLink = push.cset_git ? Config.gitRevURL + push.cset_git : null; // Only use the first line of the commit message, to avoid false // positives when checking for bug numbers and backouts later. push.desc = UI.htmlEncode(cset.desc.split('\n', 1)[0]); diff --git a/bugherder/js/Step.js b/bugherder/js/Step.js index 5ae418e..1368598 100644 --- a/bugherder/js/Step.js +++ b/bugherder/js/Step.js @@ -492,7 +492,11 @@ Step.prototype.attachBugToCset = function Step_attachBugToCset(index, bugID) { var attached = {}; var isMC = Config.treeName == 'mozilla-central'; - attached.comment = PushData.allPushes[index].hgLink; + attached.comment = ''; + if (PushData.allPushes[index].gitLink) { + attached.comment = `${PushData.allPushes[index].gitLink}\n`; + } + attached.comment += PushData.allPushes[index].hgLink; if (bugID in BugData.bugs) { attached.shouldComment = !(PushData.allPushes[index].backedOut);