Skip to content

Commit

Permalink
Homepage|Build Repository: Added "release_changeloguri" to build JSON…
Browse files Browse the repository at this point in the history
… object graph

The change log URI for a build event is now parsed from the XML
event feed, attributed to each Package and then written to the
cached JSON object graph.
  • Loading branch information
danij-deng committed May 24, 2012
1 parent ef78186 commit 2a24d69
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
17 changes: 17 additions & 0 deletions web/plugins/buildrepository/buildevent.class.php
Expand Up @@ -31,8 +31,10 @@ class BuildEvent
private $startDate;
private $authorName;
private $authorEmail;

private $releaseTypeId;
private $releaseNotesUri = NULL;
private $releaseChangeLogUri = NULL;

// Event chains:
private $prevForStartDate = NULL;
Expand Down Expand Up @@ -107,6 +109,21 @@ public function setReleaseNotesUri($newUri)
$this->releaseNotesUri = "$newUri";
}

public function hasReleaseChangeLogUri()
{
return !is_null($this->releaseChangeLogUri);
}

public function releaseChangeLogUri()
{
return $this->releaseChangeLogUri;
}

public function setReleaseChangeLogUri($newUri)
{
$this->releaseChangeLogUri = "$newUri";
}

public function addPackage(&$package)
{
$this->packages[] = $package;
Expand Down
8 changes: 8 additions & 0 deletions web/plugins/buildrepository/buildlogparser.class.php
Expand Up @@ -109,6 +109,10 @@ private static function parseBuildLogDOM(&$log, &$builds)
{
$pack->setReleaseNotesUri($build->releaseNotesUri());
}
if($build->hasReleaseChangeLogUri())
{
$pack->setReleaseChangeLogUri($build->releaseChangeLogUri());
}

$build->addPackage($pack);
}
Expand Down Expand Up @@ -227,6 +231,10 @@ private static function parseBuildEvent(&$log_event)
{
$event->setReleaseNotesUri(clean_text($log_event->releaseNotes));
}
if(!empty($log_event->changeLog))
{
$event->setReleaseChangeLogUri(clean_text($log_event->changeLog));
}

return $event;
}
Expand Down
8 changes: 8 additions & 0 deletions web/plugins/buildrepository/buildrepository.php
Expand Up @@ -592,6 +592,10 @@ private function chainBuildsByDoomsdayVersion()
{
$build->setReleaseNotesUri($pack->releaseNotesUri());
}
if($pack->hasReleaseChangeLogUri())
{
$build->setReleaseChangeLogUri($pack->releaseChangeLogUri());
}
$build->addPackage($pack);
}

Expand Down Expand Up @@ -1297,6 +1301,10 @@ private function populateReleases(&$releases)
{
$build->setReleaseNotesUri($pack->releaseNotesUri());
}
if($pack->hasReleaseChangeLogUri())
{
$build->setReleaseChangeLogUri($pack->releaseChangeLogUri());
}
$build->addPackage($pack);
}

Expand Down
19 changes: 19 additions & 0 deletions web/plugins/buildrepository/packages/abstractpackage.class.php
Expand Up @@ -32,6 +32,7 @@ abstract class AbstractPackage extends BasePackage implements iDownloadable

protected $directDownloadUri = NULL;
protected $releaseNotesUri = NULL;
protected $releaseChangeLogUri = NULL;

protected $compileLogUri = NULL;
protected $compileWarnCount = NULL;
Expand All @@ -57,6 +58,9 @@ public function populateGraphTemplate(&$tpl)

$tpl['direct_download_uri'] = $this->directDownloadUri();

if($this->hasReleaseChangeLogUri())
$tpl['release_changeloguri'] = $this->releaseChangeLogUri;

if($this->hasReleaseNotesUri())
$tpl['release_notesuri'] = $this->releaseNotesUri;

Expand Down Expand Up @@ -85,6 +89,21 @@ public function setReleaseNotesUri($newUri)
$this->releaseNotesUri = "$newUri";
}

public function hasReleaseChangeLogUri()
{
return !is_null($this->releaseChangeLogUri);
}

public function releaseChangeLogUri()
{
return $this->releaseChangeLogUri;
}

public function setReleaseChangeLogUri($newUri)
{
$this->releaseChangeLogUri = "$newUri";
}

public function hasCompileLogUri()
{
return !is_null($this->compileLogUri);
Expand Down

0 comments on commit 2a24d69

Please sign in to comment.