Skip to content

Conversation

@LeahMarieBush
Copy link
Contributor

@LeahMarieBush LeahMarieBush commented Sep 3, 2025

Description

Asana task 🎟️

This PR fixes the prebuild nav data and internal links transforms. Currently, it gets the version from the folder name and appends that version for the sidebar and internal links. For versions with a release stage (ex. alpha, beta), we want to remove the stage from the version before appending the version for the links.

Testing

  1. Go to preview
  2. Click on a few of the links in the sidebar and verify they are working
  3. Go to preview
  4. Click the top link on the page and verify it works

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Thu Sep 4 16:11:14 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Thu Sep 4 16:05:22 UTC 2025

@LeahMarieBush LeahMarieBush marked this pull request as ready for review September 3, 2025 21:24
@LeahMarieBush LeahMarieBush requested a review from a team as a code owner September 3, 2025 21:24
Copy link
Contributor

@RubenSandwich RubenSandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

But we really should add some tests to this file in the future. 🤔

Edit: Right after I wrote this I wanted to test inline links and discovered an issue: #901 (review).

Copy link
Contributor

@RubenSandwich RubenSandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I just discovered another problem, that likely already existed, inline links have the release stage in them too:

  1. go to: https://unified-docs-frontend-preview-91j9uuugd-hashicorp.vercel.app/terraform/language/v1.14.x/syntax/json
  2. click on the link "the native Terraform language syntax"
  3. The URL still has the release stage in it, so it 404s

So I think we are missing another transform as well. 😢

@LeahMarieBush LeahMarieBush changed the title fix: prebuild script adds release stage to versions in nav-data files fix: prebuild script adds release stage to versions in nav-data files and internal links Sep 4, 2025
expect(result).toBe(expectedOutput)
})

it('should remove release stage in parentheses from version', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@RubenSandwich RubenSandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

I even checked an image in an alpha release just in case: https://unified-docs-frontend-preview-g9nr4t65d-hashicorp.vercel.app/terraform/cli/v1.14.x/commands/graph, and that worked. 😌

@LeahMarieBush LeahMarieBush merged commit 89a6cc2 into main Sep 4, 2025
15 checks passed
@LeahMarieBush LeahMarieBush deleted the leah/fix/prebuild-version-nav-data branch September 4, 2025 16:41
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