Files
zeekayandHanzo Dev cd8f6e70c7 no hogs: the mascot leaves the identifiers, the wire keeps its names
2,938 of 3,342 occurrences renamed across 253 files. What is left is 404, and
every one of them is a contract with something outside this process:

  hog_flow / hog_flows / hog_flow_id / hog_flow_version   queue-routing key and
                                                          the /hog_flows/ API path
  hog_invocation_results, insights_hogfunction,
  insights_hogflow, hog_templated                         table and column names
  'hogflow', 'hogoverflow'                                cyclotron queue values,
                                                          sitting in rows right now
  'tophog'                                                the TOPFN_OUTPUT value

Renaming any of those is a migration with a cutover, not a rename, so they stay
until someone does that deliberately.

The names follow what the files already say. hog-*.ts became script-*.ts in an
earlier pass, so HogTransformerService is ScriptTransformerService and
compileHog is compileScript; TophogOutput follows its own TOPFN_OUTPUT to
TopFnOutput; HogFlow is Flow.

Done with a transform that walks the source and only rewrites CODE — quoted
strings, template text, and comments naming a wire value are left as they are,
with snake_case hog tokens held aside even when they appear unquoted as object
keys, which is exactly how 'hog_flow' survives in `{ hog_flow: flowQueue }`.

Two things that pass needed on top of it, both real breaks otherwise:
  * `${...}` inside a template literal is code — renamed there, text left alone.
  * obj['hogWatcher'] is a property access by string. Renaming the property and
    not the accessor points it at nothing; 14 of those in 6 files.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-08 23:50:56 -07:00

68 lines
3.1 KiB
TypeScript

import {
KAFKA_APP_METRICS_2,
KAFKA_DATASTORE_AI_EVENTS_JSON,
KAFKA_DATASTORE_HEATMAP_EVENTS,
KAFKA_DATASTORE_TOPFN,
KAFKA_EVENTS_JSON,
KAFKA_EVENTS_PLUGIN_INGESTION_ASYNC,
KAFKA_EVENTS_PLUGIN_INGESTION_DLQ,
KAFKA_EVENTS_PLUGIN_INGESTION_OVERFLOW,
KAFKA_GROUPS,
KAFKA_INGESTION_WARNINGS,
KAFKA_LOG_ENTRIES,
KAFKA_PERSON,
KAFKA_PERSON_DISTINCT_ID,
KAFKA_PERSON_MERGE_EVENTS,
} from '~/common/config/kafka-topics'
import { KafkaProducerWrapper } from '~/common/kafka/producer'
import {
APP_METRICS_OUTPUT,
DLQ_OUTPUT,
GROUPS_OUTPUT,
INGESTION_WARNINGS_OUTPUT,
LOG_ENTRIES_OUTPUT,
OVERFLOW_OUTPUT,
TOPFN_OUTPUT,
} from '~/common/outputs'
import {
AI_EVENTS_OUTPUT,
ASYNC_OUTPUT,
EVENTS_OUTPUT,
PERSONS_OUTPUT,
PERSON_DISTINCT_IDS_OUTPUT,
PERSON_MERGE_EVENTS_OUTPUT,
} from '~/common/outputs'
import { IngestionOutputs } from '~/common/outputs/ingestion-outputs'
import { SingleIngestionOutput } from '~/common/outputs/single-ingestion-output'
import { HEATMAPS_OUTPUT } from '~/ingestion/pipelines/heatmaps/outputs'
function testOutput(name: string, topic: string, producer: KafkaProducerWrapper): SingleIngestionOutput {
return new SingleIngestionOutput(name, topic, producer, 'test')
}
export function createTestMonitoringOutputs(kafkaProducer: KafkaProducerWrapper) {
return new IngestionOutputs({
[APP_METRICS_OUTPUT]: testOutput(APP_METRICS_OUTPUT, KAFKA_APP_METRICS_2, kafkaProducer),
[LOG_ENTRIES_OUTPUT]: testOutput(LOG_ENTRIES_OUTPUT, KAFKA_LOG_ENTRIES, kafkaProducer),
})
}
export function createTestIngestionOutputs(kafkaProducer: KafkaProducerWrapper) {
return new IngestionOutputs({
[EVENTS_OUTPUT]: testOutput(EVENTS_OUTPUT, KAFKA_EVENTS_JSON, kafkaProducer),
[AI_EVENTS_OUTPUT]: testOutput(AI_EVENTS_OUTPUT, KAFKA_DATASTORE_AI_EVENTS_JSON, kafkaProducer),
[HEATMAPS_OUTPUT]: testOutput(HEATMAPS_OUTPUT, KAFKA_DATASTORE_HEATMAP_EVENTS, kafkaProducer),
[INGESTION_WARNINGS_OUTPUT]: testOutput(INGESTION_WARNINGS_OUTPUT, KAFKA_INGESTION_WARNINGS, kafkaProducer),
[DLQ_OUTPUT]: testOutput(DLQ_OUTPUT, KAFKA_EVENTS_PLUGIN_INGESTION_DLQ, kafkaProducer),
[OVERFLOW_OUTPUT]: testOutput(OVERFLOW_OUTPUT, KAFKA_EVENTS_PLUGIN_INGESTION_OVERFLOW, kafkaProducer),
[ASYNC_OUTPUT]: testOutput(ASYNC_OUTPUT, KAFKA_EVENTS_PLUGIN_INGESTION_ASYNC, kafkaProducer),
[GROUPS_OUTPUT]: testOutput(GROUPS_OUTPUT, KAFKA_GROUPS, kafkaProducer),
[PERSONS_OUTPUT]: testOutput(PERSONS_OUTPUT, KAFKA_PERSON, kafkaProducer),
[PERSON_DISTINCT_IDS_OUTPUT]: testOutput(PERSON_DISTINCT_IDS_OUTPUT, KAFKA_PERSON_DISTINCT_ID, kafkaProducer),
[PERSON_MERGE_EVENTS_OUTPUT]: testOutput(PERSON_MERGE_EVENTS_OUTPUT, KAFKA_PERSON_MERGE_EVENTS, kafkaProducer),
[APP_METRICS_OUTPUT]: testOutput(APP_METRICS_OUTPUT, KAFKA_APP_METRICS_2, kafkaProducer),
[LOG_ENTRIES_OUTPUT]: testOutput(LOG_ENTRIES_OUTPUT, KAFKA_LOG_ENTRIES, kafkaProducer),
[TOPFN_OUTPUT]: testOutput(TOPFN_OUTPUT, KAFKA_DATASTORE_TOPFN, kafkaProducer),
})
}