Skip to content

Commit

Permalink
Homepage|Build Repository: Parse the releaseNotes URI from a build event
Browse files Browse the repository at this point in the history
This URI is presently stored as a property of a logical BuildEvent.

Todo: Refactor as a property of AbstractPackage.
  • Loading branch information
danij-deng committed Mar 16, 2012
1 parent 24730b9 commit 74dd179
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions web/plugins/buildrepository/buildevent.class.php
Expand Up @@ -32,6 +32,7 @@ class BuildEvent
private $authorName;
private $authorEmail;
private $releaseTypeId;
private $releaseNotesUri = NULL;

/// @todo Collections should be private but allow public iteration.
public $packages = array();
Expand Down Expand Up @@ -85,6 +86,21 @@ public function releaseTypeId()
return $this->releaseTypeId;
}

public function hasReleaseNotesUri()
{
return !is_null($this->releaseNotesUri);
}

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

public function setReleaseNotesUri($newUri)
{
$this->releaseNotesUri = "$newUri";
}

public function addPackage(&$package)
{
$this->packages[] = $package;
Expand Down
5 changes: 5 additions & 0 deletions web/plugins/buildrepository/buildlogparser.class.php
Expand Up @@ -223,6 +223,11 @@ private static function parseBuildEvent(&$log_event)
$releaseType = RT_UNSTABLE;

$event = new BuildEvent($uniqueId, $startDate, $authorName, $authorEmail, $releaseType);
if(!empty($log_event->releaseNotes))
{
$event->setReleaseNotesUri(clean_text($log_event->releaseNotes));
}

return $event;
}
}

0 comments on commit 74dd179

Please sign in to comment.