Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto suggestions for 404s #133

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

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

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.

2 participants