Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/architectures/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion data/members.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/architectures/allianz/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions tests/architecture-catalog-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
});
Loading