feat(utils): enhance AEM Headless detection with SDK and GraphQL signals#1627
Draft
habansal wants to merge 1 commit into
Draft
feat(utils): enhance AEM Headless detection with SDK and GraphQL signals#1627habansal wants to merge 1 commit into
habansal wants to merge 1 commit into
Conversation
- Replace /content/dam/ (too generic, present on all AEM types) with more reliable headless-specific patterns - Add @adobe/aem-headless-client SDK reference detection - Add GraphQL persisted query URL (/graphql/execute.json) detection - Add AEM GraphQL endpoint reference (/content/_cq_graphql/) detection - Add weight boosting so each strong signal alone exceeds the threshold: - aem-headless string: +2 boost (3 pts total) - @adobe/aem-headless-client SDK: +3 boost (4 pts total) - graphql/execute.json: +2 boost (3 pts total) - _cq_graphql endpoint: +2 boost (3 pts total) - Add regression test: CS site with /content/dam/ images is NOT misclassified as headless Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Improves `detectAEMVersion()` in `spacecat-shared-utils` to detect AEM Headless sites more reliably.
Problem
Changes
Replaced `/content/dam/` with purpose-built headless patterns:
Added weight boosting so each strong signal alone clears the detection threshold (consistent with how EDS/AMS/CS already use boosting):
Tests
Replaced the two previous headless tests (both relied on having `aem-headless` AND `/content/dam/` together) with 5 targeted tests:
1155 tests passing, 0 failing.
Test plan
🤖 Generated with Claude Code