re Issue 25: Add B2G18 tree, and set flag unconditionally for this tree
authorGraeme McCutcheon <graememcc_firefox@graeme-online.co.uk>
Fri, 21 Dec 2012 16:53:20 +0000
changeset 1187 8553af356ffb0702956f711c2285205e8cebc980
parent 1186 2e17dbe6f3c53197aa9becbc1384102cddf536ed
child 1188 2e52155638bbde15bcaf8baf1736eb74ddfe656f
push id659
push useremorley@mozilla.com
push dateTue, 18 Jun 2013 13:49:17 +0000
re Issue 25: Add B2G18 tree, and set flag unconditionally for this tree
mcmerge/js/Config.js
mcmerge/js/Step.js
mcmerge/php/getFlags.php
--- a/mcmerge/js/Config.js
+++ b/mcmerge/js/Config.js
@@ -57,188 +57,229 @@ var Config = {
     "thunderbird-release": "comm-release",
     "thunderbird-esr10": "comm-esr10",
   },
 
   treeInfo: {
     "mozilla-inbound": {
       repo: "integration/mozilla-inbound",
       trackedTree: false,
+      unconditionalFlag: false,
       synonyms: ["mozilla-inbound", "inbound", "m-i", "mi"]
     },
     "mozilla-aurora": {
       repo: "releases/mozilla-aurora",
       trackedTree: true,
+      unconditionalFlag: false,
       synonyms: ["releases/mozilla-aurora", "mozilla-aurora"]
     },
     "mozilla-beta": {
       repo: "releases/mozilla-beta",
       trackedTree: true,
+      unconditionalFlag: false,
       synonyms: ["releases/mozilla-beta", "mozilla-beta"]
     },
     "mozilla-release": {
       repo: "releases/mozilla-release",
       trackedTree: true,
+      unconditionalFlag: false,
       synonyms: ["releases/mozilla-release", "mozilla-release"]
     },
     "mozilla-esr10": {
       repo: "releases/mozilla-esr10",
       trackedTree: true,
+      unconditionalFlag: false,
       synonyms: ["esr10", "releases/mozilla-esr10", "mozilla-esr10"]
     },
     "mozilla-esr17": {
       repo: "releases/mozilla-esr17",
       trackedTree: true,
+      unconditionalFlag: false,
       synonyms: ["esr17", "releases/mozilla-esr17", "mozilla-esr17"]
     },
     "jetpack": {
       repo: "projects/addon-sdk",
       trackedTree: false,
+      unconditionalFlag: false,
       synonyms: ["projects/addon-sdk", "addon-sdk"]
     },
     "build-system": {
       repo: "projects/build-system",
       trackedTree: false,
+      unconditionalFlag: false,
       synonyms: ["build-system", "b-s", "bs"]
     },
     "fx-team": {
       repo: "integration/fx-team",
       trackedTree: false,
+      unconditionalFlag: false,
       synonyms: ["fx-team"],
       additions: "[fixed-in-fx-team]"
     },
     "graphics": {
       repo: "projects/graphics",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/graphics", "graphics"]
     },
     "ionmonkey": {
       repo: "projects/ionmonkey",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/ionmonkey", "ionmonkey", "im"]
     },
     "jaegermonkey": {
       repo: "projects/jaegermonkey",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/jaegermonkey", "jm"]
     },
     "profiling": {
       repo: "projects/profiling",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["profiling", "projects/profiling"]
     },
     "services-central": {
       repo: "services/services-central",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["services-central", "s-c", "sc", "services/services-central"],
       additions: "[fixed in services]"
     },
     "ux": {
+      unconditionalFlag: false,
       repo: "projects/ux",
       synonyms: ["ux", "projects/ux"]
     },
     "alder": {
       repo: "projects/alder",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["alder", "projects/alder"]
     },
     "ash": {
       repo: "projects/ash",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["ash", "projects/ash"]
     },
     "birch": {
       repo: "projects/birch",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/birch", "birch"]
     },
     "cedar": {
       repo: "projects/cedar",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/cedar", "cedar"]
     },
     "elm": {
       repo: "projects/elm",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/elm", "elm"]
     },
     "holly": {
       repo: "projects/holly",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/holly", "holly"]
     },
     "larch": {
       repo: "projects/larch",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/larch", "larch"]
     },
     "maple": {
       repo: "projects/maple",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/maple", "maple"]
     },
     "oak": {
       repo: "projects/oak",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/oak", "oak"]
     },
     "pine": {
       repo: "projects/pine",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/pine", "pine"]
     },
     "accessibility": {
       repo: "projects/accessibility",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/accessibility", "accessibility"]
     },
     "devtools": {
       repo: "projects/devtools",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/devtools", "devtools"]
     },
     "electrolysis": {
       repo: "projects/electrolysis",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/electrolysis", "electrolysis", "e10s"]
     },
     "places": {
       repo: "projects/places",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["projects/places", "places"]
     },
     "comm-central": {
       repo: "comm-central",
+      unconditionalFlag: false,
       trackedTree: false,
       synonyms: ["comm-central", "c-c"]
     },
     "comm-aurora": {
       repo: "releases/comm-aurora",
+      unconditionalFlag: false,
       trackedTree: true,
       synonyms: ["releases/comm-aurora", "comm-aurora"]
     },
     "comm-beta": {
       repo: "releases/comm-beta",
+      unconditionalFlag: false,
       trackedTree: true,
       synonyms: ["releases/comm-beta", "comm-beta"]
     },
     "comm-release": {
       repo: "releases/comm-release",
+      unconditionalFlag: false,
       trackedTree: true,
       synonyms: ["releases/comm-release", "comm-release"]
     },
     "comm-esr10": {
       repo: "releases/comm-esr10",
+      unconditionalFlag: false,
       trackedTree: true,
       synonyms: ["releases/comm-esr10", "comm-esr10"]
     },
     "comm-esr17": {
       repo: "releases/comm-esr17",
+      unconditionalFlag: false,
       trackedTree: true,
       synonyms: ["releases/comm-esr17", "comm-esr17"]
+    },
+    "mozilla-b2g18": {
+      repo: "releases/mozilla-b2g18",
+      unconditionalFlag: true,
+      trackedTree: true,
+      synonyms: ["b2g", "b2g18", "mozilla-b2g18"]
     }
   }
 };
 
 Config.bugNumberREs = [Config.bugRE1, Config.bugRE2, Config.bugRE3,
                        Config.bugRE4, Config.bugRE5, Config.bugRE6, Config.bugRE7];
 
 (function () {
--- a/mcmerge/js/Step.js
+++ b/mcmerge/js/Step.js
@@ -558,16 +558,19 @@ Step.prototype.attachBugToCset = functio
     }
 
     // Release-tracking: determine if status-[tree]N can be set
     if (bug && bug.isTracked && (bug.statusFlag == '---' || bug.statusFlag == 'affected')) {
       if (isMC || Config.treeName == 'comm-central')
         this.bugInfo[bugID].canSetStatus = this.bugInfo[bugID].canResolve;
       else if (Config.treeInfo[Config.treeName].trackedTree)
         this.bugInfo[bugID].canSetStatus = true;
+    } else if (bug && Config.treeInfo[Config.treeName].trackedTree && Config.treeInfo[Config.treeName].unconditionalFlag) {
+        bug.isTracked = true;
+        this.bugInfo[bugID].canSetStatus = true;
     }
 
     // Allow setting of intestsuite if possible
     if (bug && bug.canSetTestsuite)
       this.bugInfo[bugID].intestsuite = bug.intestsuite;
 
     // Adjust the whiteboard the first time we see this bug
     if (bug)
@@ -949,17 +952,17 @@ Step.prototype.getAdditionalHelpText = f
     text += this.constructTextFor(this.leaveOpenBugs, leaveOpenPost, hashave);
 
   if (this.securityBugs.length > 0)
     text += this.constructTextFor(this.securityBugs, securityPost);
 
   if (this.hasMilestones.length > 0)
     text += this.constructTextFor(this.hasMilestones, milestonePost, already, true);
 
-  if (this.trackedBugs.length > 0)
+  if (this.trackedBugs.length > 0 && !Config.treeInfo[Config.treeName].unconditionalFlag)
     text += this.constructTextFor(this.trackedBugs, trackedPost, isare);
 
   return text;
 };
 
 
 Step.prototype.setStepNumber = function Step_setStepNumber(num) {
   this.stepNumber = num;
@@ -992,16 +995,19 @@ Step.prototype.getHeading = function Ste
 
 // Return the user-visible help text to be shown for this step
 Step.prototype.getHelpText = function Step_getHelpText() {
   var helpText = '';
   if (this.name in Step.helpTexts)
     helpText = Step.helpTexts[this.name];
   helpText += this.getAdditionalHelpText();
 
+  if (this.trackedBugs.length > 0 && Config.treeInfo[Config.treeName].unconditionalFlag)
+    helpText += '<br>- Submitted bugs will have ' + mcMerge.statusFlag + ' set to "fixed"';
+
   if (Step.remaps && 'items' in Step.remaps && Step.remaps.items > 0)
     helpText += '<br><strong>Note: You are in debug mode. Only remap bugs will be submitted, and will be submitted to landfill!</strong>';
   return helpText;
 };
 
 
 Step.helpTexts=  {
     fixes: 'The following fixes have landed. Double-check that the bug number has been correctly detected, and the correct comment attached, and that the "Comment" and "Resolve" flags have been correctly set. Click on "Submit" to submit these changes to Bugzilla.',
--- a/mcmerge/php/getFlags.php
+++ b/mcmerge/php/getFlags.php
@@ -9,25 +9,28 @@ try {
     "mozilla-central" => "mozilla-central/",
     "mozilla-aurora" => "releases/mozilla-aurora/",
     "mozilla-beta" => "releases/mozilla-beta/",
     "mozilla-release" =>  "releases/mozilla-release/",
     "comm-central" => "comm-central/",
     "comm-aurora" => "releases/comm-aurora/",
     "comm-beta" => "releases/comm-beta/",
     "comm-release" => "releases/comm-release/",
+    "mozilla-b2g18" => "releases/mozilla-b2g18/"
   );
 
   if (!(array_key_exists("tree", $_GET)) OR !(array_key_exists("cset", $_GET))) {
     exit(json_encode(array("error" => "tree or cset parameter missing")));
   }
 
   $tree = strtolower($_GET["tree"]);
 
   // The cset is irrelevant for ESR trees - we can go ahead and calculate the flag names now
+  // We do this before the check for valid tree names to avoid having to manually maintain a list
+  // of ESR trees
   if (preg_match("/-esr([1-9][\d]*)$/", $tree, $esrMatch) === 1) {
     $ver = $esrMatch[1];
     if (strpos($tree, "mozilla") === 0) {
       exit(json_encode(array("tracking" => "tracking_esr" . $ver, "status" => "status_esr" . $ver)));
     } else if (strpos($tree, "comm") === 0) {
       exit(json_encode(array("tracking" => "tracking_thunderbird_esr" . $ver, "status" => "status_thunderbird_esr" . $ver)));
     }
     exit(json_encode(array("error" => "unknown esr tree")));
@@ -39,16 +42,22 @@ try {
   }
 
   // Error out if the cset isn't in the correct format
   $cset = strtolower($_GET["cset"]);
   if (preg_match("/^(?:(?:tip)|(?:[\da-f]{12,40}))$/", $cset) !== 1) {
     exit(json_encode(array("error" => "invalid cset")));
   }
 
+  // Fast-path for b2g18
+  // XXX need to revist this once we know how b2g releases are managed post initial release
+  if ($tree === "mozilla-b2g18") {
+    exit(json_encode(array("tracking" => "tracking_b2g18", "status" => "status_b2g18")));
+  }
+
   $fileLocation = "/browser/config/version.txt";
   if (strpos($tree, "comm") === 0) {
     $fileLocation = "/mail/config/version.txt";
   }
 
   // Read the version from version.txt in the relevant repo
   $versionURL = $baseURL . $validTrees[$tree] . "raw-file/" . $cset . $fileLocation;