fix: align dashboard qa fallback and visibility filter

This commit is contained in:
2026-04-06 21:26:16 +09:00
parent 6f0ed33424
commit 1d851a3b14
2 changed files with 14 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ interface FreshnessMeta {
qaDocLatestAt: string | null;
}
const QA_PATH_CANDIDATES = ['.plans/qa/', '.qa/'];
const QA_PATH_CANDIDATES = ['.plans/qa/', '.qa/', 'qa/'];
const SISTER_ROLES: Record<string, string> = {
harang: 'Plan & Assign',
narang: 'Implement',

View File

@@ -199,7 +199,7 @@ export class ProjectsService {
orderBy: { updatedAt: 'desc' },
});
const [repoMetaMap, repoDocsMap] = await Promise.all([
const [{ repoMetaMap, sourceAvailable }, repoDocsMap] = await Promise.all([
this.getRepoMetaMap(),
this.getRepoDocumentMap(
dbProjects.map((project) => normalizeRepoName(project.repoUrl)),
@@ -240,8 +240,13 @@ export class ProjectsService {
updatedAt: repoMeta?.updatedAt ?? project.updatedAt.toISOString(),
});
if (visibilityFilter && repoMeta?.visibility !== visibilityFilter) {
return null;
if (visibilityFilter) {
if (!sourceAvailable || !repoMeta?.visibility) {
return null;
}
if (repoMeta.visibility !== visibilityFilter) {
return null;
}
}
return {
@@ -392,8 +397,11 @@ export class ProjectsService {
number,
{ openPRs: number; updatedAt: string; visibility: ProjectVisibility }
> = {};
let sourceAvailable = false;
try {
const repos = await this.gitea.getOrgRepos();
sourceAvailable = repos.length > 0;
for (const repo of repos) {
repoMetaMap[repo.id] = {
openPRs: repo.open_pr_counter,
@@ -404,7 +412,8 @@ export class ProjectsService {
} catch {
this.logger.warn('Gitea unavailable, using DB data only');
}
return repoMetaMap;
return { repoMetaMap, sourceAvailable };
}
private async getRepoDocumentMap(repoNames: string[]) {