diff --git a/data/architectures/catalog.json b/data/architectures/catalog.json index 43618c91..ea52b397 100644 --- a/data/architectures/catalog.json +++ b/data/architectures/catalog.json @@ -32,7 +32,7 @@ "title": "Enabling Allianz Direct's scaling through Platform Engineering", "organization": "Allianz Direct", "summary": "The PE team is internally organised in DDOs - Distributed DevOps, where each ddo owns a Domain. This setup follows the reverse Conway manoeuver where the reference architecture structure dictates the teams setup.", - "industries": ["Financial", "Insurance"], + "industries": ["Financial Services", "Insurance"], "tags": ["finance", "insurance", "europe", "public cloud", "aws"], "projects": ["Kubernetes", "Helm", "Argo"], "sourceUrl": "https://github.com/cncf/architecture/tree/3ddf917facd0aea9694cc9c12c52e583fd2f86cb/content/en/architectures/allianz", diff --git a/data/members.json b/data/members.json index cfd44957..dd3089b3 100644 --- a/data/members.json +++ b/data/members.json @@ -139,7 +139,7 @@ "name": "Allianz", "slug": "allianz", "logo": "/img/architectures/allianz/logo.svg", - "industries": ["Financial", "Insurance"], + "industries": ["Financial Services", "Insurance"], "projects": ["Argo", "Helm", "Kubernetes"], "architectures": [ { diff --git a/docs/architectures/allianz/index.md b/docs/architectures/allianz/index.md index a9c82a94..717c8a00 100644 --- a/docs/architectures/allianz/index.md +++ b/docs/architectures/allianz/index.md @@ -5,7 +5,7 @@ architecture: organization: Allianz Direct summary: The PE team is internally organised in DDOs - Distributed DevOps, where each ddo owns a Domain. This setup follows the reverse Conway manoeuver where the reference architecture structure dictates the teams setup. industries: - - Financial + - Financial Services - Insurance tags: - finance diff --git a/tests/architecture-catalog-contract.test.mjs b/tests/architecture-catalog-contract.test.mjs index c3838cba..9b1ac2b6 100644 --- a/tests/architecture-catalog-contract.test.mjs +++ b/tests/architecture-catalog-contract.test.mjs @@ -294,3 +294,44 @@ test('no project is listed under two spellings across the catalog', () => { 'one project is spelled two ways, so the catalog filter offers it twice and each option hides the other spelling', ); }); + +// The industry filter on /architectures and /community/members works the same +// way, but industries are prose labels rather than project names, so two pages +// split one vertical by wording rather than by spelling ("Financial" against +// "Financial Services") and normalising case and punctuation does not catch it. +// Comparing word sets does: an industry whose words are all contained in +// another industry's words names the same vertical less completely. +function industryWords(industry) { + return new Set( + industry + .toLowerCase() + .split(/[^a-z0-9]+/) + .filter(Boolean), + ); +} + +function isSubsetOf(words, other) { + return [...words].every((word) => other.has(word)); +} + +test('no industry is listed under two labels across the catalog', () => { + const industries = [ + ...new Set(catalog.flatMap((record) => record.industries)), + ]; + const words = new Map( + industries.map((industry) => [industry, industryWords(industry)]), + ); + const collisions = []; + for (const [index, industry] of industries.entries()) + for (const other of industries.slice(index + 1)) + if ( + isSubsetOf(words.get(industry), words.get(other)) || + isSubsetOf(words.get(other), words.get(industry)) + ) + collisions.push(`${industry} vs ${other}`); + assert.deepEqual( + collisions.sort(), + [], + 'one industry is labelled two ways, so the industry filter offers it twice and each option hides the architectures filed under the other', + ); +});