[gnome-continuous] task: Write buildPath to meta.json, not buildName
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous] task: Write buildPath to meta.json, not buildName
- Date: Mon, 18 Nov 2013 01:15:56 +0000 (UTC)
commit 657b74a61dadbfbcdf9addc2a4f6b854aae983d9
Author: Colin Walters <walters verbum org>
Date: Sun Nov 17 19:48:05 2013 -0500
task: Write buildPath to meta.json, not buildName
Ok, things are getting ugly here; what we really should move towards
is calling it 'buildPath' internally.
The goal is that 'buildPath', is the new thing, and we only convert to
the YMD.SERIAL format for visual display.
extras/build.gnome.org/controllers.js | 12 +++++-------
extras/ircbot/bot.py | 10 +++++++---
src/js/task.js | 4 ++--
3 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index fb32f7e..0d1d38a 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -17,7 +17,7 @@
function versionToRelpath(version) {
var match = YMD_SERIAL_VERSION_RE.exec(version);
- return 'builds/' + match[1] + '/' + match[2] + '/' +
+ return match[1] + '/' + match[2] + '/' +
match[3] + '/' + match[4];
};
@@ -25,25 +25,23 @@
console.log("request meta.json");
$http.get(ROOT + 'results/tasks/build/build/meta.json').success(function(data) {
$scope.status = data.success ? 'good' : 'bad';
- $scope.buildVersion = relpathToVersion(data.buildName);
+ $scope.buildVersion = relpathToVersion(data.buildPath);
console.log("scope.buildVersion=" + $scope.buildVersion);
});
});
bgoControllers.controller('ContinuousBuildViewCtrl', function($scope, $http, $routeParams) {
var buildVersion = $routeParams.buildVersion;
- console.log("buildVersion=" + buildVersion);
$scope.buildVersion = buildVersion;
- $scope.buildPath = versionToRelpath(buildName);
- var buildRoot = ROOT + $scope.buildPath + '/';
+ var buildRoot = ROOT + 'builds/' + $scope.buildPath + '/';
var tasks = [];
taskNames.forEach(function(taskName) {
$http.get(buildRoot + taskName + '/meta.json').success(function(data) {
// Mangle the data a bit so we can render it better
data['name'] = taskName;
- data['version'] = relpathToVersion(data['buildName']);
+ data['version'] = relpathToVersion(data['buildPath']);
tasks.push(data);
});
});
@@ -82,7 +80,7 @@
// Just get the most recent build for now. We need an
// API to iterate over all the builds.
$http.get(ROOT + 'results/tasks/build/build/meta.json').success(function(data) {
- data.buildVersion = relpathToVersion(data.buildName);
+ data.buildVersion = relpathToVersion(data.buildPath);
builds.push(data);
});
$scope.builds = builds;
diff --git a/extras/ircbot/bot.py b/extras/ircbot/bot.py
index 9ba2a4b..293601d 100644
--- a/extras/ircbot/bot.py
+++ b/extras/ircbot/bot.py
@@ -109,10 +109,10 @@ class BuildGnomeOrg(irc.IRCClient):
if metadata is None:
return None
- build_name = metadata['buildName']
+ build_name = metadata['buildPath']
last_state = self._last_task_state.get(taskname)
- last_build_name = last_state['buildName'] if last_state else None
+ last_build_name = last_state['buildPath'] if last_state else None
build_unchanged = (build_name == last_build_name)
self._last_task_state[taskname] = metadata
@@ -122,9 +122,13 @@ class BuildGnomeOrg(irc.IRCClient):
else:
return last_state, metadata, status_msg
+ def _relpath_to_version(self, relpath):
+ parts = relpath.split('/')
+ return parts[0] + parts[1] + parts[2] + '.' + parts[3];
+
def _status_line_for_task(self, taskname):
metadata, status_msg = self._get_task_state(taskname)
- build_name = metadata['buildName']
+ build_name = self._relpath_to_version(metadata['buildPath'])
millis = float(metadata['elapsedMillis'])
success = metadata['success']
success_str = success and 'successful' or 'failed'
diff --git a/src/js/task.js b/src/js/task.js
index c16cc3e..fe6ec1d 100644
--- a/src/js/task.js
+++ b/src/js/task.js
@@ -416,7 +416,7 @@ const TaskRunner = new Lang.Class({
let targetPath = this.workdir.get_relative_path(this.taskCwd);
let meta = { taskMetaVersion: 0,
- buildName: this.buildName,
+ buildPath: this.buildName,
complete: false,
path: targetPath };
JsonUtil.writeJsonFileAtomic(this.taskCwd.get_child('meta.json'), meta, cancellable);
@@ -445,7 +445,7 @@ const TaskRunner = new Lang.Class({
let targetPath = this.workdir.get_relative_path(this.taskCwd);
let meta = { taskMetaVersion: 0,
- buildName: this.buildName,
+ buildPath: this.buildName,
complete: true,
success: success,
errmsg: errmsg,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]