Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hubspot’s v2 api was not returning all pages when we requested them. We were not hitting the limit. It appears to be a bug that they fixed in v3 of their API. The bug was causing some pages to be re-created even though they already existed. Hubspot was appending an integer for a while then began appending a timestamp to avoid overwriting the existing page. Looking at the timestamps of the published pages, this has been a problem since December 2020, and 80 copies of each erroring page have been mistakenly published.
I tested the code on the
learn-docker
pages and it successfully updated the files. Before publishing the entire site, I’m going to let somebody else take a look and run the code.There was some previous work done to say how many pages need to be deleted. I updated the code to log the slug of each duplicate/orphaned page, which shows the pages that end in timestamps (Hubspot duplicate prevention). We will need to make another PR to delete the orphaned pages.
I haven't run the script to fix the other broken files, yet. We need to do that after review/merge.
Improves debuggability of some code, as well.