77f91b38ab166f2adfefbdff3c2cbd50c2591cd0 hiram Mon Jun 8 15:21:14 2026 -0700 correct status labels to differeniate liftOver vs. assembly status refs #31811 diff --git src/hg/utils/otto/userRequests/ottoRequestView.cgi src/hg/utils/otto/userRequests/ottoRequestView.cgi index 3495e163221..62467287688 100644 --- src/hg/utils/otto/userRequests/ottoRequestView.cgi +++ src/hg/utils/otto/userRequests/ottoRequestView.cgi @@ -43,38 +43,37 @@ 1: 'acknowledged, email sent', 2: 'galaxy job started', 3: 'galaxy done, download started', 4: 'downloaded, track files made', 5: 'symlinks ready, awaiting push', 6: 'push complete', 7: 'ERROR', 8: 'COMPLETE (final email sent)', } asmStatus = { 0: 'received by API', 1: 'acknowledged, email sent', 2: 'assembly build started', 3: 'assembly build done', - 4: 'downloaded, track files made', - 5: 'symlinks ready, awaiting push', - 6: 'push complete', + 4: 'assembly available on hgwdev', + 5: 'assembly available on hgwbeta', + 6: 'assembly available on hgw2 - done', 7: 'ERROR', 8: 'COMPLETE (final email sent)', } - COLS = ['id', 'requestType', 'fromDb', 'toDb', 'email', 'comment', 'requestTime', 'status', 'buildDir', 'completeTime'] # featureBits coverage lookup roots HIVE_GENOMES = '/hive/data/genomes' ASMHUB_ROOT = HIVE_GENOMES + '/asmHubs' # in-process caches; one CGI invocation only, but rows reuse same accessions _buildDirCache = {} _fbPctCache = {} _genarkAsmName = {} # populated up-front by loadGenarkNames() _fbSnapshot = {} # populated up-front by loadFeatureBitsSnapshot() def forbidden(msg): @@ -103,30 +102,35 @@ out, i, n = [], 0, len(s) while i < n: if s[i] == '\\' and i + 1 < n: c = s[i+1] if c == 'n': out.append('\n') elif c == 't': out.append('\t') elif c == '\\': out.append('\\') elif c == '0': out.append('\0') else: out.append(s[i:i+2]) i += 2 else: out.append(s[i]); i += 1 return ''.join(out) +def getStatusDict(requestType): + """Return appropriate status dictionary based on request type.""" + return asmStatus if requestType == 'assembly' else liftStatus + + def hgsqlRun(sql): """Run sql via hgsql against DB. Returns (ok, stdout, stderr). Running under Apache the process has no ~/.hg.conf, so point hgsql at the cgi-bin hg.conf via HGDB_CONF.""" env = dict(os.environ) env['HGDB_CONF'] = HGDB_CONF env['HOME'] = TRASH cmd = ['/cluster/bin/x86_64/hgsql'] if USE_PROFILE: cmd.append('-profile=central') cmd.extend([DB, '-N', '-B', '-e', sql]) r = subprocess.run(cmd, capture_output=True, text=True, env=env) return (r.returncode == 0, r.stdout, r.stderr) @@ -343,32 +347,37 @@ out('
Galaxy queue: ' f'{galaxyStatus.get("running", "?")} running · ' f'{galaxyStatus.get("queued", "?")} queued · ' f'{galaxyStatus.get("new", "?")} new ' f'(as of {html.escape(galaxyStatus.get("ts", ""))})' f'{staleNote}
\n') else: out('
Galaxy queue: ' 'status unavailable
\n') if info: out(f'\n') if error: out(f'\n') out('
status: ') + # Show both status types + out('liftOver: ') out(' · '.join(f'{k}={html.escape(v)}' for k, v in liftStatus.items())) + out('
assembly: ') + out(' · '.join(f'{k}={html.escape(v)}' + for k, v in asmStatus.items())) # Count rows by type for toggle button labels completed_count = sum(1 for r in rows if len(r) > 7 and r[7] == '8') assembly_count = sum(1 for r in rows if len(r) > 1 and r[1] == 'assembly') liftover_count = sum(1 for r in rows if len(r) > 1 and r[1] == 'liftOver') # Config toggle button - switches between test and production databases current_config = 'otto' if use_otto else 'test' switch_config = 'test' if use_otto else 'otto' switch_label = 'Switch to hgwdev' if use_otto else 'Switch to RR' config_url = f'?config={switch_config}' out(f' · {len(rows)} row(s)' f'{switch_label}' '' f'') out('\n') out('\n') out('\n') out('