Skip to content

Commit 12dc12b

Browse files
committed
fix(integrations): resolve docsLink once when checking the vendor allowlist
The stale-allowlist predicate read block.docsLink directly while the main loop read the resolved link, so an allowlisted block that dropped its explicit docsLink produced undefined from the optional chain, negated to true, and was treated as still vendor-linked — the stale entry went undetected. Record vendor-linked types during the single pass that already resolves each link, so both checks agree by construction.
1 parent 0cbce7a commit 12dc12b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/check-integration-catalog.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ const VENDOR_DOCS_INTEGRATIONS: ReadonlySet<string> = new Set([
104104
*/
105105
function verifyDocsLinks(blocks: readonly BlockConfig[]): void {
106106
const issues: string[] = []
107+
const vendorLinked = new Set<string>()
107108
for (const block of blocks) {
108109
const docsLink = block.docsLink ?? defaultIntegrationDocsUrl(block.type)
109110
if (!docsLink.startsWith(DOCS_ORIGIN)) {
111+
vendorLinked.add(block.type)
110112
if (!VENDOR_DOCS_INTEGRATIONS.has(block.type)) {
111113
issues.push(
112114
`"${block.type}" docsLink points outside ${DOCS_ORIGIN} (${docsLink}) — add it to VENDOR_DOCS_INTEGRATIONS if that is intentional`
@@ -119,12 +121,10 @@ function verifyDocsLinks(blocks: readonly BlockConfig[]): void {
119121
issues.push(`"${block.type}" docsLink 404s — no docs page at en/${page}.mdx (${docsLink})`)
120122
}
121123
}
122-
const staleAllowlist = [...VENDOR_DOCS_INTEGRATIONS].filter(
123-
(type) =>
124-
!blocks.some((block) => block.type === type && !block.docsLink?.startsWith(DOCS_ORIGIN))
125-
)
126-
for (const type of staleAllowlist) {
127-
issues.push(`"${type}" is in VENDOR_DOCS_INTEGRATIONS but no longer links to vendor docs`)
124+
for (const type of VENDOR_DOCS_INTEGRATIONS) {
125+
if (!vendorLinked.has(type)) {
126+
issues.push(`"${type}" is in VENDOR_DOCS_INTEGRATIONS but no longer links to vendor docs`)
127+
}
128128
}
129129
if (issues.length > 0) {
130130
throw new Error(

0 commit comments

Comments
 (0)