fix(pipelines): cite published docs URLs and align the incremental cleaner with the full run - #244
Open
Neilblaze wants to merge 1 commit into
Conversation
…eaner with the full run Signed-off-by: neilblaze <putubanerjee23@gmail.com>
google-oss-prow
Bot
requested review from
chasecadet and
franciscojavierarceo
September 8, 2026 00:08
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Fixes #243
Why
Two things in the docs ingestion path, both in logic the full and incremental pipelines carry as separate copies.
Citations are not the URLs the site publishes.
chunk_and_embedcites<base_url>/<path minus extension>. Hugo publishes a page at that path with a trailing slash, and publishes a section's_index.mdat the section directory. Of the 182 pages the pipeline indexes fromkubeflow/website@master, none of the URLs we emit resolve directly: 169 redirect, and 13 — every_index.mdsection landing page, including the KFP installation guide — return 404. Since #237 those URLs are the source pills the widget renders under tool-grounded answers.The incremental cleaner diverged from the full one. Both write into
kubeflow_docs, butchunk_and_embed_incrementalstill runs the pre-#234 cleaner. The two no longer agree on which pages to index (182 vs 183 out of the same 220 files), and of the pages both keep, 101 lose text under the incremental one — 181,491 characters, 23.8% of the corpus, up to 96% of a single page. Nothing automates that pipeline today, so this is latent, butpipelines/README.mdrecommends it for updates after the first full build.What
pipelines/utils.pybuild_docs_citation_url();clean_content()updated to the cleanerchunk_and_embedactually runspipelines/kubeflow-pipeline.pychunk_and_embedcalls the two helpers instead of inlining the logicpipelines/incremental-pipeline.pymax_tei_charsbecomes a parameter; chunk defaults come fromDEFAULT_DOCS_*pipelines/README.mdmax_tei_charsrow.github/workflows/oke-cicd.yamlincremental-pipeline.py, which the step was skipping while compiling its three siblingstests/utilsA KFP component runs in its own container and cannot import
utilsat runtime, so the helpers are mirrored inline under the same names and the tests pin the copies to the shared versions. A real shared import is not available here, so this does not close #81.Verification
Requested every citation URL the pipeline builds for the 182 pages it indexes, without following redirects:
Content is unchanged for the full pipeline: over all 220 files under
content/en/docs, the newutils.clean_contentoutput is byte-identical to the inline cleanerchunk_and_embedran before this change, and the indexed set is still the same 182 pages. Onlycitation_urlmoves.pytest: 156 passed locally with the KFP SDK installed; 148 passed / 8 skipped with onlyrequirements-test.txt, against 137 / 6 onmainpython kubeflow-pipeline.py,python incremental-pipeline.pyruff check docs-agent-mcp/session-issuer tests docs-agent-mcp/pipelines: clean_indexcase, fails itSome notes for reviewers
Existing red CI.
mainfails both steps of theLint and formatjob today.ruff check .reportsF811for the duplicateimport jsoninmcp-server/server.py, andruff format --checkreports 3 files. This branch leaves both to fix(ci): satisfy ruff lint and format checks on main #241 and adds no findings; it does take the format count from 3 to 2, because appending tests totests/test_docs_pipeline.pyoverwrites the trailing blank line that issue Bug: PR Safety workflow failing on main — ruff format check fails for tests/test_docs_pipeline.py #236 and PR Fix: Format tests/test_docs_pipeline.py to pass ruff checks #235 are about.Where the new tests run. The two component tests need the KFP SDK.
PR Safetyinstalls onlyrequirements-test.txt, so it skips them, the same way it already skips the existing component tests.Build, Test, and Deploy to OKEinstallskfp kfp-kubernetesand runs on every pull request, so they do execute there. Happy to addkfptorequirements-test.txtif you would rather both jobs cover it.Rollout. No migration, but the fix lands page by page.
store_milvusdeletes and re-inserts every(repo_name, file_path)it processes, so one full run rewrites all 182 citations. The incremental pipeline deletes byfile_unique_idindelete_old_vectorsand only touches changed files, so running it alone leaves the rest of the collection on the old URLs.Likely conflicts. Fix: issues pipeline chunk_size (1500) exceeds TEI embedding truncation limit (1000) #212 rewraps the same
from utils import ...statement inincremental-pipeline.py. Fix: Format tests/test_docs_pipeline.py to pass ruff checks #235/fix(ci): satisfy ruff lint and format checks on main #241/feat: improve RAG retrieval and adopt Helm upgrades #240 each touch the tail oftests/test_docs_pipeline.py, and feat: improve RAG retrieval and adopt Helm upgrades #240 also touchesoke-cicd.yaml. Preserve newlines in markdown cleaning for Langchain chunking #147 does the\s+→[ \t]+half of the cleaner fix on a path that has since moved.Left alone. The
ZeroDivisionErrorin the incremental component's chunk-countprint(bug(pipelines): ZeroDivisionError in chunk_and_embed_incremental when text splitter returns empty chunks #163) is two lines from this diff; leaving it to fix(pipelines): guard against ZeroDivisionError in chunk_and_embed_incremental when chunk list is empty #164.store_milvus_incrementalstill hardcodesdim=768and has no schema check, unlikestore_milvus— out of scope here.