Skip to content

Commit fc678fa

Browse files
docs-botCopilotheiskr
authored
fix: correct 6 Liquid corruptions causing search scraping failures (SCRAPE-6642) (#61694)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
1 parent ce4b69f commit fc678fa

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

src/languages/lib/correct-translation-content.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ export function correctTranslatedContentStrings(
240240
'tienen prioridad sobre el envío automático de dependencias.{% endif %}\n',
241241
)
242242
}
243+
244+
// [SCRAPE-6642] admin/managing-iam/provisioning-user-accounts-with-scim/configuring-scim-provisioning-with-okta.md
245+
// (title): `{% ifversion ghec %}SCIM{% else %} con Okta` is never closed —
246+
// the `{% endif %}` is missing. The corrector runs on the PARSED title
247+
// value, so match the unquoted substring (no trailing YAML quote).
248+
content = content.replaceAll(
249+
'{% ifversion ghec %}SCIM{% else %} con Okta',
250+
'{% ifversion ghec %}SCIM{% else %} con Okta{% endif %}',
251+
)
243252
}
244253

245254
if (context.code === 'ja') {
@@ -864,6 +873,15 @@ export function correctTranslatedContentStrings(
864873
'{% else %} 的访问权限。',
865874
'{% else %}组织的设置{% endif %} 的访问权限。',
866875
)
876+
877+
// [SCRAPE-6642] admin/managing-iam/provisioning-user-accounts-with-scim/configuring-scim-provisioning-with-okta.md
878+
// (intro): `{% endif %}` appears before `{% ifversion ghec %}` — the two
879+
// tags are swapped, leaving an orphan endif and an unclosed ifversion.
880+
// Restore the English pattern: enterprise{% ifversion ghec %} on X or Y{% endif %}.
881+
content = content.replaceAll(
882+
'在{% data variables.product.prodname_dotcom_the_website %}或{% data variables.enterprise.data_residency_site %}{% endif %}上的企业{% ifversion ghec %}进行通信。',
883+
'的企业{% ifversion ghec %}在{% data variables.product.prodname_dotcom_the_website %}或{% data variables.enterprise.data_residency_site %}{% endif %}进行通信。',
884+
)
867885
}
868886

869887
if (context.code === 'ru') {
@@ -1178,6 +1196,17 @@ export function correctTranslatedContentStrings(
11781196
'{% ifversion enterprise-licensing-language %}license-language%else %}licenses{% license seats{% endif %}',
11791197
'{% ifversion enterprise-licensing-language %}licenses{% else %}licensed seats{% endif %}',
11801198
)
1199+
1200+
// [SCRAPE-6642] admin/managing-iam/provisioning-user-accounts-with-scim/configuring-scim-provisioning-with-okta.md
1201+
// (title): translator swapped the ghec/non-ghec branches and the `{% else %}`
1202+
// ended up as an orphan after the `{% endif %}` already closed the block.
1203+
// Reconstruct to match English: Configuring {% ifversion ghec %}SCIM{% else %}authentication and{% endif %} provisioning with Okta.
1204+
// The corrector runs on the PARSED title value, so match the unquoted
1205+
// substring (no trailing YAML quote).
1206+
content = content.replaceAll(
1207+
'{% ifversion ghec %}аутентификации и{% endif %} провизионирования SCIM{% else %}с помощью Okta',
1208+
'{% ifversion ghec %}SCIM{% else %}аутентификации и{% endif %} провизионирования с помощью Okta',
1209+
)
11811210
}
11821211

11831212
if (context.code === 'fr') {
@@ -1535,6 +1564,16 @@ export function correctTranslatedContentStrings(
15351564
'{% else %}에 대한 액세스를 제어할 수 있습니다.',
15361565
'{% else %}조직의 설정{% endif %}에 대한 액세스를 제어할 수 있습니다.',
15371566
)
1567+
1568+
// [SCRAPE-6642] code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/configuring-code-scanning-for-your-appliance.md
1569+
// (intro): the second `{% ifversion default-setup-self-hosted-runners-GHEC %}`
1570+
// is a corruption — it should be `{% endif %}` to close the first one.
1571+
// This left the `{% ifversion %}` block unclosed and broke the
1572+
// /ko/code-security landing page scrape. Restore the endif.
1573+
content = content.replaceAll(
1574+
'{% data variables.product.prodname_dotcom %}.{% ifversion default-setup-self-hosted-runners-GHEC %}',
1575+
'{% data variables.product.prodname_dotcom %}.{% endif %}',
1576+
)
15381577
}
15391578

15401579
if (context.code === 'de') {
@@ -1718,6 +1757,26 @@ export function correctTranslatedContentStrings(
17181757
'Mit angepassten Organisationsrollen kannst du den Zugriff auf die Einstellungen deiner {% ifversion org-custom-role-with-repo-permissions %}Organisation und die Repositories{% else %}einer Organisation steuern.',
17191758
'Mit angepassten Organisationsrollen kannst du den Zugriff auf die Einstellungen deiner {% ifversion org-custom-role-with-repo-permissions %}Organisation und die Repositories{% else %}einer Organisation{% endif %} steuern.',
17201759
)
1760+
1761+
// [SCRAPE-6642] admin/managing-iam/provisioning-user-accounts-with-scim/configuring-authentication-and-provisioning-with-pingfederate.md
1762+
// (intro): translator swapped the ghes/non-ghes branches. The EMU/dotcom/data-residency
1763+
// text ended up inside `{% ifversion ghes %}...{% endif %}`, the `{% endif %}` closed
1764+
// the block too early, and `{% else %}` was left as an orphan after it.
1765+
// Reconstruct to match English: {% ifversion ghes %}centrally manage...{% else %}for EMUs on dotcom...{% endif %}.
1766+
content = content.replaceAll(
1767+
'{% ifversion ghes %}ein, um Authentifizierung und Provisionierung für {% data variables.product.prodname_emus %} auf {% data variables.product.prodname_dotcom_the_website %} oder {% data variables.enterprise.data_residency_site %}{% endif %} für Ihr Unternehmen{% else %} zentral zu verwalten.',
1768+
'{% ifversion ghes %}ein, um Authentifizierung und Provisionierung für Ihr Unternehmen zentral zu verwalten{% else %}für {% data variables.product.prodname_emus %} auf {% data variables.product.prodname_dotcom_the_website %} oder {% data variables.enterprise.data_residency_site %}{% endif %}.',
1769+
)
1770+
1771+
// [SCRAPE-6642] code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/configure-access-to-private-registries.md
1772+
// (intro): `{% endif %}` was replaced by a duplicate
1773+
// `{% data variables.product.prodname_dependabot %}` reference, leaving
1774+
// `{% ifversion dependabot-on-actions-self-hosted %}` unclosed. This broke
1775+
// the /de/code-security landing page scrape. Restore the endif.
1776+
content = content.replaceAll(
1777+
'auf selbst-gehosteten Runnern ausführen.{% data variables.product.prodname_dependabot %}',
1778+
'auf selbst-gehosteten Runnern ausführen.{% endif %}',
1779+
)
17211780
}
17221781

17231782
// --- Generic fixes (all languages) ---

src/languages/tests/correct-translation-content.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,4 +2285,57 @@ Para más información, consulta "[AUTOTITLE](/path)".
22852285
)
22862286
})
22872287
})
2288+
2289+
// ─── SCRAPE-6642: search-scrape failures ─────────────────────────────
2290+
// Six translated title/intro corruptions from the June 10 batch broke the
2291+
// admin and code-security index scrapes (github/docs-engineering#6642).
2292+
// The corrector runs on the PARSED title/intro value, so the title fixes
2293+
// must match the unquoted substring (no surrounding YAML quote).
2294+
describe('SCRAPE-6642 per-file fixes', () => {
2295+
test('es: configuring-scim-provisioning-with-okta title closes ghec conditional', () => {
2296+
const broken =
2297+
'Configuración de la autenticación de {% ifversion ghec %}SCIM{% else %} con Okta'
2298+
expect(fix(broken, 'es')).toBe(
2299+
'Configuración de la autenticación de {% ifversion ghec %}SCIM{% else %} con Okta{% endif %}',
2300+
)
2301+
})
2302+
2303+
test('zh: configuring-scim-provisioning-with-okta intro unswaps endif/ifversion', () => {
2304+
const broken =
2305+
'在{% data variables.product.prodname_dotcom_the_website %}或{% data variables.enterprise.data_residency_site %}{% endif %}上的企业{% ifversion ghec %}进行通信。'
2306+
expect(fix(broken, 'zh')).toBe(
2307+
'的企业{% ifversion ghec %}在{% data variables.product.prodname_dotcom_the_website %}或{% data variables.enterprise.data_residency_site %}{% endif %}进行通信。',
2308+
)
2309+
})
2310+
2311+
test('ru: configuring-scim-provisioning-with-okta title unswaps branches', () => {
2312+
const broken =
2313+
'Настройка {% ifversion ghec %}аутентификации и{% endif %} провизионирования SCIM{% else %}с помощью Okta'
2314+
expect(fix(broken, 'ru')).toBe(
2315+
'Настройка {% ifversion ghec %}SCIM{% else %}аутентификации и{% endif %} провизионирования с помощью Okta',
2316+
)
2317+
})
2318+
2319+
test('ko: configuring-code-scanning-for-your-appliance intro closes ifversion', () => {
2320+
const broken =
2321+
'에서 {% data variables.product.prodname_dotcom %}.{% ifversion default-setup-self-hosted-runners-GHEC %}'
2322+
expect(fix(broken, 'ko')).toBe(
2323+
'에서 {% data variables.product.prodname_dotcom %}.{% endif %}',
2324+
)
2325+
})
2326+
2327+
test('de: configuring-authentication-and-provisioning-with-pingfederate intro unswaps branches', () => {
2328+
const broken =
2329+
'{% ifversion ghes %}ein, um Authentifizierung und Provisionierung für {% data variables.product.prodname_emus %} auf {% data variables.product.prodname_dotcom_the_website %} oder {% data variables.enterprise.data_residency_site %}{% endif %} für Ihr Unternehmen{% else %} zentral zu verwalten.'
2330+
expect(fix(broken, 'de')).toBe(
2331+
'{% ifversion ghes %}ein, um Authentifizierung und Provisionierung für Ihr Unternehmen zentral zu verwalten{% else %}für {% data variables.product.prodname_emus %} auf {% data variables.product.prodname_dotcom_the_website %} oder {% data variables.enterprise.data_residency_site %}{% endif %}.',
2332+
)
2333+
})
2334+
2335+
test('de: configure-access-to-private-registries intro restores endif', () => {
2336+
const broken =
2337+
'auf selbst-gehosteten Runnern ausführen.{% data variables.product.prodname_dependabot %}'
2338+
expect(fix(broken, 'de')).toBe('auf selbst-gehosteten Runnern ausführen.{% endif %}')
2339+
})
2340+
})
22882341
})

0 commit comments

Comments
 (0)