summaryrefslogtreecommitdiffstats
path: root/security/nss/automation/taskcluster/graph/src/try_syntax.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:06:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:06:40 +0100
commitf4a12fc67689a830e9da1c87fd11afe5bc09deb3 (patch)
tree211ae0cd022a6c11b0026ecc7761a550c584583c /security/nss/automation/taskcluster/graph/src/try_syntax.js
parentf7d30133221896638f7bf4f66c504255c4b14f48 (diff)
downloadUXP-f4a12fc67689a830e9da1c87fd11afe5bc09deb3.tar
UXP-f4a12fc67689a830e9da1c87fd11afe5bc09deb3.tar.gz
UXP-f4a12fc67689a830e9da1c87fd11afe5bc09deb3.tar.lz
UXP-f4a12fc67689a830e9da1c87fd11afe5bc09deb3.tar.xz
UXP-f4a12fc67689a830e9da1c87fd11afe5bc09deb3.zip
Issue #1338 - Part 2: Update NSS to 3.48-RTM
Diffstat (limited to 'security/nss/automation/taskcluster/graph/src/try_syntax.js')
-rw-r--r--security/nss/automation/taskcluster/graph/src/try_syntax.js42
1 files changed, 37 insertions, 5 deletions
diff --git a/security/nss/automation/taskcluster/graph/src/try_syntax.js b/security/nss/automation/taskcluster/graph/src/try_syntax.js
index f1772a658..ca0b84813 100644
--- a/security/nss/automation/taskcluster/graph/src/try_syntax.js
+++ b/security/nss/automation/taskcluster/graph/src/try_syntax.js
@@ -3,8 +3,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import * as queue from "./queue";
+import path from 'path'
+import fs from 'fs'
import intersect from "intersect";
import parse_args from "minimist";
+import util from "util";
+import child_process from 'child_process';
+
+let execFile = util.promisify(child_process.execFile);
function parseOptions(opts) {
opts = parse_args(opts.split(/\s+/), {
@@ -51,7 +57,7 @@ function parseOptions(opts) {
}
// Parse tools.
- let allTools = ["clang-format", "scan-build", "hacl", "saw", "abi", "coverage"];
+ let allTools = ["clang-format", "scan-build", "coverity", "hacl", "saw", "abi", "coverage"];
let tools = intersect(opts.tools.split(/\s*,\s*/), allTools);
// If the given value is "all" run all tools.
@@ -154,14 +160,40 @@ function filter(opts) {
}
}
-export function initFilter() {
- let comment = process.env.TC_COMMENT || "";
+async function getCommitComment() {
+ const res = await execFile('hg', ['log', '-r', '.', '-T', '{desc}']);
+ return res.stdout;
+};
+
+export async function initFilter() {
+ let comment = await getCommitComment();
+
+ // Load try_task_config.json
+ // Add parameters to queue for created tasks
+ let config_path = path.normalize(path.join(__dirname, '../../../../try_task_config.json'))
+ if (fs.existsSync(config_path)) {
+ var payload = JSON.parse(fs.readFileSync(config_path));
+ if (payload['version'] == 2) {
+ queue.addParameters(payload['parameters']);
+ }
+ }
// Check for try syntax in changeset comment.
- let match = comment.match(/^\s*try:\s*(.*)\s*$/);
+ let match = comment.match(/\btry:\s*(.*)\s*$/m);
// Add try syntax filter.
if (match) {
- queue.filter(filter(parseOptions(match[1])));
+ let match1 = match[1];
+ queue.filter(filter(parseOptions(match1)));
+
+ if (match1.includes("--nspr-patch")) {
+ queue.map(task => {
+ if (!task.env) {
+ task.env = {};
+ }
+ task.env.ALLOW_NSPR_PATCH = "1";
+ return task;
+ });
+ }
}
}