Skip to content

Commit 8d0a4dd

Browse files
authored
Migrate WAF to UDR (#450)
This is an experimental branch to migrate WAF (Well Architected Framework) content into UDR. In addition, it converts the WAF content layout from "tutorials" to "docs", a long-standing request by CJ. This requires changes to the `dev-portal` repo too. 🔍 [Preview](https://unified-docs-frontend-preview-9wcfg05l3-hashicorp.vercel.app/well-architected-framework)
2 parents 7f5333b + 7cd5fe6 commit 8d0a4dd

File tree

170 files changed

+6175
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+6175
-4
lines changed

.github/workflows/build-pr-preview.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Build Preview
22
run-name: 'Build Preview for "${{ github.event.pull_request.title }}" (#${{ github.event.pull_request.number }})'
33

44
on:
5-
pull_request_target:
5+
# temp using "pull_request" instead of "pull_request_target" to test out new workflow
6+
# TODO: revert to pull_request_target
7+
pull_request:
68
types: [opened, synchronize]
79
# Hello Security 👋, we are checking to make sure forked repo PR changed paths are only in content/** inside the job security-check.
810
# We are doing this so we can also reuse this workflow for internal PRs, as pull_request_target also triggers on internal PRs. (As does pull_request)
@@ -183,8 +185,9 @@ jobs:
183185
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
184186
with:
185187
repository: hashicorp/dev-portal
188+
# TODO: temp, remove this right before we merge the PR. we need to merge the dev-portal PR first
189+
ref: migrate-waf-to-udr-docs
186190
path: ./unified-docs-frontend-preview
187-
188191
- name: Use cache
189192
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
190193
with:
@@ -226,8 +229,10 @@ jobs:
226229
shell: bash
227230
timeout_minutes: 10
228231
max_attempts: 2
232+
# remove sleep before merge
229233
command: |
230234
cd unified-docs-frontend-preview
235+
sleep 300
231236
vercel build --token=${{ secrets.VERCEL_TOKEN }}
232237
233238
- name: Deploy Project Artifacts and Set GitHub Outputs

__fixtures__/productConfig.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,4 +446,26 @@ export const PRODUCT_CONFIG = {
446446
// versionedDocs: true,
447447
// websiteDir: 'website',
448448
// },
449+
'well-architected-framework': {
450+
/**
451+
* ✅ Initial migration attempt: SEEMS TO WORK
452+
*
453+
* Maybe worth noting: versioned docs is not enabled for `terraform-docs-common`.
454+
* `branchForLatest` is set to `main`. We treat the single version
455+
* as `v0.0.x` in our version metadata in the current content API:
456+
* https://content.hashicorp.com/api/content/terraform-docs-common/version-metadata?partial=true
457+
*/
458+
/**
459+
* TODO: `terraform-docs-common` has _both_ an `img` folder, _and_ a
460+
* `public` folder. Need to investigate how these are used, and whether
461+
* we need to move both over (eg assetDirs could be an array?)
462+
*/
463+
assetDir: 'img',
464+
contentDir: 'docs',
465+
dataDir: 'data',
466+
productSlug: 'well-architected-framework',
467+
semverCoerce: semver.coerce,
468+
versionedDocs: false,
469+
websiteDir: 'website',
470+
},
449471
}

app/utils/productConfig.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,28 @@ export const PRODUCT_CONFIG = {
449449
productSlug: 'vault',
450450
semverCoerce: semver.coerce,
451451
versionedDocs: true,
452+
websiteDir: 'website',
453+
},
454+
'well-architected-framework': {
455+
/**
456+
* ✅ Initial migration attempt: SEEMS TO WORK
457+
*
458+
* Maybe worth noting: versioned docs is not enabled for `terraform-docs-common`.
459+
* `branchForLatest` is set to `main`. We treat the single version
460+
* as `v0.0.x` in our version metadata in the current content API:
461+
* https://content.hashicorp.com/api/content/terraform-docs-common/version-metadata?partial=true
462+
*/
463+
/**
464+
* TODO: `terraform-docs-common` has _both_ an `img` folder, _and_ a
465+
* `public` folder. Need to investigate how these are used, and whether
466+
* we need to move both over (eg assetDirs could be an array?)
467+
*/
468+
assetDir: 'img',
469+
contentDir: 'docs',
470+
dataDir: 'data',
471+
productSlug: 'well-architected-framework',
472+
semverCoerce: semver.coerce,
473+
versionedDocs: false,
452474
websiteDir: 'website',
453475
},
454476
}

0 commit comments

Comments
 (0)