This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export const PinBoardContext = React.createContext({ | |
pinnedJobs: [], | |
relatedBugs: [], | |
pinJob: () => { console.log("pinJob raw"); }, | |
addBug: () => { console.log("addBug raw"); }, | |
}); | |
export function withPinBoard(Component) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove disabling when there is more than one export in the file. | |
// eslint-disable-next-line import/prefer-default-export | |
export const highlightCommonTerms2 = function highlightCommonTerms2(text, terms) { | |
const termTokens = terms.split(/[^a-zA-Z0-9_-]+/); | |
const textTokens = text.split(" "); | |
// can we do an "includes" that works on substrings? Otherwise write your own checker | |
return ( | |
<span> | |
{textTokens.map((textElem, idx) => ( | |
termTokens.some(arrElem => (textElem.replace(/\W/g, '') === arrElem)) ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
treeherder.filter('highlightCommonTerms2', function () { | |
return function (input) { | |
const compareStr = Array.prototype.slice.call(arguments, 1).filter(x => x).join(" "); | |
let tokens = compareStr.split(/[^a-zA-Z0-9]+/).map(item => item.toLowerCase()); | |
tokens = [ ...new Set(tokens) ]; // remove duplicates | |
console.log("tokens", tokens); | |
const subs = tokens.reduce((subAcc, token) => { | |
let innerSubs = tokens.filter(innerToken => (innerToken.includes(token))); | |
let substr = innerSubs.filter(sub => sub !== token); | |
return [ ...subAcc, ...substr ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene_django.filter import DjangoFilterConnectionField | |
from graphql.utils.ast_to_dict import ast_to_dict | |
def collect_fields(node): | |
non_fields = ["edges", "node"] | |
fields = [] | |
for leaf in node: | |
if leaf.get('kind', None) == "Field" and not leaf["name"]["value"] in non_fields: | |
fields.append(leaf["name"]["value"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
This ended up being fast enough to not need the spinner. and it may | |
have even slowed it down a bit, not clear. But this might be handy some day. | |
*/ | |
var ReactSelectComponent = React.createClass({ | |
displayName: 'ReactSelectComponent', | |
propTypes: { | |
list: React.PropTypes.array.isRequired, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from thclient import (TreeherderClient, | |
TreeherderJobCollection) | |
job = { | |
"job_guid": "1a1f13c7-f14d-48c6-8d6b-cb08501ef42c/1", | |
"build_system_type": "taskcluster", | |
"build_platform": { | |
"platform": "b2g-emu-jb", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootScope.$on(thEvents.selectNextJob, function(ev){ | |
var jobMap = ThResultSetModel.getJobMap($rootScope.repoName); | |
var el, key, job; | |
var jobs = $(".th-view-content .job-btn"); | |
var idx = jobs.index(jobs.filter(".selected-job")); | |
idx = idx+1 > _.size(jobs)? 0: idx+1; | |
el = $(jobs[idx]); | |
while (el.css('display') === "none") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[email protected] ~]$ mysql -h treeherder-stage-ro-vip.db.scl3.mozilla.com -u th_user -p | |
Enter password: | |
ERROR 2003 (HY000): Can't connect to MySQL server on 'treeherder-stage-ro-vip.db.scl3.mozilla.com' (110) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function super { | |
sudo supervisord -c deployment/supervisord/$1_node.conf | |
} | |
cd ~/treeherder-service | |
export PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var updateAllWatchedRepoTreeStatus = function() { | |
$log.debug("updateAllWatchedRepoTreeStatus", repos); | |
_.each(_.keys(repos), function(repo) { | |
_.defer(updateTreeStatus, repo); | |
}); | |
}; |
NewerOlder