992aeef92fea7be25a2acd916578898649212a32
braney
  Mon Sep 7 11:31:07 2026 -0700
quickLift: gate the alignment lift behind an hg.conf flag, refs #38249

Add browser.quickLiftAlignments, default FALSE, so the alignment lift ships
dark and a machine turns it on with browser.quickLiftAlignments=on.  It sits
beside browser.quickLift, the gate on the rest of the feature.

quickLiftAlignmentsEnabled() in hg/lib/quickLift.c is the one read, and
validateOneTdb in hg/lib/trackHub.c is the one place that asks it, before an
alignment track may enter a quickLift hub.  That is the only door:
quickLiftUrl and quickLiftDb, the pair every lift path keys off, are written
by the quickLift hub writer and by nothing else, so with the flag off an
alignment track never gets them and the lifting, drawing and details code
behind them cannot be reached.  pslTrack.c, chainTrack.c, wigMafTrack.c,
bigBedTrack.c and hgc.c are unchanged.

With the flag off hgConvert lists psl, bigPsl, chain, bigChain, maf, bigMaf
and wigMaf tracks in its "type is not supported by QuickLift" table, which is
what it did before this work.  A hub built while the flag was on keeps working
after it is turned off, since its stanzas are already in the hub file in
trash, so this holds the feature back from people who have not used it rather
than switching off a session that has.

Read the hg.conf half with a literal cfgOptionBooleanDefault rather than
cartOrCfgOption so harvestHgConf.py can see it; a cart variable of the same
name still overrides it.  Register the flag in hgConfCatalog.py with
role="gate" so the sunset report tracks it, and turn it on in
confs/hgwdev.hg.conf.

diff --git src/hg/lib/quickLift.c src/hg/lib/quickLift.c
index 8ddda15e367..0adada5ee80 100644
--- src/hg/lib/quickLift.c
+++ src/hg/lib/quickLift.c
@@ -939,30 +939,47 @@
                             &peak->strand[0]);
 
     if (error == NULL)
         slAddHead(&liftedList, peak);
     }
 return liftedList;
 }
 
 boolean quickLiftEnabled(struct cart *cart)
 /* Return TRUE if feature is available */
 {
 char *cfgEnabled = cartOrCfgOption(cart, "browser.quickLift");
 return cfgEnabled && (sameString(cfgEnabled, "on") || sameString(cfgEnabled, "true")) ;
 }
 
+boolean quickLiftAlignmentsEnabled(struct cart *cart)
+/* Return TRUE if quickLift is allowed to lift alignment tracks: psl, bigPsl, chain,
+ * bigChain, maf, bigMaf and wigMaf.  Off unless hg.conf says
+ * browser.quickLiftAlignments=on, and a cart variable of the same name overrides that so
+ * one machine can show both answers.  The hg.conf half is read with a literal
+ * cfgOptionBooleanDefault rather than cartOrCfgOption because harvestHgConf.py only sees
+ * the cfgOption* accessors, which is why browser.quickLift itself is missing from the
+ * hg.conf catalog. */
+{
+char *cartEnabled = cartOptionalString(cart, "browser.quickLiftAlignments");
+
+if (cartEnabled != NULL)
+    return sameString(cartEnabled, "on") || sameString(cartEnabled, "true") ||
+           sameString(cartEnabled, "yes");
+return cfgOptionBooleanDefault("browser.quickLiftAlignments", FALSE);
+}
+
 static int hrCmp(const void *va, const void *vb)
 /* Compare to sort based on chromStart. */
 {
 const struct quickLiftRegions *a = *((struct quickLiftRegions **)va);
 const struct quickLiftRegions *b = *((struct quickLiftRegions **)vb);
 return a->chromStart - b->chromStart;
 }
 
 struct quickLiftRegions *getMismatches(char *ourDb, char strand, char *chrom, char *liftDb, char *liftChrom,  struct bigLink *bl, int querySize,  int seqStart, int seqEnd, char * chainId)
 // Helper function to calculate mismatches in a bigLink block
 {
 struct quickLiftRegions *hrList = NULL, *hr;
 
 int tStart = bl->chromStart;
 int tEnd = bl->chromEnd;