USE 455 - Skip libguides sub-pages that are root page#271
Merged
Conversation
Why these changes are being introduced: It was discovered that we had duplicates in LibGuides since adding sub-pages. This was because for guides that have sub-pages, the sub-page with "position = 1" is effectively the root guide, just by a non-friendly URL. How this addresses that need: We can quite easily skip these guides by detecting "position = 1" and "name = 'Home'" when analyzing the sub-page metadata from the LibGuides API. Side effects of this change: * Reduce duplication Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/USE-455
jonavellecuerdo
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose and background context
Why these changes are being introduced:
It was discovered that we had duplicates in LibGuides since adding sub-pages. This was because for guides that have sub-pages, the sub-page with
position = 1is effectively the root guide, just by a non-friendly URL.How this addresses that need:
We can quite easily skip these guides by detecting
position = 1andname = 'Home'when analyzing the sub-page metadata from the LibGuides API.In addition, just a bit of cleanup of regex expressions and converting an INFO --> DEBUG logging statement.
How can a reviewer manually see the effects of these changes?
Compare the previous
v2tab against the currentv3tab from this spreadsheet: https://docs.google.com/spreadsheets/d/1G0ci9V-SMvqGuT3p0xwI6u63Hr1VTy2e-cLOu60LfAk/edit?gid=1391449591#gid=1391449591.While the total number of rows has increased, this is due to an expanded crawl scope for an unrelated issue.
What's important to note is the dramatic reduction, nearly to zero, for duplicated
titlecolumn values (a good indicator of a true duplicate).A couple of examples that are now de-duped:
Includes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?
Code review