Repository navigation
PROD-2773: warn when content references a CDN container owned by neither the source nor the target - #236
Merged
5PK merged 1 commit intoOct 14, 2026
Conversation
…her the source nor the target PROD-2773: warn about asset URLs into a CDN container owned by neither instance Content synced before the PROD-915 fix kept the upstream instance's CDN URLs, so a source can reference a third instance's container (e.g. cdn-usa2.aglty.io/ upstream-qa/...). The asset mapping cannot map those, so they passed through silently: image/file fields arrived empty on the target and rich-text links kept pointing at the other instance. The content pusher now scans each locale's syncable items (also in --preflight and for unchanged items) and reports every foreign CDN URL once per run, with the items/fields/locales using it. Reporting only: payloads, counts, success and exit codes are unchanged. - foreign-cdn-detector: pure URL extraction (aglty.io, azurewebsites origin, cdn*.agilitycms.com, learned custom edge hosts; JSON-escaped, &, query and percent-encoded variants) and container-ownership check. Source/target containers come from asset mappings and pulled assets; nothing is reported while either side's container is unknown. - foreign-cdn-report: per-run dedupe and rendering; attachment-field URLs are called out separately from text occurrences. - Surfaces: logger warning on first sighting, end-of-run "Foreign CDN references: N URLs in M items" block, additive --jsonSummary warnings (code "foreignCdnReference", url, container, references), and a preflight warnings section that does not affect totals or the exit code. Preflight totals now include PROD-2542's "invalid" count; the push test expects it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5PK
force-pushed
the
PROD-2773-foreign-cdn-warning
branch
from
October 14, 2026 18:15
bc5e87e to
8c6302b
Compare
5PK
marked this pull request as ready for review
October 14, 2026 18:25
DerekAgility
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Content synced before the PROD-915 fix (32b6ab5, 2026-03-20) kept asset URLs that point at the upstream instance's CDN container. Those URLs are now part of the source data. Later syncs can't map them, because the asset mapping only knows the source's own container, so they pass them through without a word.
On a customer instance pair,
agility verify(PROD-2552) found:Change
Sync, push and
--preflightnow warn when content references an Agility CDN container that belongs to neither the source nor the target. This only reports: item payloads, counts,successand exit codes don't change, and there are no new flags.What gets flagged
cdn*.aglty.io,agility-cdn*.azurewebsites.net,cdn*.agilitycms.com, plus custom edge hosts (e.g.cdn.example.com) learned from the pair's asset mappings and pulled assets.&, percent-encoded, protocol-relative, and URLs with query strings.How it's reported
--jsonSummarywarning entries gaincode,url,containerandreferences. These fields are additive, so there's no schema version bump.--preflightgets a warnings section that doesn't affect the counts or the exit code.Where it runs
content-pusher.tsscans each locale's items before change detection, so unchanged items and--preflightare covered.New files:
foreign-cdn-detector.ts(pure detector),foreign-cdn-report.ts(per-run collector),report-foreign-cdn-references.ts(glue). Also adds a read-onlyAssetMapper.getMappings().Testing
npx jest(stacked on PROD-2552: addagility verifyto compare a synced target against its source #235): 131 suites / 2,517 tests pass.tsc --noEmitis clean. Lint shows 0 errors.--preflighton a two-locale customer clone pair: exit 0, totals unchanged. It found 17 URLs in 10 items:Limitations
--headlessthe per-URL warnings go to the log file only. The end-of-run block and the JSON summary always show them.Closes PROD-2773. Related: PROD-915, PROD-2552.
🤖 Generated with Claude Code