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: update metadata and redirects #435

Closed
wants to merge 57 commits into from
Closed

feat: update metadata and redirects #435

wants to merge 57 commits into from

Conversation

alinarublea
Copy link
Contributor

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description. Or if there's no issue created, make sure you
    describe here the problem you're solving.
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

If the PR is changing the API specification:

  • make sure you add a "Not implemented yet" note the endpoint description, if the implementation is not ready
    yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
  • make sure you add at least one example of the request and response.

If the PR is changing the API implementation or an entity exposed through the API:

  • make sure you update the API specification and the examples to reflect the changes.

Related Issues

Thanks for contributing!

Copy link

github-actions bot commented Aug 9, 2024

This PR will trigger a minor release when merged.

@alinarublea alinarublea added the enhancement New feature or request label Aug 12, 2024
Copy link
Contributor

@iuliag iuliag left a comment

Choose a reason for hiding this comment

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

Looks good so far in terms of functionality 👍🏻
Since this fix is very specific (updating and publishing redirect with a first audit type that requires it), I'd propose either to:

  1. make it specific to broken backlinks, i.e. check the audit type and run only for it (return a not supported otherwise), and document accordingly, until we have another kind of auto-fix to implement which will inform a better and/or generic API
  2. or try to come up with a more generic API/handling in the controller, by looking at known auto-fixes (redirects), but also potential next ones (bulk-metadata).

return notFound('Audit type not found');
}
const existingFixedURLs = config.getFixedURLs(auditType);
const newFixedURLs = mergeFixes(existingFixedURLs, fixedURLs);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reasoning behind merging fixed URLs?

const existingFixedURLs = config.getFixedURLs(auditType);
const newFixedURLs = mergeFixes(existingFixedURLs, fixedURLs);
const contentClient = await getContentClient(env, site, log);
for (const { brokenTargetURL, targetURL } of fixedURLs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Before appending the fixed URLs to the redirects sheet, we need to check if they don't already exist in the file.
This is the minimal validation. Other kinds of validation (can follow-up) are listed in https://wiki.corp.adobe.com/display/AEMSites/SEO+%7C+Broken+Backlinks+Manual+and+Auto-Fix#SEO|BrokenBacklinksManualandAutoFix-Validation


/* c8 ignore next 3 */
export const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
? h1()
: h2();

export const GOOGLE_DRIVE = 'google-drive';
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe all these constants and methods related to the content client should go in an utils of their own?

@alinarublea alinarublea changed the title feat: publish broken-backlinks fixes feat: update metadata and redirects Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants