Skip to content

Commit 4e7c47a

Browse files
Merge branch 'main' into feat/llmo-5180-url-inspector-semrush-bp
2 parents 62117eb + d2d8701 commit 4e7c47a

6 files changed

Lines changed: 336 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.568.1](https://github.com/adobe/spacecat-api-service/compare/v1.568.0...v1.568.1) (2026-06-11)
2+
3+
4+
### Bug Fixes
5+
6+
* update plg onboarding existing delivery type ([#2526](https://github.com/adobe/spacecat-api-service/issues/2526)) ([b1b90ac](https://github.com/adobe/spacecat-api-service/commit/b1b90ac6143403cafe480f1a4096b4992bd6cfc9))
7+
18
# [1.568.0](https://github.com/adobe/spacecat-api-service/compare/v1.567.0...v1.568.0) (2026-06-11)
29

310

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/spacecat-api-service",
3-
"version": "1.568.0",
3+
"version": "1.568.1",
44
"description": "SpaceCat API Service",
55
"main": "src/index.js",
66
"type": "module",

src/controllers/plg/plg-onboarding.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ async function resolveImsEmailsForPlgRecords(records, context) {
200200
const PLG_REJECTION_MESSAGES = {
201201
'internal-org': { emoji: ':no_entry:', label: 'Rejected — Internal Org' },
202202
'paid-customer': { emoji: ':no_entry:', label: 'Rejected — Paid Customer' },
203+
'frescopa-domain': { emoji: ':no_entry:', label: 'Rejected — Frescopa Domain' },
203204
};
204205

205206
async function postPlgRejectionNotification(domain, imsOrgId, reason, context, org) {
@@ -291,6 +292,11 @@ function PlgOnboardingController(ctx) {
291292
return badRequest('Invalid domain: must be a valid hostname or hostname/path (e.g. nba.com or nba.com/kings)');
292293
}
293294

295+
if (domain.toLowerCase().includes('frescopa')) {
296+
await postPlgRejectionNotification(domain, imsOrgId, 'frescopa-domain', context);
297+
return badRequest('PLG onboarding is not available for frescopa domains');
298+
}
299+
294300
try {
295301
const { Organization, Entitlement } = context.dataAccess;
296302
const existingOrg = await Organization.findByImsOrgId(imsOrgId);

src/controllers/plg/plg-onboarding/onboarding-flow.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,43 @@ export async function performAsoPlgOnboarding({
637637
onboarding.setSiteId(site.getId());
638638
steps.siteResolved = true;
639639

640+
// Step 5a: Alert when detected delivery type differs from the stored one.
641+
// Skip for newly created sites — delivery type was just set from findDeliveryType in Step 5.
642+
// We alert instead of auto-correcting because findDeliveryType is not 100% reliable.
643+
if (!presetDeliveryType && !steps.siteCreated) {
644+
const existingDeliveryType = site.getDeliveryType();
645+
let detectedDeliveryType;
646+
try {
647+
detectedDeliveryType = await findDeliveryType(baseURL);
648+
} catch (e) {
649+
log.warn(`Failed to detect delivery type for ${baseURL}: ${e.message}`);
650+
}
651+
if (
652+
detectedDeliveryType
653+
&& detectedDeliveryType !== SiteModel.DELIVERY_TYPES.OTHER
654+
&& detectedDeliveryType !== existingDeliveryType
655+
) {
656+
log.warn(`Delivery type mismatch for site ${site.getId()} (${baseURL}): stored=${existingDeliveryType} detected=${detectedDeliveryType}`);
657+
const channelId = env.SLACK_PLG_ONBOARDING_CHANNEL_ID;
658+
const token = env.SLACK_BOT_TOKEN;
659+
/* c8 ignore next */
660+
if (channelId && token) {
661+
const message = ':warning: *PLG Onboarding — Delivery Type Mismatch*\n\n'
662+
+ `• *Site ID:* \`${site.getId()}\`\n`
663+
+ `• *Domain:* \`${baseURL}\`\n`
664+
+ `• *Org ID:* \`${organizationId}\`\n`
665+
+ `• *Org:* ${organization.getName()} (\`${imsOrgId}\`)\n`
666+
+ `• *Stored delivery type:* \`${existingDeliveryType}\`\n`
667+
+ `• *Detected delivery type:* \`${detectedDeliveryType}\``;
668+
try {
669+
await context.postSlackMessage(channelId, message, token);
670+
} catch (err) {
671+
log.error(`Failed to post delivery type mismatch alert: ${err.message}`);
672+
}
673+
}
674+
}
675+
}
676+
640677
// Step 5b: Resolve canonical URL early so the RUM lookup uses the correct hostname
641678
const siteConfig = site.getConfig();
642679
const currentFetchConfig = siteConfig.getFetchConfig() || {};

0 commit comments

Comments
 (0)