Skip to content

Working Branch for PLP fixes#271

Merged
sirugh merged 14 commits into
plpfrom
plp-updates
May 6, 2026
Merged

Working Branch for PLP fixes#271
sirugh merged 14 commits into
plpfrom
plp-updates

Conversation

@sirugh

@sirugh sirugh commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This branch extends the plp branch with stability, observability, and local-development improvements across the prerender pipeline. Some of these changes can probably get made directly to the upstream main branch, and some even to the upstream plp branch.

Changes

Watchdog timer (poller.js)

Added a 5-minute idle watchdog to the check-product-changes poller. If no render completes within that window, the action aborts immediately (clearing the mutex) rather than burning the full 3-hour timeout. Uses Promise.race between locale processing and the watchdog promise.

Action timeout & memory (app.config.yaml, check-product-changes/index.js)

  • Extended check-product-changes timeout from 1 hour → 3 hours and memory from 512 MB → 4 GB to support large catalog runs.
  • Mutex TTL is now derived from ACTION_TIMEOUT_MS so the lock auto-expires if the runtime kills the process unexpectedly.

AEM Admin API tuning (aem.js)

Max of 600 paths from an overlay can be requested per minute. Changes were made to invoke bulk admin api calls once per minute with 600 paths per.

  • Reduced MAX_PENDING_JOBS from 20 → 4 and increased JOB_STATUS_POLL_INTERVAL_MS from 5s → 15s to match the higher BATCH_SIZE=600 (up from 50), reducing memory backlog and polling overhead.
  • Added abortProcessing() for the watchdog path to skip draining queues on a frozen action.

mark-up-clean-up batching (mark-up-clean-up/index.js)

Batches GetUrlKey GraphQL queries to stay within the catalog 100-product limit (was sending all SKUs in a single request).

LOCAL_FS mode (localFilesLib.js, all four actions, runners)

New LOCAL_FS=true env flag redirects all aio Files I/O to ./local-data/ on disk, allowing the full pipeline to run locally without aio storage credentials or App Builder action timeouts. Note - the preview/publish invocation will still use the site's configured overlay - there is no way to preview/publish from a local machine.

Tooling

  • check-errors.sh — shell script to paginate aio rt activation list, find error activations, and print their full logs/results; wired up as a Claude slash command (/check-aio-errors)
  • tools/get-state-csv.js — script to fetch and print the current state CSV from aio storage
  • RUNBOOK.md — added note about long-running activations not appearing in aio rt activation list until they finish; added LOCAL_FS usage docs
  • CLAUDE.md — added project rule to use npm run deploy instead of aio app deploy

*/

// Mock implementation of @adobe/helix-shared-string for Jest tests
/**

@sirugh sirugh Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tests the path sanitization change. Move this to plp branch regardless.

Comment thread runners/run-fetch-all-products.js Outdated
sirugh and others added 7 commits May 4, 2026 12:22
…mory

Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
…talog 100-product limit

Passing all published SKUs in a single query fails when the catalog exceeds 100 products
(observed at 23,398 SKUs: "Product count exceeds the maximum allowed (100)"). With no
query result, every published product appears redundant and risks mass unpublishing.

Fix: split SKUs into batches of 50 (reusing createBatches/BATCH_SIZE) and fan out
requests in parallel, then merge results before the redundancy check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ability. add watchdog exit script to exit early incase of recurring failures at commerce api (504, etc).
Comment thread .claude/settings.local.json Outdated
Comment thread runners/run-product-changes-checker.js Outdated
Comment thread runners/run-render-all-categories.js Outdated
Comment thread app.config.yaml Outdated
Comment thread actions/check-product-changes/poller.js
Comment thread actions/mark-up-clean-up/index.js Outdated
Comment thread tools/get-state-csv.js Outdated
sirugh and others added 5 commits May 5, 2026 08:36
Co-authored-by: Natxo Cabré <natxo.cabre@gmail.com>
…r-all-categories; output to local-data/

- adds render-all-categories prefix alongside check-product-changes
- saves files to local-data/{prefix}/ (project-root-anchored via __dirname)
- uses path.basename instead of replace to derive local filenames
- anchors dotenv to project root so script works from any cwd

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…p-clean-up

Catalog Service GraphQL rejects queries with >100 SKUs ("Product count exceeds
the maximum allowed (100)"). The batching added in 4625e42 originally used
BATCH_SIZE=50, which was safe, but 22f211d raised BATCH_SIZE to 600 for the
AEM Admin rate limit, inadvertently breaking the catalog query batching.

Fix: add CATALOG_BATCH_SIZE=100 constant, make createBatches accept an optional
size param (defaulting to BATCH_SIZE), and pass CATALOG_BATCH_SIZE explicitly
at the GetUrlKeyQuery call site. The AEM unpublish batches keep BATCH_SIZE=600.

Limit confirmed against live API: 100 SKUs succeed, 101 fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tWithRenderedHash

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sirugh sirugh merged commit 199fd38 into plp May 6, 2026
2 checks passed
@sirugh sirugh deleted the plp-updates branch May 6, 2026 16:08
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