fix(qa): exclude archived categories from all profile

This commit is contained in:
Vincent Koc
2026-06-23 11:51:48 +08:00
parent cfff6b2ac6
commit c8ca44739a
2 changed files with 28 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ function testMaturityTaxonomy(params?: {
coverageIds?: readonly string[];
featureCoverageIds?: readonly (readonly string[])[];
includeAllCategories?: boolean;
includeArchivedSurface?: boolean;
profileCategoryIds?: readonly string[];
}): QaMaturityTaxonomy {
const categoryId = params?.categoryId ?? TEST_EXECUTABLE_CATEGORY_ID;
@@ -74,6 +75,27 @@ function testMaturityTaxonomy(params?: {
},
],
},
...(params?.includeArchivedSurface
? [
{
id: "archived-surface",
name: "Archived surface",
family: "test",
level: "experimental",
archived: true,
categories: [
{
id: "legacy-category",
name: "Legacy category",
category_note: "legacy-category.md",
docs: [],
search_anchors: [],
features: [{ name: "legacy.feature", coverageIds: ["legacy.feature"] }],
},
],
},
]
: []),
],
};
}
@@ -445,6 +467,7 @@ describe("qa coverage report", () => {
const report = buildQaScorecardTaxonomyReport({
taxonomy: testMaturityTaxonomy({
includeAllCategories: true,
includeArchivedSurface: true,
}),
repoRoot: process.cwd(),
scenarios: [],
@@ -454,6 +477,10 @@ describe("qa coverage report", () => {
TEST_EXECUTABLE_CATEGORY_ID,
]);
expect(report.requiredCategoryCount).toBe(1);
expect(report.categoryCount).toBe(1);
expect(report.profiles.find((profile) => profile.id === "release")?.categoryIds).not.toContain(
"archived-surface.legacy-category",
);
});
it("reports profile categories missing primary coverage evidence", () => {

View File

@@ -802,7 +802,7 @@ function buildMaturityRefs(taxonomy: QaMaturityTaxonomy | null) {
return { categories, coverageIds };
}
for (const surface of taxonomy.surfaces) {
for (const surface of activeQaMaturityTaxonomySurfaces(taxonomy)) {
for (const category of surface.categories) {
const categoryId = `${surface.id}.${category.id}`;
const features = category.features.map((feature) => ({