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

fix: quiet down noisy console logs from determineCanonical #3192

Merged
merged 1 commit into from Jan 9, 2024

Conversation

pepopowitz
Copy link
Collaborator

Description

The determineCanonicalFromDoc function, which is run on pretty much every page in the docs to identify a canonical source for it, is spamming the build output. It also pollutes the dev tools with an inaccurate warning message on each page.

It turns out...I used an incorrect regular expression to identify pages who pointed canonically at something other than the current version 😅 😬

This PR corrects that regular expression. The result should be a cleaner build output, and more accuracy on the warnings that remain.

When should this change go live?

  • This change is not yet live and should not be merged until {ADD_DATE} (apply hold label or convert to draft PR)?
  • There is no urgency with this change.
  • This change or page is part of a marketing blog, conference talk, or something else on a schedule.
  • This functionality is already available but undocumented.
  • This is a bug fix or security concern.

PR Checklist

  • I have added changes to the relevant /versioned_docs directory, or they are not for an already released version.
  • I have added changes to the main /docs directory (aka /next/), or they are not for future versions.
  • My changes require an Engineering review, and I've assigned an engineering manager or tech lead as a reviewer, or my changes do not require an Engineering review.
  • My changes require a technical writer review, and I've assigned @christinaausley as a reviewer, or my changes do not require a technical writer review.

@pepopowitz pepopowitz added kind/cleanup Issues related with clean-up the documentation dx Documentation infrastructure typically handled by the Camunda DX team labels Jan 9, 2024
@pepopowitz pepopowitz self-assigned this Jan 9, 2024
@@ -107,7 +107,7 @@ function determineCanonicalFromDoc(currentDoc, currentPlugin) {
.find((doc) => doc.id === unversionedId);

if (match) {
if (/(optimize|docs)((next|[0-9\.]*)\/)/.test(match.path)) {
if (/(optimize|docs)\/((next|[0-9\.]+)\/)/.test(match.path)) {
Copy link
Collaborator Author

@pepopowitz pepopowitz Jan 9, 2024

Choose a reason for hiding this comment

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

The old regex was matching every single doc, because it was only requiring the optimize|docs at the beginning

Copy link
Member

@akeller akeller left a comment

Choose a reason for hiding this comment

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

👍 my regex skills are poor at best, but this does look like an improvement!

@pepopowitz pepopowitz merged commit 1bbda73 into main Jan 9, 2024
9 checks passed
@pepopowitz pepopowitz deleted the pepopowitz/noisy-console-log branch January 9, 2024 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Documentation infrastructure typically handled by the Camunda DX team kind/cleanup Issues related with clean-up the documentation
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants