fix: finalize acceptance identity and raw QA review evidence
Docker Build and Publish / build (push) Waiting to run
Docker Build and Publish / build (push) Waiting to run
This commit is contained in:
1 parent
5c9157f5d7
commit
e26b5bc6ca
7 files changed
+110
-17
No files matched your search
@@ -33,7 +33,13 @@ final class Acceptance {
|
||||
$j['id']=$u->id;$j['state']='active';if($apply)writeJson($path,$j);
|
||||
return ['state'=>'ready','id'=>$u->id,'owned'=>$j['owned']];
|
||||
}
|
||||
$u=User::where('group_id',$group)->where('banned',0)->whereRaw('u+d<transfer_enable')->where(fn($q)=>$q->whereNull('expired_at')->orWhere('expired_at','>=',time()))->where('email','not like','node-qa-%')->where('email','not like','batch-acceptance-%')->orderBy('id')->first();
|
||||
$u=null;
|
||||
$candidates=User::where('group_id',$group)->where('banned',0)->whereRaw('u+d<transfer_enable')->where(fn($q)=>$q->whereNull('expired_at')->orWhere('expired_at','>=',time()))->where('email','not like','node-qa-%')->where('email','not like','batch-acceptance-%')->orderByDesc('is_admin')->orderBy('id')->limit(20)->get();
|
||||
foreach($candidates as $candidate){
|
||||
$effective=true;
|
||||
foreach(ServerService::getAvailableServers($candidate) as $s)if(!ServerService::getAvailableUsers(Server::findOrFail($s['id']))->contains('id',$candidate->id)){$effective=false;break;}
|
||||
if($effective){$u=$candidate;break;}
|
||||
}
|
||||
if(!$apply)return ['state'=>$u?'existing':'would_create'];
|
||||
$j=['group'=>$group,'state'=>'prepared','owned'=>!$u,'email'=>$u?->email??'batch-acceptance-'.substr(hash('sha256',$dir),0,12).'-'.Str::lower(Str::random(8)).'@example.invalid','uuid'=>$u?->uuid??(string)Str::uuid(),'token'=>$u?->token??Str::random(32),'quota'=>104857600,'expires_at'=>time()+3600];
|
||||
// Persist identity before commit. A lost response resumes the same row, never another user.
|
||||
|
||||
Reference in new issue
Block a user