New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1060322 - Move hardcoded Bugzilla & slave health URLs in the UI to thUrl #598
Conversation
hi :-) so we don't need to create a new angular app for this - we want to add to the files used by the existing apps. eg the best way I think is likely to add to services/main.js, two new factories - one for bugzilla and one for slave health (though @camd / @wlach feel free to suggest something better - I'm still not 100% sure of the difference between some of the angular terminology and/or the UI directory layout). Each of these factories would have a function to return the URL - eg getBugURL(), which in the markup would have the bug id passed in as a parameter. If it helps, take a look at the treestatus file for reference: |
Respected Sir, Regards, |
I gave a link to an example in the comment above. |
@@ -0,0 +1,4 @@ | |||
|
|||
|
|||
var app = angular.module("tree_url_app", []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the part that Ed was saying is not needed. We don't need to create a new app, we should add to the existing treeherderApp
.
I suggest adding your functions to this factory: https://github.com/mozilla/treeherder/blob/master/ui/js/services/main.js#L13-24
Then you can reference that factory in any of the controllers that need to use it.
Newer versions of the code here were pushed to different branches and new PRs opened. Once you've pushed the latest version to this PR, and there are no accidentally added files / the tests pass, request review from one of us in the bug - I'm on holiday until Monday, so if you want a review before then, one of the others may be a better choice :-) Good luck! |
Hi Ed, i hope you had a nice vacation. i followed the link in the above comment..was still unable to update the PR.. but i did manage to squash the commits as mentioned in the text.Even i am opposed to opening multiple PRs and totally understand that it creates a lot of inconvenience...i am at this juncture after the push ..https://github.com/mozilla/treeherder/compare/master...mandaltapesh:test?expand=1 ..will opening a new PR somehow merge the new one with the existing one ? Regards |
PRs are linked to the branch name - so to update this PR you need to push to the same branch name it was created with - which in this case was |
Hi Ed, |
ok yeah i can see the "test" written ..sorry my mistake .. |
Ed , i don't know what happened but it now says all checks have passed does that mean it is updated ? Regards |
Hi Tapesh, the code all looks good to me. I'm going to test with it tomorrow, and if all goes well, I'll merge it in for you. Thanks for doing this work! :) |
@@ -21,6 +21,12 @@ treeherder.factory('thUrl', [ | |||
}, | |||
getLogViewerUrl: function(job_id) { | |||
return "logviewer.html#?job_id=" + job_id + "&repo=" + $rootScope.repoName; | |||
}, | |||
getBugIdUrl:function(bug_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be a space after the colon, and before function
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe the function name might be better as getBugUrl
rather than getBugIdUrl
?
Hi Ed, |
@@ -202,7 +202,7 @@ | |||
<tr> | |||
<th class="small">Machine name</th> | |||
<td class="small"> | |||
<a target="_blank" href="https://secure.pub.build.mozilla.org/builddata/reports/slave_health/slave.html?name={{ job.machine_name }}">{{ job.machine_name }}</a> | |||
<a target="_blank" href="{{ getMachineNameUrl(job.machine_name) }}">{{ job.machine_name }}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated to getSlaveHealthUrl
Hi Ed,
Regards |
Ah there's another slave health url instance that needs changing: treeherder/ui/plugins/similar_jobs/main.html Lines 70 to 71 in 84d8a71
And one more for the bug url: Lines 50 to 51 in 84d8a71
Could you also update the commit message to something like: Apart from that looking great! :-) |
Hi Ed, |
Great! :-) I've rebased against latest master, added back the angular one-time binding syntax (the ' Thank you for the patch! |
Bug 1060322 - Move hardcoded treeherder-ui URLs to a config file
Respected all,
I have moved only those URLs which have been repeated more than once in a angularJS app..There are a lot of changes( 8 i think) besides two file inclusions.I have tried my best to keep the basic code structure and philosophy intact.However i am a beginner so there can be mistakes..I have tested it locally(but partially) so i suggest the reviewer to kindly check it once.
In case of any suggestions/changes feel free to contact me at tapesh.mandal@gmail.com.My IRC nick tapesh and i hang out in #treeherder channel in irc.mozilla.org.
Regards
Tapesh Mandal