mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Add 'awaiting review' and 'reviewed' project statuses that update from GitHub; allow project owners to update their project statuses
This commit is contained in:
parent
b48f3a5798
commit
6378d687d8
12 changed files with 204 additions and 21 deletions
|
@ -16,10 +16,7 @@ use Safe\DateTimeImmutable;
|
|||
*/
|
||||
|
||||
/** @var array<Project> $projects */
|
||||
$projects = array_merge(
|
||||
Project::GetAllByStatus(Enums\ProjectStatusType::InProgress),
|
||||
Project::GetAllByStatus(Enums\ProjectStatusType::Stalled)
|
||||
);
|
||||
$projects = Project::GetAllByStatuses([Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::AwaitingReview, Enums\ProjectStatusType::Reviewed, Enums\ProjectStatusType::Stalled]);
|
||||
|
||||
$apiKey = trim(file_get_contents('/standardebooks.org/config/secrets/se-vcs-bot@api.github.com'));
|
||||
$oldestStalledTimestamp = new DateTimeImmutable('60 days ago');
|
||||
|
@ -34,7 +31,7 @@ foreach($projects as $project){
|
|||
}
|
||||
|
||||
try{
|
||||
$project->FetchLatestCommitTimestamp($apiKey);
|
||||
$project->FetchLastCommitTimestamp($apiKey);
|
||||
|
||||
}
|
||||
catch(Exceptions\AppException $ex){
|
||||
|
@ -42,8 +39,19 @@ foreach($projects as $project){
|
|||
}
|
||||
|
||||
if($project->IsStatusAutomaticallyUpdated){
|
||||
// Check if this project is in review.
|
||||
if($project->Status == Enums\ProjectStatusType::InProgress){
|
||||
$project->FetchReviewStatus();
|
||||
}
|
||||
|
||||
if(
|
||||
$project->Status == Enums\ProjectStatusType::InProgress
|
||||
(
|
||||
$project->Status == Enums\ProjectStatusType::InProgress
|
||||
||
|
||||
$project->Status == Enums\ProjectStatusType::AwaitingReview
|
||||
||
|
||||
$project->Status == Enums\ProjectStatusType::Reviewed
|
||||
)
|
||||
&&
|
||||
$project->LastActivityTimestamp < $oldestStalledTimestamp
|
||||
){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue