Skip to content

ci: gate the API reference against duplicate-content across versions - #431

Open
eugenia-scandit wants to merge 1 commit into
mainfrom
fix/api-reference-seo-check
Open

ci: gate the API reference against duplicate-content across versions#431
eugenia-scandit wants to merge 1 commit into
mainfrom
fix/api-reference-seo-check

Conversation

@eugenia-scandit

Copy link
Copy Markdown
Collaborator

The API reference is published once per major.minor line, so the same symbol page exists at /6.28/data-capture-sdk/X, /7.6/data-capture-sdk/X and the unversioned /data-capture-sdk/X. None of them declares which is canonical, so Google treats them as independent pages and picks whichever it likes - usually the oldest, because it carries the most history and inbound links. That is how /6.28/.../aamva-barcode-result.html came to outrank current docs.

The rule this checks, per versioned page:

unversioned counterpart returns 200 -> canonical pointing at it
unversioned counterpart returns 404 -> robots noindex

The second branch is the one easy to get wrong. An API removed since that line has no current equivalent, so a canonical would point at a 404 and Google would ignore it; that page needs de-indexing, not redirecting. Both cases occur in practice - the first sampled run found 4 of one and 3 of the other.

Nothing here is version-specific, which is the point: the canonical target is always the unversioned URL, which is by definition the current line. A release never changes what this expects and there is no version constant to maintain.

URLs come from the versioned API links the built site already contains (2,049 distinct across /6.28/ and /7.6/), sampled deterministically so CI checks the same pages each run rather than drifting.

Warns rather than fails. The API-reference HTML is generated outside this repository, so this gate can only observe it - it is merged now so the finding is visible and tracked, and takes --strict once the generator emits the tags.

The API reference is published once per major.minor line, so the same symbol
page exists at /6.28/data-capture-sdk/X, /7.6/data-capture-sdk/X and the
unversioned /data-capture-sdk/X. None of them declares which is canonical, so
Google treats them as independent pages and picks whichever it likes - usually
the oldest, because it carries the most history and inbound links. That is how
/6.28/.../aamva-barcode-result.html came to outrank current docs.

The rule this checks, per versioned page:

  unversioned counterpart returns 200  ->  canonical pointing at it
  unversioned counterpart returns 404  ->  robots noindex

The second branch is the one easy to get wrong. An API removed since that line
has no current equivalent, so a canonical would point at a 404 and Google would
ignore it; that page needs de-indexing, not redirecting. Both cases occur in
practice - the first sampled run found 4 of one and 3 of the other.

Nothing here is version-specific, which is the point: the canonical target is
always the unversioned URL, which is by definition the current line. A release
never changes what this expects and there is no version constant to maintain.

URLs come from the versioned API links the built site already contains (2,049
distinct across /6.28/ and /7.6/), sampled deterministically so CI checks the
same pages each run rather than drifting.

Warns rather than fails. The API-reference HTML is generated outside this
repository, so this gate can only observe it - it is merged now so the finding
is visible and tracked, and takes --strict once the generator emits the tags.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://Scandit.github.io/data-capture-documentation/pr-preview/pr-431/

Built to branch gh-pages at 2026-08-20 16:33 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

1 participant