[tricium plugin] Change run ID in bug filing template to URL
This should make it slightly quicker to check run details
when someone files a bug.
Change-Id: Ie6b5018ffc4e91061c11c01148c57886912d13b2
Reviewed-on: https://chromium-review.googlesource.com/1175227
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
diff --git a/.eslintrc.json b/.eslintrc.json
index 50181b0..1546a98 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -26,6 +26,7 @@
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "off",
"eol-last": "off",
+ "guard-for-in": "off",
"indent": "off",
"keyword-spacing": ["error", { "after": true, "before": true }],
"max-len": ["error", 80, 2, { "ignoreComments": true }],
diff --git a/src/main/resources/static/tricium-feedback-button.js b/src/main/resources/static/tricium-feedback-button.js
index 62df97c..57bc8ac 100644
--- a/src/main/resources/static/tricium-feedback-button.js
+++ b/src/main/resources/static/tricium-feedback-button.js
@@ -108,7 +108,9 @@
constructBugLinkURL(response) {
const params = new URLSearchParams();
params.set('summary', `Issue report for ${this.comment.robot_id}`);
- params.set('description', `Run ID: ${this.comment.robot_run_id}`);
+ params.set(
+ 'description',
+ `https://${this.triciumHost}/run/${this.comment.robot_run_id}`);
params.set('components', 'Infra>Platform>Tricium');
if (response.monorailComponent) {
params.set('components', response.monorailComponent);
diff --git a/test/tricium-feedback-button_test.html b/test/tricium-feedback-button_test.html
index f5532b3..56880e0 100644
--- a/test/tricium-feedback-button_test.html
+++ b/test/tricium-feedback-button_test.html
@@ -160,16 +160,18 @@
test('constructBugLinkURL with no owner/component', () => {
element.comment = exampleComment;
+ element.triciumHost = 'tricium-dev.appspot.com';
assert.equal(
element.constructBugLinkURL({}),
('https://bugs.chromium.org/p/chromium/issues/entry' +
'?summary=Issue+report+for+Spacey%2FMixed' +
- '&description=Run+ID%3A+2345' +
+ '&description=https%3A%2F%2Ftricium-dev.appspot.com%2Frun%2F2345' +
'&components=Infra%3EPlatform%3ETricium'));
});
test('constructBugLinkURL with owner/component', () => {
element.comment = exampleComment;
+ element.triciumHost = 'tricium-dev.appspot.com';
assert.equal(
element.constructBugLinkURL({
owner: 'someone@chromium.org',
@@ -177,7 +179,7 @@
}),
('https://bugs.chromium.org/p/chromium/issues/entry' +
'?summary=Issue+report+for+Spacey%2FMixed' +
- '&description=Run+ID%3A+2345' +
+ '&description=https%3A%2F%2Ftricium-dev.appspot.com%2Frun%2F2345' +
'&components=Some%3EComponent' +
'&cc=someone%40chromium.org'));
});
diff --git a/test/tricium-view_test.html b/test/tricium-view_test.html
index 5b14d70..af71ce3 100644
--- a/test/tricium-view_test.html
+++ b/test/tricium-view_test.html
@@ -68,13 +68,13 @@
ref: 'refs/changes/45/12345/2',
};
- element.attached()
+ element.attached();
assert.deepEqual(element.revision, {
kind: 'REWORK',
_number: 1,
ref: 'refs/changes/45/12345/1',
- })
+ });
}),
test('_update sets timeout when not finished', async () => {