-
Notifications
You must be signed in to change notification settings - Fork 80
Adding vault content inclusion exclusions #962
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
base: main
Are you sure you want to change the base?
Adding vault content inclusion exclusions #962
Conversation
…the terraform exclusion
updating local branch
updating local branch
… folder and wont be reflected otherwise
Vercel Previews Deployed
|
Broken Link CheckerNo broken links found! 🎉 |
|
||
This content should always appear. | ||
|
||
<!-- BEGIN: VLT:>=v1.21.x --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure not to include this file when we ship this PR.
scripts/prebuild/mdx-transforms/exclude-terraform-content/index.mjs
Outdated
Show resolved
Hide resolved
scripts/prebuild/mdx-transforms/exclude-terraform-content/index.test.mjs
Outdated
Show resolved
Hide resolved
scripts/prebuild/mdx-transforms/exclude-vault-content/index.test.mjs
Outdated
Show resolved
Hide resolved
scripts/prebuild/mdx-transforms/exclude-vault-content/index.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's created a shared.mjs file to keep some of the duplication down and keep the remark transforms contained.
https://github.com/hashicorp/web-unified-docs/pull/962/files#r2361077992
@williamdalessandro it looks like that was done on purpose, by me; https://github.com/hashicorp/web-unified-docs-internal/pull/237/commits/c2c9dd65a7e699a9877c63a5d0e2b230d3a0bb6e. I can't exactly remember why though as it was during a push to get some TFE documentation out the door. I dug through a bunch of slack chat logs and this was the closest I could find that might give a hint here. Overall what I am saying is that I am okay with changing it, but let's add some tests for the partial then remove content Plugin workflow. In the slack conversation it looks like a bunch of conversation is around this page: https://github.com/hashicorp/web-unified-docs/blob/main/content/terraform-docs-common/docs/cloud-docs/api-docs/index.mdx. So let's base our partial then remove content Plugin workflow tests around that page. |
…s behavior with global partials and content exclusion
…ere not correctly removed after being placed
…cases I found, simplified ast removal search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @williamdalessandro!
// before deciding whether to remove this node | ||
// const hadChildren = !!node.children | ||
const wasInsideRange = insideRange | ||
if (node.children) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding tests to cover all of this. It definitely seemed like this rabbit hole went deep. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for covering these cases with tests.
Just one question with these changes: https://github.com/hashicorp/web-unified-docs/pull/962/files#r2410883284.
…exclusion order change. this is the only place it happens
Links
Preview Link showing the response of the test page post exclusion
Asana task
What
This is an implementation of version based directives specifically for Vault- differs from the TFC and TFEnterprise exclusions because those were simplified. Does accurate parsing of the version numbers along with relevant error handling/checks. Created new test suite for the new vault exclusions and added in new test to terraform exclusions
Why
Requested in the above asana ticket
How
Extends upon the existing script and copies the same format however it has unique checks since the exclusion operation is more involved. Made the code look identical so it can be easier to abstract in the future so that any product can have access to inclusions/exclusions, right now it just gets the job done.
Pics
The exclusion file

The result when ran

Testing
Can run
and
in terminal to see the tests run for these. Added in a testing file
to see inclusions/exclusions at work. Will remove that file from the PR but want it around for testing reference.
Can spin up locally and see the page at
or
Other info
Had to recompile the binaries since these are changes that take place in the scripts folder
Things left to do:
The following files need to be updated to account for vault exclusions
build-mdx-transforms-file.mjs - Added in and tests work
build-mdx-transforms-file.test.mjs (No change necessary here)
remove this testing file once the PR is deemed as good to go
Create a new ticket proposing a new structure change to make this more extensible with a plugin based OOP architecture