Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] enable Sentinel tutorials without requiring them #2569

Merged
merged 34 commits into from
Sep 25, 2024

Conversation

zchsh
Copy link
Contributor

@zchsh zchsh commented Sep 11, 2024

🗒️ What

This PR fixes a few small issues discovered when trying to run the Tutorials content workflows locally.

🛠️ How

  • In IconTile, adds support for sentinel and hcp "brand colors"
    • These are styled identically to the "neutral" theme, as we have no specific brand colors in these cases
  • Update PRODUCT_ICON_MAP for card badges to include sentinel as an option
    • We have no logo, so we use the HashiCorp H logo
  • Update fetchAllCollectionsByProduct to split out setting of theme
    • For all products but Sentinel, theme and product.slug can be the same value. For Sentinel, this errors.
    • Splits out theme to a separate argument, and makes it optional, so that Sentinel can render without error.
  • Update collection-view server to render Sentinel collections
    • For all products but Sentinel, we only render collections that have a matching theme and product.slug.
    • For Sentinel, there is no sentinel theme, so this would result in zero collection pages. This PR updates to add a conditional similar to the one used for HCP content to render all Sentinel collections.

🧪 Testing

To fully test these changes, run the full end-to-end content workflows for Tutorials locally. A more detailed guide: 2024-09-11 - tutorials local setup

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dev-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 8:24pm

Copy link

github-actions bot commented Sep 11, 2024

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 207.87 KB (🟢 -2.59 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

New Pages Added

The following pages were added to the bundle from the code in this PR:

Page Size (compressed) First Load
/hcp/api-docs/vagrant-box-registry/[[...page]] 157.49 KB 365.36 KB
/hcp/api-docs/waypoint/[[...page]] 157.48 KB 365.35 KB

Eighty-six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 127.92 KB (🟢 -18.61 KB) 335.78 KB
/[productSlug]/docs 168.57 KB (🟢 -14.5 KB) 376.44 KB
/[productSlug]/integrations 142.37 KB (🟢 -14.42 KB) 350.24 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug] 165.59 KB (🟢 -14.52 KB) 373.46 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion] 165.59 KB (🟢 -14.52 KB) 373.46 KB
/[productSlug]/integrations/[organizationSlug]/[integrationSlug]/[integrationVersion]/components/[componentType]/[componentSlug] 171.52 KB (🟢 -14.4 KB) 379.38 KB
/[productSlug]/tutorials 141.19 KB (🟢 -14.3 KB) 349.06 KB
/[productSlug]/tutorials/[...tutorialSlug] 219.57 KB (🟢 -13.58 KB) 427.44 KB
/[productSlug]/tutorials/[collectionSlug] 184.2 KB (🟢 -14.12 KB) 392.07 KB
/_error 112.23 KB (🟢 -17.27 KB) 320.1 KB
/boundary 152.78 KB (🟢 -14.2 KB) 360.64 KB
/boundary/api-docs/[[...page]] 169.54 KB (🟢 -14.49 KB) 377.41 KB
/boundary/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/boundary/install 172.62 KB (🟢 -14.37 KB) 380.49 KB
/certifications 164.74 KB (🟢 -17.3 KB) 372.6 KB
/certifications/[slug] 165.11 KB (🟢 -17.23 KB) 372.98 KB
/consul 152.77 KB (🟢 -14.2 KB) 360.64 KB
/consul/api-docs/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/consul/commands/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/consul/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.44 KB
/consul/install 166.56 KB (🟢 -14.34 KB) 374.43 KB
/consul/install/enterprise 166.6 KB (🟢 -14.34 KB) 374.47 KB
/hcp 152.77 KB (🟢 -14.2 KB) 360.63 KB
/hcp/api-docs/consul/[[...page]] 157.48 KB (🟢 -14.54 KB) 365.35 KB
/hcp/api-docs/packer/[[...page]] 157.48 KB (🟢 -14.54 KB) 365.35 KB
/hcp/api-docs/vault-secrets/[[...page]] 157.49 KB (🟢 -14.54 KB) 365.35 KB
/hcp/api-docs/webhook/[[...page]] 157.48 KB (🟢 -14.54 KB) 365.35 KB
/hcp/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.44 KB
/nomad 152.77 KB (🟢 -14.2 KB) 360.64 KB
/nomad/api-docs/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/nomad/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.44 KB
/nomad/install 166.04 KB (🟢 -14.22 KB) 373.91 KB
/nomad/install/enterprise 166.02 KB (🟢 -14.22 KB) 373.89 KB
/nomad/intro/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/nomad/plugins/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/nomad/tools/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/open-api-docs-preview 161.93 KB (🟢 -14.54 KB) 369.79 KB
/open-api-docs-preview-v2/[[...page]] 114.88 KB (🟢 -14.08 KB) 322.75 KB
/packer 152.77 KB (🟢 -14.2 KB) 360.64 KB
/packer/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.44 KB
/packer/guides/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/packer/install 166.02 KB (🟢 -14.22 KB) 373.88 KB
/profile/account 131.75 KB (🟢 -14.08 KB) 339.62 KB
/profile/bookmarks 132.75 KB (🟢 -14.04 KB) 340.62 KB
/sentinel 152.77 KB (🟢 -14.2 KB) 360.64 KB
/sentinel/docs/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/sentinel/install 166.02 KB (🟢 -14.22 KB) 373.88 KB
/sentinel/intro/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform 152.78 KB (🟢 -14.2 KB) 360.64 KB
/terraform/cdktf/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform/cli/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform/cloud-docs/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.45 KB
/terraform/cloud-docs/agents/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform/enterprise/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.45 KB
/terraform/install 166.02 KB (🟢 -14.22 KB) 373.89 KB
/terraform/internals/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.45 KB
/terraform/intro/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform/language/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.45 KB
/terraform/plugin/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/terraform/plugin/framework/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/plugin/log/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/plugin/mux/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/plugin/sdkv2/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/plugin/testing/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.46 KB
/terraform/registry/[[...page]] 166.59 KB (🟢 -14.55 KB) 374.45 KB
/tutorials 123.35 KB (🟢 -17.35 KB) 331.22 KB
/tutorials/library 148.19 KB (🟢 -14.21 KB) 356.06 KB
/vagrant 152.77 KB (🟢 -14.2 KB) 360.64 KB
/vagrant/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/vagrant/install 166.53 KB (🟢 -14.34 KB) 374.39 KB
/vagrant/install/vmware 166.02 KB (🟢 -14.22 KB) 373.89 KB
/vagrant/intro/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/vagrant/vagrant-cloud/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/validated-designs 118.49 KB (🟢 -17.6 KB) 326.36 KB
/validated-designs/[...slug] 163.72 KB (🟢 -14.74 KB) 371.58 KB
/vault 152.77 KB (🟢 -14.2 KB) 360.64 KB
/vault/api-docs/[[...page]] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/vault/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.44 KB
/vault/install 166.01 KB (🟢 -14.21 KB) 373.88 KB
/vault/install/enterprise 166.02 KB (🟢 -14.22 KB) 373.89 KB
/waypoint 152.78 KB (🟢 -14.2 KB) 360.64 KB
/waypoint/docs/[...page] 166.58 KB (🟢 -14.55 KB) 374.45 KB
/well-architected-framework 144.88 KB (🟢 -14.21 KB) 352.74 KB
/well-architected-framework/[...tutorialSlug] 186.85 KB (🟢 -14.33 KB) 394.71 KB
/well-architected-framework/[collectionSlug] 133.07 KB (🟢 -14.18 KB) 340.94 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@zchsh zchsh changed the title work on sentinel tutorial setup fix sentinel tutorials consumption issues Sep 11, 2024
@zchsh zchsh marked this pull request as ready for review September 11, 2024 19:10
@zchsh zchsh changed the base branch from create-sentinel-tutorial to main September 13, 2024 15:22
@zchsh zchsh changed the title fix sentinel tutorials consumption issues [WIP] enable Sentinel tutorials without requiring them Sep 13, 2024
@heatlikeheatwave heatlikeheatwave changed the base branch from main to create-sentinel-tutorial September 24, 2024 20:49
Rationale for reverting th basePaths change: we only ever use product data basePaths for redirects from the previous dot-io sites. This property should likely be renamed, or perhaps removed entirely, as redirects could probably be written in a more static way now that we've completed our migration to Dev Dot.

Rationale for reverting the rootDocsPath change: up until the point we fully remove intro content, including the page files, we need to maintain this data, otherwise the build will fail. Recommendation is to remove intro content in a separate PR.
Holding until Sentinel tutorials are published
@heatlikeheatwave heatlikeheatwave merged commit 3b1b0fb into create-sentinel-tutorial Sep 25, 2024
9 checks passed
@heatlikeheatwave heatlikeheatwave deleted the zs.add-sentinel-tutorials branch September 25, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants