Skip to content

Commit

Permalink
Beta page: code nits + avoid a slow hg call needed only in RC week
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed Jul 19, 2024
1 parent fb0b9cb commit f6d5c46
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/classes/ReleaseInsights/Beta.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

readonly class Beta
{
public readonly int $count;
public readonly int $number_betas;
public readonly bool $beta_cycle_ended;
public int $count;
public int $number_betas;
public bool $beta_cycle_ended;

public function __construct(public int $release = BETA) {
$this->count = (int) explode('b', FIREFOX_BETA)[1];
Expand All @@ -33,15 +33,15 @@ public function __construct(public int $release = BETA) {
$schedule = array_filter($schedule, fn($label) => str_starts_with($label, 'beta_'));
$this->number_betas = count($schedule);

// Check if the beta cycle is over
if (defined('TESTING_CONTEXT')) {
$this->beta_cycle_ended = true;
} else {
// Check if the beta cycle is over, this avoids a miscount for RC builds
if ($this->count >= $this->number_betas && ! defined('TESTING_CONTEXT')) {
// @codeCoverageIgnoreStart
$this->beta_cycle_ended = str_contains((string) get_headers(
URL::Mercurial->value . 'releases/mozilla-beta/json-pushes?fromchange=' . 'FIREFOX_BETA_' . BETA . '_END')[0],
'200');
// @codeCoverageIgnoreEnd
} else {
$this->beta_cycle_ended = false;
}
}

Expand Down

0 comments on commit f6d5c46

Please sign in to comment.