Skip to content

Commit

Permalink
Branch: allow access to description
Browse files Browse the repository at this point in the history
fixes #2604
  • Loading branch information
Thomas-Gelf committed Sep 21, 2022
1 parent c91ff33 commit 79f8ca2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/82-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ v1.10.0 (unreleased)
* BREAKING: configuration baskets no longer contain originalId (#2549)
* FEATURE: exporting/snapshot-logic has been centralized (#2549)

### Configuration Branches
* FEATURE: merge comments can now be proposed (#2604)

### REST API
* FIX: addressing service templates by name has been fixed (#2487)
* FEATURE: Stack traces can now be requested (#2570)
Expand Down
20 changes: 20 additions & 0 deletions library/Director/Db/Branch/Branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static function fromDbRow(stdClass $row)
$self->branchUuid = Uuid::fromBytes(Db\DbUtil::binaryResult($row->uuid));
$self->name = $row->branch_name;
$self->owner = $row->owner;
$self->description = $row->description;
$self->tsMergeRequest = $row->ts_merge_request;
if (isset($row->cnt_activities)) {
$self->cntActivities = $row->cnt_activities;
Expand Down Expand Up @@ -181,6 +182,25 @@ public function getName()
return $this->name;
}

/**
* @since v1.10.0
* @return string
*/
public function getDescription()
{
return $this->description;
}

/**
* @since v1.10.0
* @param ?string $description
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}

/**
* @return string
*/
Expand Down
3 changes: 2 additions & 1 deletion library/Director/Db/Branch/BranchStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ protected function newFromDbResult($query)
public function setReadyForMerge(Branch $branch)
{
$update = [
'ts_merge_request' => (int) floor(microtime(true) * 1000000)
'ts_merge_request' => (int) floor(microtime(true) * 1000000),
'description' => $branch->getDescription(),
];

$name = $branch->getName();
Expand Down

0 comments on commit 79f8ca2

Please sign in to comment.