Skip to content

Test: check-duplicates PR check (throwaway, do not merge) - #2077

Closed
marcleblanc2 wants to merge 3 commits into
mainfrom
marc/test-check-duplicates
Closed

marcleblanc2 wants to merge 3 commits into
mainfrom
marc/test-check-duplicates

Conversation

@marcleblanc2

Copy link
Copy Markdown
Contributor

Throwaway test for #2076. Copies a paragraph from docs/admin/config/settings.mdx into docs/admin/how-to/enable-experimental-feature.mdx (added duplicate), and changes one word in docs/code-search/features.mdx line 60, which was already a duplicate of docs/code-search/working/search-contexts.mdx (edited duplicate). Will be closed once the check has commented.

marcleblanc2 and others added 3 commits October 6, 2026 16:35
Each fact should have one home in the docs, with other pages linking to
it; copies drift out of date the moment the original changes. This adds
a non-blocking PR check that comments the passages a PR adds which say
the same thing as a passage elsewhere under `docs/`, paraphrased or
verbatim, plus an inline comment on each added passage pointing at its
duplicates.

`dev/check-duplicates.mjs` splits every page into passages (paragraphs,
list items, tables, fenced code blocks), normalizes them, and compares
word trigrams by Jaccard similarity. Auto-generated pages and
SCHEMA_SYNC blocks are skipped. Like the links and redirects checks, CI
records the findings on the merge base and reports only the ones the PR
adds; main has hundreds of pre-existing findings.

AGENTS.md gains the "One home per fact" rules so the duplication does
not grow back.

Amp-Thread-ID: https://ampcode.com/threads/T-01a11326-478d-72cf-bbb7-587d16b378e9
Co-authored-by: Amp <[email protected]>
A PR that edits one copy of a duplicated passage now gets a comment
naming the other copies, so the author can pick the home and replace
the rest with links, or make the same change there. Added duplication
and edited duplication are reported in separate sections with their
own advice. Also strip trailing spaces from the example-hostnames
bullet in AGENTS.md.

Amp-Thread-ID: https://ampcode.com/threads/T-01a11326-478d-72cf-bbb7-587d16b378e9
Co-authored-by: Amp <[email protected]>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Oct 6, 2026 10:37pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Direct preview links to pages changed in this PR:

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR adds 1 duplicated pair(s) of passages

Passages this PR added, with the places that already say the same thing. Each added passage also has an inline comment.

2 passages, at least 57% similar

Each fact has one home in the docs. Keep the passage on the page that owns the topic, and replace the others with a sentence and a link to it, so they cannot drift apart. Before writing a config snippet, search docs/ for the key and link to the existing one.

⚠️ This PR edits 1 passage pair(s) that were already duplicated

The passage you changed is also written somewhere else, so the two copies now disagree. Decide which page is the home for it, and replace the other copy with a link; or make the same change there too.

2 passages, at least 80% similar

Reproduce locally with node dev/check-duplicates.mjs --diff <(git diff -U0 origin/main).

5. After changing the values in Administration > Global settings, the frontend will either restart automatically or you might be asked to restart the frontend for the changes to take effect.
6. For more information, see [Editing global settings for administrators](/admin/config/settings#editing-global-settings-for-site-admins)

After setting or changing certain values in **Site admin > Global settings** the frontend will restart automatically or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This passage says the same thing as:

Each fact has one home in the docs. Keep the passage on the page that owns the topic, and replace the others with a sentence and a link to it, so they cannot drift apart. Before writing a config snippet, search docs/ for the key and link to the existing one.

Search contexts help you search the code you care about on Sourcegraph. A search context represents a set of repositories at specific revisions on a Sourcegraph instance that will be targeted by search queries by default.

Every search on Sourcegraph uses a search context. Search contexts can be defined with the contexts selector shown in the search input, or entered directly in a search query.
Every search in Sourcegraph uses a search context. Search contexts can be defined with the contexts selector shown in the search input, or entered directly in a search query.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This passage was already duplicated, and is now out of step with:

The passage you changed is also written somewhere else, so the two copies now disagree. Decide which page is the home for it, and replace the other copy with a link; or make the same change there too.

This branch was successfully deployed

1 active deployment
Preview — 008761b2 Deployed Oct 6, 2026 by vercel[bot]
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