Skip to content

Conversation

@ekremney
Copy link
Member

@ekremney ekremney commented Mar 8, 2024

Unit tests will follow.

For the detailed documentation/explanation about the logic used to find suggestions, please see https://wiki.corp.adobe.com/display/AEMSites/Auto+Generation+of+Redirect+Targets+for+404+Pages

@github-actions
Copy link

github-actions bot commented Mar 8, 2024

This PR will trigger a minor release when merged.

Copy link

@blefebvre blefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea. Any rate limit concerns with the Google API?

const query = getSuggestionQuery(url);
const resp = await fetch(`${SEARCH_ENGINE_BASE_URL}?cx=${searchEngineId}&key=${searchEngineKey}&q=${encodeURIComponent(query)}`);
if (!resp.ok) {
throw new Error(`Google API returned unsuccessful response ${resp.status}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be helpful to have the query included in this error message?

// send alert to the Slack channel - group under a thread if ts value exists
await slackClient.fileUpload({
thread_ts: slackContext?.thread_ts,
channel_id: slackContext?.channel,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If slackContext is undefined, where will the file be uploaded to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants