@@ -108,6 +108,7 @@ async function updateSuggestionWithGenericIssues(
108108 logger . info ( `Loading CWV reference suggestions from: ${ filename } , ${ dirname } , ${ jsonPath } ` ) ;
109109 const rawData = fs . readFileSync ( jsonPath , 'utf-8' ) ;
110110 cwvReferenceSuggestions = JSON . parse ( rawData ) ;
111+ await say ( env , logger , slackContext , `Loaded CWV reference suggestions from: ${ jsonPath } ` ) ;
111112 } catch ( error ) {
112113 logger . error ( `Error loading CWV reference suggestions: ${ error . message } ` ) ;
113114 await say ( env , logger , slackContext , `Failed to load CWV reference suggestions: ${ error . message } ` ) ;
@@ -215,12 +216,12 @@ async function processCWVOpportunity(opportunity, logger, env, slackContext) {
215216 const issuesAddedResults = await Promise . all ( updatePromises ) ;
216217 const totalIssuesAdded = issuesAddedResults . reduce ( ( sum , issuesAdded ) => sum + issuesAdded , 0 ) ;
217218
218- if ( suggestionsToUpdate . length > 0 ) {
219- logger . info ( `Added ${ totalIssuesAdded } generic CWV suggestions for opportunity ${ opportunity . getId ( ) } ` ) ;
219+ if ( totalIssuesAdded > 0 ) {
220220 await say ( env , logger , slackContext , `🎯 Added ${ totalIssuesAdded } generic CWV suggestions for opportunity ${ opportunity . getId ( ) } ` ) ;
221+ logger . info ( `Added ${ totalIssuesAdded } generic CWV suggestions for opportunity ${ opportunity . getId ( ) } ` ) ;
221222 } else {
223+ await say ( env , logger , slackContext , `:x: No generic CWV suggestions added for opportunity ${ opportunity . getId ( ) } ` ) ;
222224 logger . info ( `No generic CWV suggestions added for opportunity ${ opportunity . getId ( ) } ` ) ;
223- await say ( env , logger , slackContext , `No generic CWV suggestions added for opportunity ${ opportunity . getId ( ) } ` ) ;
224225 }
225226
226227 return suggestionsToUpdate . length ;
0 commit comments