Skip to content

MWPW-201818: path-based seotech structured-data resolution - #6350

Draft
hparra wants to merge 6 commits into
stagefrom
hgpa-adobe-mwpw-201818-ticket
Draft

MWPW-201818: path-based seotech structured-data resolution#6350
hparra wants to merge 6 commits into
stagefrom
hgpa-adobe-mwpw-201818-ticket

Conversation

@hparra

@hparra hparra commented Jul 24, 2026

Copy link
Copy Markdown
Member
  • Replaces the old sha256 + IMS bucket lookup with path-based resolution from the public origin map.
  • Adds pathname canonicalization and unknown-host fallback so AEM preview/live hostnames can still resolve repo mappings by path prefix.
  • Adds ?seotech-structured-data=on (and origin map URL override) for safer testing on pages without authored metadata.
  • Keeps existing video-object behavior unchanged and updates seotech docs/tests for the new flow.

Resolves: MWPW-201818

Test URLs:

hparra and others added 5 commits July 23, 2026 21:44
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handles AEM preview/live URLs (e.g. *.aem.live) where the hostname
doesn't match any key in the origin map. When no host-specific
origins are found, resolveRepoFromOriginMap now searches all
subdomains by path prefix — which is unambiguous across the map.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aem-code-sync

aem-code-sync Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates Milo’s SEOTECH structured-data integration to resolve the correct repo via path-prefix matching against the public AEM origin map (instead of the previous sha256/IMS-bucket flow), with additional testing toggles.

Changes:

  • Implement path-based repo resolution using the public origin map + structuredDataUrlTemplate, including pathname canonicalization and unknown-host path fallback (AEM preview/live).
  • Enable structured-data injection via ?seotech-structured-data=on by loading the SEOTECH module when the query param is present.
  • Update SEOTECH unit tests and README for the new structured-data resolution flow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
libs/features/seotech/seotech.js Adds origin-map-based structured-data resolution, enablement helper, and updated logging context.
libs/utils/utils.js Loads SEOTECH when seotech-structured-data=on is set via query param (in addition to metadata / video url).
test/features/seotech/seotech.test.js Extends unit coverage for canonicalization, query-param enablement, origin map fetch + repo resolution, and AEM host fallback.
libs/features/seotech/README.md Documents the new structured-data resolution source and the query-param toggle.
Comments suppressed due to low confidence (1)

libs/features/seotech/seotech.js:217

  • append() passes JSON.stringify(obj) as a string into createTag(). In this codebase createTag() inserts string content via insertAdjacentHTML, which parses HTML; if the fetched JSON-LD contains </script> it could break out of the tag and inject markup. Set the script content via textContent (or text) instead so the payload is treated as plain text.
  const append = (obj, className) => {
    if (!obj) return;
    const attributes = { type: 'application/ld+json' };
    if (className) attributes.class = className;
    const script = createTag('script', attributes, JSON.stringify(obj));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/utils/utils.js
Comment on lines +2653 to +2654
const seotechStructuredDataParam = new URL(window.location.href).searchParams
.get('seotech-structured-data') === 'on';
Comment on lines 32 to 36
Metadata Properties:

- `seotech-structured-data`: `on` to enable SEOTECH lookup
- `?seotech-structured-data=on`: test-only query param override to force SEOTECH lookup on a page

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@github-actions github-actions Bot added the Stale label Aug 1, 2026
@hparra

hparra commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Waiting for related CDN release

@github-actions github-actions Bot removed the Stale label Aug 8, 2026
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.

2 participants