Skip to content

Commit

Permalink
chore: Remove onboarding code as all onboarding tutorials have been d…
Browse files Browse the repository at this point in the history
…eprecated (#2526)
  • Loading branch information
heatlikeheatwave authored Jul 29, 2024
1 parent 25a6174 commit 7e56142
Show file tree
Hide file tree
Showing 24 changed files with 13 additions and 651 deletions.
3 changes: 1 addition & 2 deletions scripts/content-repo-preview/builders/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ export function DeveloperPreviewBuilder(product) {
/**
* Remove specific page files to speed up preview builds:
* - /src/pages/well-architected-framework
* - /src/pages/onboarding
*/
const pagesDir = path.join(cwd, 'src', 'pages')
const pagesDirsToRemove = ['well-architected-framework', 'onboarding']
const pagesDirsToRemove = ['well-architected-framework']

/**
* Remove validated designs paths from docs previews
Expand Down
5 changes: 1 addition & 4 deletions scripts/generate-tutorial-variant-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ async function getVariantRewrites() {
const [product, collectionFilename] = collection.slug.split('/')
let path = `/${product}/tutorials/${collectionFilename}/${tutorialFilename}`

if (
product === 'onboarding' ||
product === 'well-architected-framework'
) {
if (product === 'well-architected-framework') {
path = `/${product}/${collectionFilename}/${tutorialFilename}`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { ProductSlug } from 'types/products'
* Tutorials may have many products, so we use the default collection
* context for a tutorial to determine the "default product slug".
*
* Tutorials may also have no products (for WAF and onboarding), in which
* Tutorials may also have no products (for WAF), in which
* case we return `null`.
*/
export function parseDefaultProductSlug(hit: Hit): ProductSlug | null {
Expand Down
4 changes: 0 additions & 4 deletions src/data/_tutorial-map.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
"nomad/consul-acl": "/nomad/tutorials/integrate-consul/consul-acl",
"nomad/nomad-pack-detailed-usage": "/nomad/tutorials/nomad-pack/nomad-pack-detailed-usage",
"consul/proxy-metrics": "/consul/tutorials/service-mesh-observability/proxy-metrics",
"onboarding/vault-metrics-new-relic": "/onboarding/hcp-vault-week-7/vault-metrics-new-relic",
"onboarding/vault-metrics-http": "/onboarding/hcp-vault-week-7/vault-metrics-http",
"onboarding/vault-audit-log-new-relic": "/onboarding/hcp-vault-week-7/vault-audit-log-new-relic",
"onboarding/vault-audit-log-http": "/onboarding/hcp-vault-week-7/vault-audit-log-http",
"nomad/sso-oidc-auth0": "/nomad/tutorials/access-control/sso-oidc-auth0",
"consul/secure-services-intentions": "/consul/tutorials/service-mesh-security/secure-services-intentions",
"consul/secure-services-intentions-l7": "/consul/tutorials/service-mesh-security/secure-services-intentions-l7",
Expand Down
4 changes: 0 additions & 4 deletions src/data/onboarding.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/learn-client/api/collection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export async function getNextCollectionInSidebar({
* The sections map from the parent folder in the
* tutorials repository. `/content/collections/waypoint/some-collection`
* would have a section of 'waypoint'. This allows us to fetch non-product
* associated content such as 'onboarding' and 'well-architected-framework'
* associated content such as 'well-architected-framework'
*/
export async function getCollectionsBySection(
section: string
Expand Down
1 change: 0 additions & 1 deletion src/lib/learn-client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ export enum ProductOption {

export enum SectionOption {
'well-architected-framework' = 'well-architected-framework',
'onboarding' = 'onboarding',
}

export enum EditionOption {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('getIsExternalLearnLink', () => {

describe('product hubs', () => {
testEachCase([
['/onboarding', false],
['/boundary', true],
['/consul', true],
['/nomad', true],
Expand Down Expand Up @@ -71,7 +70,6 @@ describe('getIsExternalLearnLink', () => {
['/collections/vault/collection-slug', true],
['/collections/waypoint/collection-slug', true],
['/collections/well-architected-framework/collection-slug', true],
['/collections/onboarding/collection-slug', true],
['/collections/cloud/collection-slug', true],
])
})
Expand All @@ -93,7 +91,6 @@ describe('getIsExternalLearnLink', () => {
['/tutorials/vault/tutorial-slug', true],
['/tutorials/waypoint/tutorial-slug', true],
['/tutorials/well-architected-framework/tutorial-slug', true],
['/tutorials/onboarding/tutorial-slug', true],
['/tutorials/cloud/tutorial-slug', true],
]

Expand All @@ -117,8 +114,7 @@ describe('getIsExternalLearnLink', () => {
['/waypoint/tutorials/collection-slug/tutorial-slug', false],
['/well-architected-framework/collection-slug', false],
['/well-architected-framework/collection-slug/tutorial-slug', false],
['/onboarding/collection-slug', false],
['/onboarding/collection-slug/tutorial-slug', false],

['/hcp/tutorials/collection-slug', false],
['/hcp/tutorials/collection-slug/tutorial-slug', false],
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ describe('rewriteExternalCollectionLink', () => {
'/collections/consul/cloud-get-started',
'/consul/tutorials/cloud-get-started',
],
[
'/collections/onboarding/hcp-vault-week-1',
'/onboarding/hcp-vault-week-1',
],
[
'/collections/well-architected-framework/com',
'/well-architected-framework/com',
Expand All @@ -78,10 +74,6 @@ describe('rewriteExternalCollectionLink', () => {
'/collections/consul/cloud-get-started?paramA=valueA',
'/consul/tutorials/cloud-get-started?paramA=valueA',
],
[
'/collections/onboarding/hcp-vault-week-1?paramA=valueA',
'/onboarding/hcp-vault-week-1?paramA=valueA',
],
[
'/collections/well-architected-framework/com?paramA=valueA',
'/well-architected-framework/com?paramA=valueA',
Expand Down Expand Up @@ -111,10 +103,6 @@ describe('rewriteExternalCollectionLink', () => {
'/collections/consul/cloud-get-started#test-hash',
'/consul/tutorials/cloud-get-started#test-hash',
],
[
'/collections/onboarding/hcp-vault-week-1#test-hash',
'/onboarding/hcp-vault-week-1#test-hash',
],
[
'/collections/well-architected-framework/com#test-hash',
'/well-architected-framework/com#test-hash',
Expand Down Expand Up @@ -144,10 +132,6 @@ describe('rewriteExternalCollectionLink', () => {
'/collections/consul/cloud-get-started?paramA=valueA#test-hash',
'/consul/tutorials/cloud-get-started?paramA=valueA#test-hash',
],
[
'/collections/onboarding/hcp-vault-week-1?paramA=valueA#test-hash',
'/onboarding/hcp-vault-week-1?paramA=valueA#test-hash',
],
[
'/collections/well-architected-framework/com?paramA=valueA#test-hash',
'/well-architected-framework/com?paramA=valueA#test-hash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const TEST_TUTORIAL_SLUG = 'vault/tutorial'
const MOCK_TUTORIAL_MAP = {
'vault/tutorial': '/vault/tutorials/collection/tutorial',
'cloud/amazon-peering-hcp': '/hcp/tutorials/networking/amazon-peering-hcp',
'onboarding/tutorial': '/onboarding/collection/tutorial',
'well-architected-framework/tutorial':
'/well-architected-framework/collection/tutorial',
}
Expand Down Expand Up @@ -54,10 +53,6 @@ describe('rewriteExternalTutorialLink', () => {
describe('when neither `search` nor `hash` are present', () => {
testEachCase([
['/tutorials/vault/tutorial', `${MOCK_TUTORIAL_MAP['vault/tutorial']}`],
[
'/tutorials/onboarding/tutorial',
MOCK_TUTORIAL_MAP['onboarding/tutorial'],
],
[
'/tutorials/well-architected-framework/tutorial',
MOCK_TUTORIAL_MAP['well-architected-framework/tutorial'],
Expand Down Expand Up @@ -89,18 +84,6 @@ describe('rewriteExternalTutorialLink', () => {
'/tutorials/waypoint/tutorial?paramA=valueA&in=vault/collection&paramB=valueB',
'/vault/tutorials/collection/tutorial?paramA=valueA&paramB=valueB',
],
[
`/tutorials/vault/tutorial?in=${SectionOption.onboarding}/collection`,
`/${SectionOption.onboarding}/collection/tutorial`,
],
[
`/tutorials/vault/tutorial?paramA=valueA&in=${SectionOption.onboarding}/collection`,
`/${SectionOption.onboarding}/collection/tutorial?paramA=valueA`,
],
[
`/tutorials/vault/tutorial?paramA=valueA&in=${SectionOption.onboarding}/collection&paramB=valueB`,
`/${SectionOption.onboarding}/collection/tutorial?paramA=valueA&paramB=valueB`,
],
[
'/tutorials/cloud/amazon-peering-hcp?in=cloud/consul-cloud&paramA=valueA',
'/hcp/tutorials/consul-cloud/amazon-peering-hcp?paramA=valueA',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ const TEST_MD_LINKS = {
'[link to vault use cases](https://www.vaultproject.io/use-cases)',
wafTutorialLink:
'[waf link](/tutorials/well-architected-framework/cloud-operating-model)',
onboardingCollectionLink:
'[onboarding link](/collections/onboarding/hcp-vault-week-1)',
}

/**
Expand Down Expand Up @@ -331,13 +329,4 @@ describe('rewriteTutorialLinks remark plugin', () => {
'/well-architected-framework/com/cloud-operating-model'
)
})

test('Onboarding link should be rewritten properly', async () => {
const contents = await remark()
.use(rewriteTutorialLinksPlugin, { tutorialMap: MOCK_TUTORIALS_MAP })
.process(TEST_MD_LINKS.onboardingCollectionLink)
const newPath = isolatePathFromMarkdown(String(contents))

expect(newPath).toBe('/onboarding/hcp-vault-week-1')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ const getIsExternalLearnPath = (link: string): boolean => {
* for a product hub page.
*/
if (numPathnameParts === 1) {
return (
basePath !== 'onboarding' && productAndSectionOptions.includes(basePath)
)
return productAndSectionOptions.includes(basePath)
}

/**
Expand Down
10 changes: 1 addition & 9 deletions src/lib/sitemap/tutorials-content-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ import { makeSitemapField } from './helpers'
import { Collection as ClientCollection } from 'lib/learn-client/types'

function getTutorialLandingPaths(): string[] {
const activeSlugs = activeProductSlugs.map(
return activeProductSlugs.map(
(productSlug: ProductSlug) => `${productSlug}/tutorials`
)
const sectionOptionsWithLandingPage = Object.values(SectionOption).filter(
(option: SectionOption) => option !== SectionOption.onboarding
)
const sectionOptions = sectionOptionsWithLandingPage.map(
(slug: SectionOption) => `${slug}`
)

return [...activeSlugs, ...sectionOptions]
}

async function getCollectionPaths() {
Expand Down
71 changes: 0 additions & 71 deletions src/pages/onboarding/[...tutorialSlug]/index.tsx

This file was deleted.

77 changes: 0 additions & 77 deletions src/pages/onboarding/[collectionSlug].tsx

This file was deleted.

Loading

0 comments on commit 7e56142

Please sign in to comment.