feat(onboarding): resolve AEM CS code config via Cloud Manager Management API#2783
Draft
rpapani wants to merge 2 commits into
Draft
feat(onboarding): resolve AEM CS code config via Cloud Manager Management API#2783rpapani wants to merge 2 commits into
rpapani wants to merge 2 commits into
Conversation
…ment API
Fills the AEM CS branch of updateCodeConfig (previously a TODO): when the
onboarding serving host matches publish-p{programId}-e{environmentId}, resolve
the site code config (owner/repo/ref/type) from the CM Management API via the
new CloudManagerApiClient from spacecat-shared-cloud-manager-client.
EDS hosts encode owner/repo/ref in the hostname; AEM CS publish hosts encode
only program/environment, so the repo must be looked up in Cloud Manager.
Resolution is best-effort: if the CM API is not configured (env absent) or the
lookup fails, code config is skipped without failing onboarding.
Depends on spacecat-shared PR #1794 (CloudManagerApiClient). The dependency is
pinned to 1.4.5 here and must be bumped to the release that includes
CloudManagerApiClient before this is un-drafted/merged.
SITES-40809
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # package-lock.json
|
This PR will trigger a minor release when merged. |
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.
What
Fills the AEM CS branch of
updateCodeConfiginsrc/support/utils.js— previously a// TODO: Add AEM CS pattern code config resolution here.When the onboarding serving host matches
publish-p{programId}-e{environmentId}.adobeaemcloud.{com,net}, it resolves the site's code config (owner/repo/ref/type) from the Cloud Manager Management API via the newCloudManagerApiClient(spacecat-shared-cloud-manager-client) and callssite.setCode(...).Why
ref--repo--owner.aem.live) encode owner/repo/ref directly in the hostname → resolved by regex, no network call (unchanged).aso-code-config-onboardingskill does today, so imports + autofix work without manual code-config entry.Part of SITES-40809 (onboard automation for code optimizations).
Behaviour
updateCodeConfig(site, host, slackContext, log, context)— addscontext(forCloudManagerApiClient.createFrom). Both call sites (onboardSingleSite,onboarding-flow.js) updated.createFromthrows → logged + skipped; if the lookup fails → logged + Slack warning + skipped. Onboarding never fails on code-config resolution. This means the change is safe to merge before the CM creds/infra are in place — it simply stays dormant until configured.Dependencies & why this is a draft
CloudManagerApiClient. The dependency here is pinned to the current1.4.5; it must be bumped to the release that includesCloudManagerApiClientbefore un-drafting. Until that release, thebundle-buildCI gate will fail on the missing named export — expected, not a defect.*.private.adobe.ioendpoint. End-to-end verification in dev is gated on the CM/32route landing and api-service running inmct_workload_subnet_ids.Required config (Vault → env), not in this PR
CM_API_CLIENT_ID,CM_API_CLIENT_SECRET,CM_API_SCOPES,CM_API_IMS_ORG_ID,CM_API_BASE(https://ssg-stage.private.adobe.io/apidev/stage,https://ssg.private.adobe.io/apiprod), plus existingIMS_HOST.Tests
Added to
test/support/utils.test.js: AEM CS resolution success, CM-not-configured skip, and CM-lookup-failure skip. Fullutils+onboarding-flow-coresuites pass locally.