Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[quality] site search indexes only the blog: docsRouteBasePath default does not match docs routeBasePath

Aperta Adatta ai principianti
#769 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
search, testing

Direzione di ricerca

Inizia da docusaurus.config.js:242 e confronta le opzioni del plugin di ricerca con presets.docs.routeBasePath. Esegui npm run build:production ed esamina build/search-index.json per confermare che le pagine della documentazione siano indicizzate. Poi aggiorna tests/e2e/search.spec.js per ripristinare l’assertion sul documento non appartenente al blog e la relativa nota esplicativa; il lavoro è completato quando l’indice di produzione include la documentazione e il test end-to-end supera.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent/quality bug hive/hosted-available-lke648397-260827-5n31 quality

Discovered while building end-to-end coverage for /search. This is a live search
defect, not a test gap.

Finding

docusaurus.config.js serves the docs at the site root:

        docs: {
          routeBasePath: "/", // Serve the docs at the site root

but registers the local search plugin with no options:

  plugins: [require.resolve("docusaurus-plugin-search-local")],

The plugin defaults to docsRouteBasePath: ["docs"]
(node_modules/docusaurus-plugin-search-local/lib/server/options.js:10). No route on this
site begins with /docs, so no docs page is indexed at all. Site search silently
returns blog posts only.

Measured on a clean production build at 26946ba
$ npm run build:production
$ node -e "const j=require(\"./build/search-index.json\");
  const d=j.flatMap(e=>e.documents||[]);
  console.log(d.length, [...new Set(d.map(x=>\"/\"+x.u.split(\"/\")[1]))]);"
31 [ "/blog" ]

31 documents, every one of them under /blog. The architectures catalog, community
pages, metrics, awards, members, events, resources and skills — the substance of the
site — are unsearchable.

Recommendation

Replace docusaurus.config.js:242:

  plugins: [require.resolve("docusaurus-plugin-search-local")],

with:

  plugins: [
    [
      require.resolve("docusaurus-plugin-search-local"),
      {
        // Docs are served at the site root (presets.docs.routeBasePath: "/"),
        // so the plugin default of ["docs"] matches no route and the index
        // ends up containing blog pages only.
        docsRouteBasePath: "/",
      },
    ],
  ],

Verified locally at 26946ba: with that change the same build emits 642 indexed
documents instead of 31 —

{ "/blog": 31, "/architectures": 325, "/community": 194, "/skills": 44,
  "/resources": 24, "/metrics": 12, "/events": 8, "/awards": 2, "/members": 2 }
Regression guard to land alongside the fix

tests/e2e/search.spec.js (added in the PR for the coverage gap issue) deliberately does
not assert docs coverage today, because that assertion fails on main. Once the config
change lands, tighten the index test by restoring:

    // The index is useless if it only ever picked up the blog scaffolding, so
    // require at least one docs page in it.
    expect(documents.some((document) => !document.u.startsWith("/blog"))).toBe(
      true,
    );

and update the note at the top of that file, which currently records this defect as the
reason the assertion is absent.

Needs a human

The quality agent opens test-only PRs, so it cannot ship the docusaurus.config.js
change itself. This fix needs a human or an agent permitted to change production
configuration. The regression-guard snippet above is the test-side follow-up and can be
applied by the quality agent once the config change has merged.

Priority

  • Impact: high (site search returns no docs content)
  • Effort: low (one config option, verified)

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 26946ba

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Lingua principale
JavaScript
Stelle
0
Fork
2
Merge medio
1g 9h
PR unite (30g)
232

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cncf/endusers

Tutte le issue di cncf/endusers

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.