d11a21c48cdc2cebe0a97779b510df8317b980cd
braney
  Mon Sep 7 06:29:43 2026 -0700
bigNet: gate the track type behind an hg.conf flag, refs #20824

Add the boolean hg.conf setting bigNet, default FALSE, so the type ships
dark and a machine turns it on with bigNet=on.

trackHubBigNetEnabled() in hg/lib/trackHub.c is the one read; the four
places that accept or advertise the type ask it.  validateOneTrack drops
bigNet from the hub track type allowlist, validateOneTdb drops it from the
types quickLift will lift, hubCheck drops it from VALID_TRACK_TYPES and
from the message listing the valid types, and hubApi does not add it to
supportedTypes.  netToBigNet, netTrack.c, chainNetDbLoad.c and the hgc
details code are unchanged, since they cannot be reached once a bigNet
track will not load.

With the flag off hgTracks does not abort the hub.  It draws the track row
as a bigWarn bar reading "Unsupported type 'bigNet ...'" and the rest of
the hub loads normally.

Register the flag in hgConfCatalog.py with role="gate" so the sunset
report tracks it.

diff --git src/hg/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c
index cd25ad6fca8..1c96bc71205 100644
--- src/hg/utils/hubCheck/hubCheck.c
+++ src/hg/utils/hubCheck/hubCheck.c
@@ -785,49 +785,60 @@
             "a data track.", tdb->track);
         }
     }
 else if (tdb->subtracks != NULL)
     {
     errAbort("Track \"%s\" has children tracks (e.g: \"%s\"), but is not a "
         "compositeTrack, container, view or superTrack", tdb->track, tdb->subtracks->track);
     }
 }
 
 static char *VALID_TRACK_TYPES[] = {
     "bam", "bigBarChart", "bigBed", "bigChain", "bigGenePred", "bigInteract", "bigNet",
     "bigLolly", "bigMaf", "bigMethyl", "bigNarrowPeak", "bigPsl", "bigRmsk",
     "bigWig", "halSnake", "hic", "longTabix", "vcfPhasedTrio", "vcfTabix", NULL};
 
+static bool typeIsTurnedOff(char *trackType)
+/* Some types in VALID_TRACK_TYPES are gated in hg.conf.  Report the ones this
+ * machine has turned off, so hubCheck agrees with what the browser will load. */
+{
+if (sameString(trackType, "bigNet"))
+    return !trackHubBigNetEnabled();
+return FALSE;
+}
+
 static bool isValidTrackType(char *trackType)
 /* check that a track type is valid */
 {
 // **** DANGER, WILL ROBINSON! ****
 // There is also code in trackHub.c that checks track names.
 // both places must be changed or common code created.
 for (int i = 0; VALID_TRACK_TYPES[i] != NULL; i++)
-    if (sameString(trackType, VALID_TRACK_TYPES[i]))
+    if (sameString(trackType, VALID_TRACK_TYPES[i]) && !typeIsTurnedOff(trackType))
         return TRUE;
 return FALSE;
 }
 
 static char *getValidTrackTypesMsg()
 /* return descriptions of valid track types */
 {
 struct dyString *msg = dyStringNew(256);
 for (int i = 0; VALID_TRACK_TYPES[i] != NULL; i++)
     {
-    if (i > 0)
+    if (typeIsTurnedOff(VALID_TRACK_TYPES[i]))
+        continue;
+    if (msg->stringSize > 0)
         dyStringAppend(msg, ", ");
     dyStringAppend(msg, VALID_TRACK_TYPES[i]);
     }
 return dyStringCannibalize(&msg);
 }
 
 boolean checkTypeLine(struct trackHubGenome *genome, struct trackDb *tdb, struct dyString *errors, struct trackHubCheckOptions *options)
 {
 boolean retVal = FALSE;
 struct errCatch *errCatch = errCatchNew();
 if (errCatchStart(errCatch))
     {
     char *type = trackDbRequiredSetting(tdb, "type");
     char *splitType[4];
     int numWords = chopByWhite(cloneString(type), splitType, ArraySize(splitType));