Skip to content

Commit

Permalink
fix: remove overly aggressive canonical url disambiguation (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Nov 14, 2024
1 parent 6187870 commit 3fecb5d
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 346 deletions.
6 changes: 0 additions & 6 deletions packages/fdr-sdk/src/__test__/output/cohere/node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/v2-api-release",
"date": "2024-09-26T00:00:00.000Z",
"id": "v2.changelog.2024-9-26-1",
"pageId": "pages/changelog/2024-09-26-refresh-models-on-azure.mdx",
Expand Down Expand Up @@ -2809,7 +2808,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/command-model-nightly-available",
"date": "2023-01-17T00:00:00.000Z",
"id": "v2.changelog.2023-1-17-1",
"pageId": "pages/changelog/2023-01-17-command-r-is-a-scalable-llm-for-business.mdx",
Expand Down Expand Up @@ -2885,7 +2883,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/coclassify-powered-by-our-representational-model-embeddings",
"date": "2022-11-03T00:00:00.000Z",
"id": "v2.changelog.2022-11-3-1",
"pageId": "pages/changelog/2022-11-03-new-logit-bias-experimental-parameter.mdx",
Expand Down Expand Up @@ -2979,7 +2976,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/new-extremely-large-model",
"date": "2022-04-25T00:00:00.000Z",
"id": "v2.changelog.2022-4-25-1",
"pageId": "pages/changelog/2022-04-25-updated-small-medium-and-large-generation-models.mdx",
Expand All @@ -3005,7 +3001,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/classification-endpoint",
"date": "2022-03-08T00:00:00.000Z",
"id": "v2.changelog.2022-3-8-1",
"pageId": "pages/changelog/2022-03-08-finetuning-available-policy-updates.mdx",
Expand All @@ -3014,7 +3009,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/classification-endpoint",
"date": "2022-03-08T00:00:00.000Z",
"id": "v2.changelog.2022-3-8-2",
"pageId": "pages/changelog/2022-03-08-new-improved-generation-models.mdx",
Expand Down
14 changes: 7 additions & 7 deletions packages/fdr-sdk/src/__test__/output/cohere/slugs-sitemap.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
"v2/changelog/embed-v3-is-multimodal",
"v2/changelog/commandr-082024-ft",
"v2/changelog/v2-api-release",
"v2/changelog/refresh-models-on-azure",
"v2/changelog/command-gets-refreshed",
"v2/changelog/force-json-object-response-format",
"v2/changelog/release-notes-for-june-10th-2024",
Expand All @@ -174,17 +175,22 @@
"v2/changelog/model-names-are-changing",
"v2/changelog/multilingual-support-for-coclassify",
"v2/changelog/command-model-nightly-available",
"v2/changelog/command-r-is-a-scalable-llm-for-business",
"v2/changelog/multilingual-text-understanding-model-language-detection",
"v2/changelog/model-sizing-update-improvements",
"v2/changelog/improvements-to-current-models-new-beta-model-command",
"v2/changelog/new-look-for-docs",
"v2/changelog/coclassify-powered-by-our-representational-model-embeddings",
"v2/changelog/new-logit-bias-experimental-parameter",
"v2/changelog/pricing-update-and-new-dashboard-ui",
"v2/changelog/introducing-moderate-beta",
"v2/changelog/model-parameter-now-optional",
"v2/changelog/new-improved-generation-and-representation-models",
"v2/changelog/new-extremely-large-model",
"v2/changelog/updated-small-medium-and-large-generation-models",
"v2/changelog/classification-endpoint",
"v2/changelog/finetuning-available-policy-updates",
"v2/changelog/new-improved-generation-models",
"v2/changelog/extremely-large-beta-release",
"v2/changelog/larger-representation-models",
"v2/page/cookbooks",
Expand Down Expand Up @@ -242,11 +248,5 @@
"v1/docs/faster-web-search",
"v1/docs/migrating-from-cogenerate-to-cochat",
"v1/docs/classify-starting-the-training",
"v1/changelog",
"v2/changelog/refresh-models-on-azure",
"v2/changelog/command-r-is-a-scalable-llm-for-business",
"v2/changelog/new-logit-bias-experimental-parameter",
"v2/changelog/updated-small-medium-and-large-generation-models",
"v2/changelog/finetuning-available-policy-updates",
"v2/changelog/new-improved-generation-models"
"v1/changelog"
]
6 changes: 0 additions & 6 deletions packages/fdr-sdk/src/__test__/output/cohere/versionNodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/v2-api-release",
"date": "2024-09-26T00:00:00.000Z",
"id": "v2.changelog.2024-9-26-1",
"pageId": "pages/changelog/2024-09-26-refresh-models-on-azure.mdx",
Expand Down Expand Up @@ -2807,7 +2806,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/command-model-nightly-available",
"date": "2023-01-17T00:00:00.000Z",
"id": "v2.changelog.2023-1-17-1",
"pageId": "pages/changelog/2023-01-17-command-r-is-a-scalable-llm-for-business.mdx",
Expand Down Expand Up @@ -2883,7 +2881,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/coclassify-powered-by-our-representational-model-embeddings",
"date": "2022-11-03T00:00:00.000Z",
"id": "v2.changelog.2022-11-3-1",
"pageId": "pages/changelog/2022-11-03-new-logit-bias-experimental-parameter.mdx",
Expand Down Expand Up @@ -2977,7 +2974,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/new-extremely-large-model",
"date": "2022-04-25T00:00:00.000Z",
"id": "v2.changelog.2022-4-25-1",
"pageId": "pages/changelog/2022-04-25-updated-small-medium-and-large-generation-models.mdx",
Expand All @@ -3003,7 +2999,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/classification-endpoint",
"date": "2022-03-08T00:00:00.000Z",
"id": "v2.changelog.2022-3-8-1",
"pageId": "pages/changelog/2022-03-08-finetuning-available-policy-updates.mdx",
Expand All @@ -3012,7 +3007,6 @@
"type": "changelogEntry"
},
{
"canonicalSlug": "v2/changelog/classification-endpoint",
"date": "2022-03-08T00:00:00.000Z",
"id": "v2.changelog.2022-3-8-2",
"pageId": "pages/changelog/2022-03-08-new-improved-generation-models.mdx",
Expand Down
14 changes: 3 additions & 11 deletions packages/fdr-sdk/src/navigation/migrators/v1ToV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,7 @@ export class FernNavigationV1ToLatest {
): FernNavigation.ChangelogNode => {
const slug = FernNavigation.Slug(node.slug);
const overviewPageId = node.overviewPageId ? FernNavigation.PageId(node.overviewPageId) : undefined;
const canonicalSlug =
overviewPageId != null
? this.#getAndSetCanonicalSlug(
[overviewPageId, this.#createTitleDisambiguationKey(node, parents)],
slug,
)
: undefined;
const canonicalSlug = overviewPageId != null ? this.#getAndSetCanonicalSlug(overviewPageId, slug) : undefined;
const latest: FernNavigation.ChangelogNode = {
type: "changelog",
id: FernNavigation.NodeId(node.id),
Expand Down Expand Up @@ -482,10 +476,8 @@ export class FernNavigationV1ToLatest {
parents: FernNavigation.V1.NavigationNode[],
): FernNavigation.ChangelogEntryNode => {
const slug = FernNavigation.Slug(node.slug);
const canonicalSlug = this.#getAndSetCanonicalSlug(
[node.pageId, this.#createTitleDisambiguationKey(node, parents)],
slug,
);
// NOTE: do NOT use title disambiguation key here, since the title may not always be unique
const canonicalSlug = this.#getAndSetCanonicalSlug(node.pageId, slug);
const latest: FernNavigation.ChangelogEntryNode = {
type: "changelogEntry",
id: FernNavigation.NodeId(node.id),
Expand Down
Loading

0 comments on commit 3fecb5d

Please sign in to comment.