fix(runs): honest empty state — feature off vs. no runs yet
Some checks are pending
Security / Security check (push) Waiting to run
Some checks are pending
Security / Security check (push) Waiting to run
The empty state unconditionally claimed background runs were switched off, even on hubs where the operator had enabled them. The hub now reports the flag on the list RPC (detached_enabled); the hint picks the truthful variant. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
5aa69104e7
commit
ae97b88257
7 changed files with 34 additions and 10 deletions
|
|
@ -1136,16 +1136,19 @@ class HubService {
|
|||
Future<void> reject(String id, String reviewer, String reason) =>
|
||||
_client.reject(approvalId: id, reviewer: reviewer, reason: reason);
|
||||
|
||||
/// Every tracked detached invocation (newest-first). Optionally
|
||||
/// scoped to one [project]. Empty when detached invocations are
|
||||
/// disabled or none have run this process.
|
||||
Future<List<DetachedRun>> listDetachedRuns({String project = ''}) async {
|
||||
final entries = await _client.listInvocations();
|
||||
final runs = entries
|
||||
/// Detached-runs monitor snapshot: every tracked invocation
|
||||
/// (newest-first, optionally scoped to one [project]) plus whether
|
||||
/// the operator enabled the feature at all — so the empty state
|
||||
/// can say "switched off" vs. "on, but no runs yet" truthfully.
|
||||
Future<({List<DetachedRun> runs, bool enabled})> listDetachedRuns({
|
||||
String project = '',
|
||||
}) async {
|
||||
final r = await _client.listInvocationsFull();
|
||||
final runs = r.invocations
|
||||
.where((e) => project.isEmpty || e.project == project)
|
||||
.map(DetachedRun.fromEntry)
|
||||
.toList();
|
||||
return runs;
|
||||
return (runs: runs, enabled: r.detachedEnabled);
|
||||
}
|
||||
|
||||
/// Cancel a running/pending detached invocation. Returns true when
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue