mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
desktop: Refresh CI status on job updates
Every status chip of a repository shares one list of its jobs, which refreshes when a job changes, at most every few seconds, since listing them scans every job of the repository.
This commit is contained in:
@@ -35,6 +35,7 @@ export const keys = {
|
||||
patchList: (rid: string, status: string) =>
|
||||
["repo", rid, "patches", status] as const,
|
||||
patch: (rid: string, id: string) => ["repo", rid, "patch", id] as const,
|
||||
jobs: (rid: string) => ["repo", rid, "jobs"] as const,
|
||||
repos: () => ["repos"] as const,
|
||||
notificationCount: () => ["notifications", "count"] as const,
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface RefUpdate {
|
||||
|
||||
const ISSUE = "xyz.radicle.issue";
|
||||
const PATCH = "xyz.radicle.patch";
|
||||
const JOB = "xyz.radworks.job";
|
||||
|
||||
export function affectedKeys({ rid, refs }: RefUpdate): Key[] {
|
||||
if (refs === undefined) {
|
||||
@@ -32,6 +33,10 @@ export function affectedKeys({ rid, refs }: RefUpdate): Key[] {
|
||||
add(keys.patch(rid, cob[2]));
|
||||
add(keys.patches(rid));
|
||||
add(keys.repoInfo(rid));
|
||||
} else if (cob && cob[1] === JOB) {
|
||||
// A job names its commit only in its contents, so every job list of
|
||||
// the repository is affected.
|
||||
add(keys.jobs(rid));
|
||||
} else if (/^refs\/(heads|tags)\//.test(name)) {
|
||||
add(keys.code(rid));
|
||||
add(keys.repoInfo(rid));
|
||||
|
||||
Reference in New Issue
Block a user