Skip to content

Fix content not showing up in preview and link checker checking more than *.mdx files #226

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

Merged
merged 16 commits into from
Mar 26, 2025

Conversation

RubenSandwich
Copy link
Contributor

@RubenSandwich RubenSandwich commented Mar 20, 2025

This bug can be seen here: #214 (comment).

While doing this work another bug was found, namely that in pull_request_target actions/checkout does not default to checking out head.sha but rather base.sha.

Seen here, where checkout is using the ref fb252954bf0414e8e2fb472ccc1bef76df43d36a. (You can also see this in that workflows summary which lists the commit it should be using, but isn't.) Which is not the commit ref but the base ref, where main was when this PR was made.

Testing

Copy link

github-actions bot commented Mar 20, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Wed Mar 26 19:14:08 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Wed Mar 26 19:08:22 UTC 2025

Copy link

github-actions bot commented Mar 20, 2025

Broken Link Checker (pull request)

Summary

Status Count
🔍 Total 25
✅ Successful 24
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 0
❓ Unknown 0
🚫 Errors 1

Errors per input

Errors in content/terraform-plugin-framework/v1.14.x/docs/plugin/framework/index.mdx

@@ -38,6 +39,8 @@ jobs:
files_yaml: |
Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

Regarding the actions/checkout used on line 33:

ref: ${{ github.event.pull_request.head.sha }} is not needed on because in tj-actions/changed-files we pass in the base sha and head sha.

@@ -213,12 +218,17 @@ jobs:
echo "UNIFIED_DOCS_API=${{ needs.deploy-unified-docs-api-preview.outputs.preview_url }}" >> .env

- name: Build dev-portal
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

I have builds failing like once in every 20 times, which what looks to be network request issues. So I added this back in, as we should try to never fail for content authors.

@@ -0,0 +1,340 @@
name: Build Preview Test
Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

This file will be removed before merging, it is only used for tests.

@@ -305,6 +305,10 @@
"title": "Terraform Concepts",
Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

These changes will be reverted before merging, it is only used for tests.

@@ -7,7 +7,9 @@ description: >-

Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

These changes will be reverted before merging, it is only used for tests.

@@ -4,6 +4,8 @@ description: >-
Learn about logging with Terraform Providers.
---
Copy link
Contributor Author

@RubenSandwich RubenSandwich Mar 25, 2025

Choose a reason for hiding this comment

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

These changes will be reverted before merging, it is only used for tests.

- name: Checking links in files
run: |
echo "Checking links in files:"
echo "${{ needs.get-changed-files.outputs.changed_markdown_content_files }}" | tr ' ' '\n'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though we can see the files checked in "Run lychee link checker", they are in the args so a bit hard to read. This fixes that.

@RubenSandwich RubenSandwich marked this pull request as ready for review March 25, 2025 19:49
@RubenSandwich RubenSandwich requested review from a team as code owners March 25, 2025 19:49
@RubenSandwich RubenSandwich changed the title Broken link checker should only run on .mdx files Fix content not showing up in preview and link checker checking more than *.mdx files Mar 25, 2025
@RubenSandwich RubenSandwich merged commit 72e147b into main Mar 26, 2025
7 checks passed
RubenSandwich added a commit that referenced this pull request Mar 26, 2025
…than *.mdx files (#226) (#231)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space
heatlikeheatwave added a commit that referenced this pull request Apr 2, 2025
* Fix content not showing up in preview and link checker checking more than *.mdx files (#226)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space

* Enable vercel deployment protection bypass (#230)

* Expand lychee command to multiple lines

This makes the arguments easier to read (multiple small lines rather than one
line line that stretches for miles)

* Add vercel protection bypass header to lychee command

* Disable prod workflows outside of public repo (#234)

* Disable prod workflows outside of public repo

* Moving to using job level if

* Mock imports in app/utils/utils.test.ts to run without prebuild step (#238)

* Mock import in app/api/content/[productSlug]/redirects/route.test.ts to run without prebuild step (#241)

* Mock imports in app/api/all-docs-paths/route.test.ts to run without prebuild step (#239)

* Mock imports in app/utils/allDocsPaths.test.ts to run without prebuild step (#237)

* repo sync between public and internal repos for web-unifed-docs GHA (#236)

* Change repo owner to hashicorp in repo-sync workflow (#242)

* Mock import of version metadata in app/api/content/[productSlug]/version-metadata/route.ts (#240)

* Mock import of version metadata (#244)

* Mock import of versionMetadata in app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts(#245)

* Mock imports in app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts (#243)

* Mock imports for versionMetadata.json, docsPathsAllVersions.json, and productConfig.mjs

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

---------

Co-authored-by: Ruben Nic <[email protected]>
Co-authored-by: Robert Main <[email protected]>
Co-authored-by: HashiBot <[email protected]>
rmainwork added a commit that referenced this pull request Apr 15, 2025
* Fix content not showing up in preview and link checker checking more than *.mdx files (#226)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space

* Enable vercel deployment protection bypass (#230)

* Expand lychee command to multiple lines

This makes the arguments easier to read (multiple small lines rather than one
line line that stretches for miles)

* Add vercel protection bypass header to lychee command

* Disable prod workflows outside of public repo (#234)

* Disable prod workflows outside of public repo

* Moving to using job level if

* Mock imports in app/utils/utils.test.ts to run without prebuild step (#238)

* Mock import in app/api/content/[productSlug]/redirects/route.test.ts to run without prebuild step (#241)

* Mock imports in app/api/all-docs-paths/route.test.ts to run without prebuild step (#239)

* Mock imports in app/utils/allDocsPaths.test.ts to run without prebuild step (#237)

* repo sync between public and internal repos for web-unifed-docs GHA (#236)

* Change repo owner to hashicorp in repo-sync workflow (#242)

* Mock import of version metadata in app/api/content/[productSlug]/version-metadata/route.ts (#240)

* Mock import of version metadata (#244)

* Mock import of versionMetadata in app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts(#245)

* Mock imports in app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts (#243)

* Mock imports for versionMetadata.json, docsPathsAllVersions.json, and productConfig.mjs

* Remove path navigation from fixtures import (#1)

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

* Repo sync (#34)

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Repo sync (#291)



* Repo sync (#34)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Repo sync (#38)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Add Vercel link to deploy preview (#39)

* Add Vercel link to deploy job (#290)

* Fix for dev-portal is failing to build in UDR internal repo

* Repo sync (#326)

* Repo sync (#73)

* Fix content loading (#235)

* Use vercel protection bypass headcer

Builds were previously breaking when UDR attempted to make HTTP requests to the
CDN (vercel public folder) to retrieve content.

Adding the `x-vercel-protection-bypass` header should fix that

* Add use server directive

* Revert "Add use server directive"

Adding a 'use server' directive to this file causes 404s on the content
API.

This reverts commit 4f2ecae.

---------

Co-authored-by: Ruben Nic <[email protected]>
Co-authored-by: Heat Hamilton <[email protected]>
Co-authored-by: HashiBot <[email protected]>
rmainwork added a commit that referenced this pull request Apr 16, 2025
* Migrate terraform-docs-common (#227)

* Migrate terraform-docs-agents (#228)

* Fix content not showing up in preview and link checker checking more than *.mdx files (#226) (#231)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space

* Migrate over terraform-cdk (#229)

* API Compare tool for version metadata (#232)

* Add readme

* Update command in package.json

* Add test output folder to gitignore

* Shorten example response

* Add default values for old and new APIs

---------

Co-authored-by: Ruben Nic <[email protected]>

* Fix merge conflict (#252)

* Keep develop in sync with main (#251)

* Fix content not showing up in preview and link checker checking more than *.mdx files (#226)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space

* Enable vercel deployment protection bypass (#230)

* Expand lychee command to multiple lines

This makes the arguments easier to read (multiple small lines rather than one
line line that stretches for miles)

* Add vercel protection bypass header to lychee command

* Disable prod workflows outside of public repo (#234)

* Disable prod workflows outside of public repo

* Moving to using job level if

* Mock imports in app/utils/utils.test.ts to run without prebuild step (#238)

* Mock import in app/api/content/[productSlug]/redirects/route.test.ts to run without prebuild step (#241)

* Mock imports in app/api/all-docs-paths/route.test.ts to run without prebuild step (#239)

* Mock imports in app/utils/allDocsPaths.test.ts to run without prebuild step (#237)

* repo sync between public and internal repos for web-unifed-docs GHA (#236)

* Change repo owner to hashicorp in repo-sync workflow (#242)

* Mock import of version metadata in app/api/content/[productSlug]/version-metadata/route.ts (#240)

* Mock import of version metadata (#244)

* Mock import of versionMetadata in app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts(#245)

* Mock imports in app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts (#243)

* Mock imports for versionMetadata.json, docsPathsAllVersions.json, and productConfig.mjs

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

---------

Co-authored-by: Ruben Nic <[email protected]>
Co-authored-by: Robert Main <[email protected]>
Co-authored-by: HashiBot <[email protected]>

* api comparison tool: content versions (#340)

* Change arg to d for drop-keys

* Added functionality to test content-versions API

* Add examples to the readme

* Sync changes from main into develop (#344)

* Fix content not showing up in preview and link checker checking more than *.mdx files (#226)

* Broken link checker should only run on .mdx files

* Add a test to catch a broken link

* Edit a JSON file

* Move to always using head.sha when link checking

* Miss a place for the head.sha

* print the changed files

* Move back to using nick-fields/retry

* Fix misspelling and add another test

* Fix wrong var being pass in

* Fix misspelling of variable

* Found another misspelling :face_palm:

* get-changed-files output is space not comma sep

* Give action a clearer name

* Fix dev-portal cache

* Revert testing changes

* Put back space

* Enable vercel deployment protection bypass (#230)

* Expand lychee command to multiple lines

This makes the arguments easier to read (multiple small lines rather than one
line line that stretches for miles)

* Add vercel protection bypass header to lychee command

* Disable prod workflows outside of public repo (#234)

* Disable prod workflows outside of public repo

* Moving to using job level if

* Mock imports in app/utils/utils.test.ts to run without prebuild step (#238)

* Mock import in app/api/content/[productSlug]/redirects/route.test.ts to run without prebuild step (#241)

* Mock imports in app/api/all-docs-paths/route.test.ts to run without prebuild step (#239)

* Mock imports in app/utils/allDocsPaths.test.ts to run without prebuild step (#237)

* repo sync between public and internal repos for web-unifed-docs GHA (#236)

* Change repo owner to hashicorp in repo-sync workflow (#242)

* Mock import of version metadata in app/api/content/[productSlug]/version-metadata/route.ts (#240)

* Mock import of version metadata (#244)

* Mock import of versionMetadata in app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts(#245)

* Mock imports in app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts (#243)

* Mock imports for versionMetadata.json, docsPathsAllVersions.json, and productConfig.mjs

* Remove path navigation from fixtures import (#1)

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

* Repo sync (#34)

* Remove path navigation from fixtures import (#1) (#247)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Repo sync (#291)



* Repo sync (#34)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Repo sync (#38)

* sync changes from web-unified-docs-internal

* Update method from compareCommits to compareCommitsWithBasehead (#249)

* Remove prebuild from test action (#250)

* Add develop to target branches

* Remove paths arg to allow Test & Lint action to run on every PR (#253)

* Remove PR lock logic from repo-sync workflow (#263)

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Add Vercel link to deploy preview (#39)

* Add Vercel link to deploy job (#290)

* Fix for dev-portal is failing to build in UDR internal repo

* Repo sync (#326)

* Repo sync (#73)

* Fix content loading (#235)

* Use vercel protection bypass headcer

Builds were previously breaking when UDR attempted to make HTTP requests to the
CDN (vercel public folder) to retrieve content.

Adding the `x-vercel-protection-bypass` header should fix that

* Add use server directive

* Revert "Add use server directive"

Adding a 'use server' directive to this file causes 404s on the content
API.

This reverts commit 4f2ecae.

---------

Co-authored-by: Ruben Nic <[email protected]>
Co-authored-by: Heat Hamilton <[email protected]>
Co-authored-by: HashiBot <[email protected]>

* Remove terraform docs common (#342)

* Remove terraform-docs-common from develop branch

* Comment out terraform-docs-common

Disable terraform-docs-common in product config

* Undo removal of content dir mapping

---------

Co-authored-by: Heat Hamilton <[email protected]>

* Add terraform-docs-agents (#345)

* remove terraform-cdk docs (#347)

* Re-sync terraform-docs-agents docs (#348)

Co-authored-by: Ruben Nic <[email protected]>

---------

Co-authored-by: Heat Hamilton <[email protected]>
Co-authored-by: Ruben Nic <[email protected]>
Co-authored-by: HashiBot <[email protected]>
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.

2 participants