Skip to content
Merged
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b3c824d
add cwv suggestions task
tkotthakota-adobe Aug 20, 2025
e6eed7c
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Aug 23, 2025
2722059
remove unused auditTypes in step function state
tkotthakota-adobe Aug 23, 2025
36b37aa
refresh configuration state
tkotthakota-adobe Aug 23, 2025
857496c
add logs
tkotthakota-adobe Aug 23, 2025
0da81c8
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Aug 23, 2025
7a27459
adjust logs
tkotthakota-adobe Aug 24, 2025
43de392
remove incorrect save of old config from onboard modal
tkotthakota-adobe Aug 24, 2025
126b5b8
set orgId for existing sites which is missed in utils.js
tkotthakota-adobe Aug 24, 2025
291759a
remove some logs
tkotthakota-adobe Aug 24, 2025
0820096
remove debug logs
tkotthakota-adobe Aug 24, 2025
c0a7a48
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Aug 25, 2025
8229358
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Aug 25, 2025
a584e32
remove log
tkotthakota-adobe Aug 25, 2025
129d031
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Aug 26, 2025
112c2ca
remove comment
tkotthakota-adobe Aug 26, 2025
6efe8de
update package
tkotthakota-adobe Aug 26, 2025
043bee9
merge main
tkotthakota-adobe Sep 22, 2025
232d14d
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Sep 23, 2025
9e7c6a8
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Sep 24, 2025
f392451
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Sep 24, 2025
a721e8b
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Sep 25, 2025
ec3d477
Merge branch 'main' of github.com:adobe/spacecat-api-service into SIT…
tkotthakota-adobe Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions src/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,17 +787,15 @@ export const onboardSingleSite = async (
log.info(`All audits are already enabled for site ${siteID}`);
}

reportLine.audits = auditTypes.join(', ');
log.info(`Enabled the following audits for site ${siteID}: ${reportLine.audits}`);

await say(`:white_check_mark: *For site ${baseURL}*: Enabled imports: ${reportLine.imports} and audits: ${reportLine.audits}`);
// Refresh configuration to ensure we have the latest state for audit triggering
const currentConfiguration = await Configuration.findLatest();

// trigger audit runs
log.info(`Starting audits for site ${baseURL}. Audit list: ${auditTypes}`);
await say(`:gear: Starting audits: ${auditTypes}`);
for (const auditType of auditTypes) {
/* eslint-disable no-await-in-loop */
if (!latestConfiguration.isHandlerEnabledForSite(auditType, site)) {
if (!currentConfiguration.isHandlerEnabledForSite(auditType, site)) {
await say(`:x: Will not audit site '${baseURL}' because audits of type '${auditType}' are disabled for this site.`);
} else {
await triggerAuditForSite(
Expand All @@ -810,6 +808,11 @@ export const onboardSingleSite = async (
}
}

reportLine.audits = auditTypes.join(', ');
log.info(`Enabled the following audits for site ${siteID}: ${reportLine.audits}`);

await say(`:white_check_mark: *For site ${baseURL}*: Enabled imports: ${reportLine.imports} and audits: ${reportLine.audits}`);

// Opportunity status job
const opportunityStatusJob = {
type: 'opportunity-status-processor',
Expand Down Expand Up @@ -859,15 +862,33 @@ export const onboardSingleSite = async (
},
};

// CWV Demo Suggestions job - add generic CWV suggestions to opportunities
const cwvDemoSuggestionsJob = {
type: 'cwv-demo-suggestions-processor',
siteId: siteID,
siteUrl: baseURL,
imsOrgId: imsOrgID,
organizationId,
taskContext: {
profile: profileName, // Pass the profile name for demo check
slackContext: {
channelId: slackContext.channelId,
threadTs: slackContext.threadTs,
},
},
};

log.info(`Opportunity status job: ${JSON.stringify(opportunityStatusJob)}`);
log.info(`Disable import and audit job: ${JSON.stringify(disableImportAndAuditJob)}`);
log.info(`Demo URL job: ${JSON.stringify(demoURLJob)}`);
log.info(`CWV Demo Suggestions job: ${JSON.stringify(cwvDemoSuggestionsJob)}`);

// Prepare and start step function workflow with the necessary parameters
const workflowInput = {
opportunityStatusJob,
disableImportAndAuditJob,
demoURLJob,
cwvDemoSuggestionsJob,
workflowWaitTime: workflowWaitTime || env.WORKFLOW_WAIT_TIME_IN_SECONDS,
};

Expand Down