Skip to content
Open
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
68 changes: 0 additions & 68 deletions src/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2791,74 +2791,6 @@ export const SIDEBAR_WITH_SUNSET_PRODUCTS: Partial<Record<Sections, SectionEntry
},
],
},
{
section: "External Initiators",
contents: [
{
title: "Introduction",
url: "chainlink-nodes/external-initiators/external-initiators-introduction",
},
{
title: "Building External Initiators",
url: "chainlink-nodes/external-initiators/building-external-initiators",
},
{
title: "Adding External Initiators to Nodes",
url: "chainlink-nodes/external-initiators/external-initiators-in-nodes",
},
],
},
{
section: "Connect to Any API",
contents: [
{
title: "Overview",
url: "any-api/introduction",
},
{
title: "Getting Started",
url: "any-api/getting-started",
},
{
title: "Make a GET Request",
url: "any-api/get-request/introduction",
children: [
{
title: "Single Word Response",
url: "any-api/get-request/examples/single-word-response",
},
{
title: "Multi-Variable Responses",
url: "any-api/get-request/examples/multi-variable-responses",
},
{
title: "Array Response",
url: "any-api/get-request/examples/array-response",
},
{
title: "Large Responses",
url: "any-api/get-request/examples/large-responses",
},
{
title: "Existing Job Request",
url: "any-api/get-request/examples/existing-job-request",
},
],
},
{
title: "Find Existing Jobs",
url: "any-api/find-oracle",
},
{
title: "Testnet Oracles",
url: "any-api/testnet-oracles",
},
{
title: "API Reference",
url: "any-api/api-reference",
},
],
},
],
[SIDEBAR_SECTIONS.GLOBAL]: [
AI_AGENT_RESOURCES_SECTION,
Expand Down
30 changes: 30 additions & 0 deletions src/config/sunset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ describe("sunset docs paths", () => {
"https://docs.chain.link/chainlink-automation/llms-full.txt",
"/quickstarts/time-based-upkeep",
"/quickstarts/functions-demo-app?parent=automation",
"/any-api",
"/any-api/introduction",
"/any-api/get-request/examples/single-word-response",
"/chainlink-nodes/external-initiators/external-initiators-introduction",
"/chainlink-nodes/external-initiators/building-external-initiators",
"/chainlink-nodes/job-specs/direct-request-get-uint256",
"/chainlink-nodes/job-specs/multi-word-job",
"https://docs.chain.link/chainlink-nodes/job-specs/direct-request-existing-job",
])("hides %s", (pathname) => {
expect(isSunsetDocsPath(pathname)).toBe(true)
})
Expand All @@ -28,6 +36,11 @@ describe("sunset docs paths", () => {
"/quickstarts/circuit-breaker",
"/chainlink-local",
"chainlink-functions-extra",
"/chainlink-nodes",
"/chainlink-nodes/oracle-jobs/jobs",
"/chainlink-nodes/oracle-jobs/all-jobs",
"/chainlink-nodes/v1/fulfilling-requests",
"/any-api-extra",
])("keeps %s", (pathname) => {
expect(isSunsetDocsPath(pathname)).toBe(false)
})
Expand All @@ -38,7 +51,24 @@ describe("sunset docs paths", () => {
expect(isSunsetSidebarSection("vrf")).toBe(false)
expect(isSunsetContentFile("/repo/src/content/chainlink-functions/getting-started.mdx")).toBe(true)
expect(isSunsetContentFile("/repo/src/content/quickstarts/eth-balance-monitor.mdx")).toBe(true)
expect(isSunsetContentFile("/repo/src/content/any-api/introduction.mdx")).toBe(true)
expect(
isSunsetContentFile("/repo/src/content/chainlink-nodes/external-initiators/building-external-initiators.mdx")
).toBe(true)
expect(isSunsetContentFile("/repo/src/content/chainlink-nodes/job-specs/direct-request-get-bool.mdx")).toBe(true)
expect(isSunsetContentFile("/repo/src/content/quickstarts/circuit-breaker.mdx")).toBe(false)
expect(isSunsetContentFile("/repo/src/content/chainlink-nodes/oracle-jobs/all-jobs.mdx")).toBe(false)
expect(isSunsetContentFile("/repo/src/content/chainlink-nodes/oracle-jobs/jobs.mdx")).toBe(false)
})

it("removes Any API and external initiators from the Nodes menu and keeps OCR jobs", () => {
const sectionNames = SIDEBAR.nodeOperator?.map((group) => group.section) ?? []
const urls = SIDEBAR.nodeOperator?.flatMap((group) => group.contents.map((item) => item.url)) ?? []

expect(sectionNames).not.toContain("Connect to Any API")
expect(sectionNames).not.toContain("External Initiators")
expect(sectionNames).toContain("Job and Task Reference")
expect(urls).toContain("chainlink-nodes/oracle-jobs/jobs")
})

it("keeps the product trees for their own pages and keeps the pages in the sitemap", () => {
Expand Down
38 changes: 35 additions & 3 deletions src/config/sunset.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
/**
* Chainlink Functions and Chainlink Automation stay reachable at their old URLs.
* Sunset pages stay reachable at their old URLs.
* Site menus, search, and Markdown output leave them out.
* Their own pages still show the left sidebar from SIDEBAR_WITH_SUNSET_PRODUCTS.
* Functions and Automation pages still show the left sidebar from SIDEBAR_WITH_SUNSET_PRODUCTS.
* Pages send noindex. They stay in the sitemap so a crawler can recrawl and see noindex.
* Set SUNSET_PAGES_STAY_IN_SITEMAP to false after a few weeks to drop them from the sitemap.
*
* Also hidden: Any API, the seven direct-request job specs, and external initiators.
* OCR job docs stay. Keeper jobs stay and carry the Automation sunset note.
*/

/** Temporary. Flip to false after crawlers have had time to read noindex. */
export const SUNSET_PAGES_STAY_IN_SITEMAP = true

export const SUNSET_DOC_ROOTS = ["chainlink-automation", "chainlink-functions"] as const
export const SUNSET_DOC_ROOTS = ["any-api", "chainlink-automation", "chainlink-functions"] as const

export const SUNSET_SIDEBAR_SECTIONS = ["automation", "chainlinkFunctions"] as const

/** Subtrees inside a product that stays in the menu. */
export const SUNSET_PATH_PREFIXES = ["chainlink-nodes/external-initiators"] as const

/** Individual pages. The rest of chainlink-nodes stays indexed, including OCR jobs. */
export const SUNSET_EXACT_PATHS = [
"chainlink-nodes/job-specs/direct-request-existing-job",
"chainlink-nodes/job-specs/direct-request-get-bool",
"chainlink-nodes/job-specs/direct-request-get-bytes",
"chainlink-nodes/job-specs/direct-request-get-int256",
"chainlink-nodes/job-specs/direct-request-get-string",
"chainlink-nodes/job-specs/direct-request-get-uint256",
"chainlink-nodes/job-specs/multi-word-job",
] as const

/** Quickstarts that document only Functions, only Automation, or both. */
export const SUNSET_QUICKSTART_SLUGS = [
"automation-station",
Expand All @@ -23,6 +40,7 @@ export const SUNSET_QUICKSTART_SLUGS = [
] as const

const SUNSET_SIDEBAR_SECTION_SET = new Set<string>(SUNSET_SIDEBAR_SECTIONS)
const SUNSET_EXACT_PATH_SET = new Set<string>(SUNSET_EXACT_PATHS)

export function normalizeDocsPath(pathname: string): string {
const withoutHash = pathname.split("#")[0] ?? ""
Expand All @@ -48,6 +66,12 @@ export function isSunsetDocsPath(pathname: string): boolean {
return true
}

if (SUNSET_PATH_PREFIXES.some((prefix) => clean === prefix || clean.startsWith(`${prefix}/`))) {
return true
}

if (SUNSET_EXACT_PATH_SET.has(clean)) return true

return SUNSET_QUICKSTART_SLUGS.some((slug) => clean === `quickstarts/${slug}`)
}

Expand All @@ -62,5 +86,13 @@ export function isSunsetContentFile(filePath: string): boolean {
return true
}

if (SUNSET_PATH_PREFIXES.some((prefix) => normalized.includes(`/src/content/${prefix}/`))) {
return true
}

if (SUNSET_EXACT_PATHS.some((docsPath) => normalized.endsWith(`/src/content/${docsPath}.mdx`))) {
return true
}

return SUNSET_QUICKSTART_SLUGS.some((slug) => normalized.endsWith(`/src/content/quickstarts/${slug}.mdx`))
}
Loading
Loading