Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac73a17
updating build preview step to not be so ridiculously expensive
williamdalessandro Nov 25, 2025
2ba839e
adding the same optimization to the deploy-udr step
williamdalessandro Nov 25, 2025
d6ac7c9
testing this
williamdalessandro Nov 25, 2025
48f7444
change to pull_request
williamdalessandro Nov 30, 2025
f295eae
Revert "testing this"
williamdalessandro Nov 30, 2025
87be935
Merge branch 'main' into optimizing-build-cache-step
williamdalessandro Dec 2, 2025
5a0637f
adding future testing instructions and massively simplfying/fixing th…
williamdalessandro Dec 2, 2025
6e820f2
test
williamdalessandro Dec 3, 2025
dd95fc8
updating the nextjs cache step with at the deploy udr step
williamdalessandro Dec 3, 2025
2ce8e29
Merge branch 'main' into optimizing-build-cache-step
williamdalessandro Dec 3, 2025
95a8dc7
testing to see if this makes any more of a difference
williamdalessandro Dec 3, 2025
8427a60
test
williamdalessandro Dec 3, 2025
ad4da6f
changing to ci for very small potential time saves
williamdalessandro Dec 4, 2025
864745f
Revert "changing to ci for very small potential time saves"
williamdalessandro Dec 4, 2025
f04aa89
Reapply "changing to ci for very small potential time saves"
williamdalessandro Dec 4, 2025
f039734
Merge branch 'main' into optimizing-build-cache-step
williamdalessandro Dec 4, 2025
5c474ec
updating binaries
williamdalessandro Dec 4, 2025
05b9db8
changing back to pr target
williamdalessandro Dec 4, 2025
5013c5e
binaries conflict
williamdalessandro Dec 5, 2025
2a51dd1
Merge branch 'main' into optimizing-build-cache-step
williamdalessandro Dec 5, 2025
a77c3b9
updating binaries again
williamdalessandro Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/algolia-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cache: 'npm'
node-version-file: 'package.json'

- run: npm i
- run: npm ci
- run: npm run prebuild -- --get-real-file-changed-metadata --build-algolia-index
- run: npm run algolia
env:
Expand Down
36 changes: 13 additions & 23 deletions .github/workflows/build-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Preview
run-name: 'Build Preview for "${{ github.event.pull_request.title }}" (#${{ github.event.pull_request.number }})'

on:
# 1: Change this to `pull_request` to see changes while testing this file in a PR.
# 2: This is because `pull_request_target` only works from the context of the base branch
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
# 3: Change this back to `pull_request_target` before merge for security reasons
pull_request_target:
types: [opened, synchronize]
# Hello Security 👋, we are checking to make sure forked repo PR changed paths are only in content/** inside the job security-check.
Expand Down Expand Up @@ -105,20 +109,11 @@ jobs:
cache: 'npm'
node-version-file: 'package.json'

- name: Generate cache manifest
run: git ls-files -z -- '*.js' '*.mjs' '*.ts' '*.tsx' '*.mdx' '*.json' | xargs -0 git hash-object > cache-key.txt

- name: Use cache
- name: Cache Next.js build
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('cache-key.txt') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-build-${{ hashFiles('package-lock.json', 'next.config.js') }}

- name: Install Vercel CLI
run: npm i --global vercel@latest
Expand Down Expand Up @@ -187,17 +182,6 @@ jobs:
with:
repository: hashicorp/dev-portal
path: ./unified-docs-frontend-preview
- name: Use cache
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: |
~/.npm
${{ github.workspace }}/unified-docs-frontend-preview/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.mdx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
Expand All @@ -206,6 +190,12 @@ jobs:
cache-dependency-path: 'unified-docs-frontend-preview/package-lock.json'
node-version-file: 'unified-docs-frontend-preview/package.json'

- name: Cache Next.js build
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: ${{ github.workspace }}/unified-docs-frontend-preview/.next/cache
key: ${{ runner.os }}-nextjs-build-devportal-${{ hashFiles('unified-docs-frontend-preview/package-lock.json', 'unified-docs-frontend-preview/next.config.js') }}

- name: Setup Vercel CLI
run: npm i --global vercel@latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copy-cloud-docs-for-tfe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Generate version-metadata for workflow
working-directory: '${{github.workspace}}/new-docs-pr'
run: |
npm i
npm ci
npm run prebuild -- --only-build-version-metadata

- name: Create the new TFE version folder for RELEASE PR
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/deploy-udr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@ jobs:
cache: 'npm'
node-version-file: 'package.json'

- name: Use cache
- name: Cache Next.js build
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.mjs', '**/*.ts', '**/*.tsx', '**/*.mdx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-build-${{ hashFiles('package-lock.json', 'next.config.js') }}

- name: Install Vercel CLI
run: npm install --global vercel@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-docs-for-tfe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Generate version-metadata for workflow
working-directory: '${{github.workspace}}/new-docs'
run: |
npm i
npm ci
npm run prebuild -- --only-build-version-metadata

- name: Checkout HCPTF-diff for new docs version DIFF PR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cache: 'npm'
node-version-file: 'package.json'

- run: npm i
- run: npm ci
- run: npm run test

lint:
Expand All @@ -46,7 +46,7 @@ jobs:
node-version-file: 'package.json'

- name: Install Dependencies
run: npm i
run: npm ci

- name: Run lint check
run: npm run lint
Binary file modified scripts/prebuild/prebuild-arm-linux-binary.gz
Binary file not shown.
Binary file modified scripts/prebuild/prebuild-arm-mac-binary.gz
Binary file not shown.
Binary file modified scripts/prebuild/prebuild-x64-linux-binary.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/utils/batch-promises.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export async function batchPromises(
batchName,
arrayToBatch,
asyncMapFn,
{ batchSize = 16, loggingEnabled = true } = {
batchSize: 16,
{ batchSize = 64, loggingEnabled = true } = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return to testing if this is dependent on local machines thread count? Could this cause CPU thread switching trash?

Copy link
Contributor

Choose a reason for hiding this comment

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

Only unknown here, but really don't know. 🤷🏻

Copy link
Contributor Author

@williamdalessandro williamdalessandro Dec 5, 2025

Choose a reason for hiding this comment

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

since it's node and its batching promises, there's inherent protection against that because its limited to 4 threads based on the UV_THREADPOOL_SIZE parameter. So it's always handling 4 things at a time, but we'd just be handing it a bigger batch that's a bit more efficient, but also not going so crazy with the batch size that we hit other issues with memory pressure. So it should be fine to stay

batchSize: 64,
loggingEnabled: true,
},
) {
Expand Down
Loading