da5180baf458d64d523ec4e1cd96166bac1d3b25 braney Sat Aug 1 12:05:20 2026 -0700 urlCommandCatalog: let --reconcile fail, so it can run nightly refs #37923 reconcile ended in a bare return 0, so it could not fail whatever it found, and it printed a six hundred line name diff every run. Most of that diff is structural rather than drift: the catalog covers what a user can put on a browser URL, while the harvester sees every cgiOptionalString in the tree, including form fields and the arguments of small utility CGIs. So the gap is now recorded in urlNamesNotCataloged.txt and reconcile reports only a name in neither the catalog nor that file, plus any disagreement between a persists=False claim and what the tree actually excludes or removes, in either direction. That second half was already computed and thrown away in a summary line. --update-baseline regenerates the file so accepting a name out of scope is a reviewable diff rather than a hand edit. The baseline's first version was accepted wholesale and says so, except for blatNewPage and blatReopen, which the new BLAT results page puts on a URL and which are now cataloged properly. A scan that finds almost nothing fails rather than reporting all clear, and KENT_SRC lets a nightly aim at a pristine checkout. diff --git src/hg/utils/urlCommandCatalog/harvestUrlCommands.py src/hg/utils/urlCommandCatalog/harvestUrlCommands.py index 03c1b54160b..9b1d0f8fbcf 100755 --- src/hg/utils/urlCommandCatalog/harvestUrlCommands.py +++ src/hg/utils/urlCommandCatalog/harvestUrlCommands.py @@ -42,31 +42,34 @@ harvestUrlCommands.py --exclude-vars # mechanism 1, grouped by CGI harvestUrlCommands.py --cgi-reads # mechanism 2, grouped by CGI harvestUrlCommands.py --cart-removes # mechanism 3, grouped by CGI harvestUrlCommands.py --all # every mechanism, grouped by CGI harvestUrlCommands.py --names # flat sorted name list harvestUrlCommands.py --json out.json """ import argparse import collections import json import os import re import sys -ROOT = os.path.expanduser("~/kent/src") +# The tree to scan. KENT_SRC lets a nightly run point at a pristine +# checkout instead of somebody's working tree, where a stray .c file or a +# half-finished edit would show up as a finding. +ROOT = os.environ.get("KENT_SRC") or os.path.expanduser("~/kent/src") # Walked for call sites. hg/lib and hg/cgilib are in here because the cart # machinery itself reads URL commands (hgsid, ignoreCookie, the session # loaders), which a CGI-only scan would miss entirely. SCAN_ROOTS = ["hg", "lib"] # Not source we care about, and walking them is slow. SKIP_DIRS = {"htdocs", "js", "tests", "expected", "input", "trackDb", "makeDb/doc", "CVS", ".git", "python", "lowelab"} # Mined for #define values in addition to everything under SCAN_ROOTS. A CGI # routinely defines its own command names in its own .c or .h (DO_QUERY lives in # hgIntegrator.c, the arg* names in hg/hubApi/dataApi.h), so the macro table has # to cover the scanned trees too or half the names come out as {IDENT}. MACRO_DIRS = ["inc", "hg/inc"]