Indexer: CLI flags for the firehose switches (override env)#14
Merged
Conversation
Add --hoses / --legacy / --no-legacy / --help to the indexer, overriding the matching env vars (env stays the fallback so pm2/.env keep working). - src/indexer.js: parseArgs(argv) -> env-overlay; runIndexer merges it over process.env before planIngest (flags win). USAGE text; --help handled at the CLI entry points. - index.js: honour --help before booting; note the override in a comment. - README: document the flags in the Run section. - test/indexer-args.test.js: parseArgs forms (--hoses, =value, bare, legacy on/off, help) + the flags-override-env merge contract. npm test 48/48. Closes #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13. Adds CLI flags for the firehose switches so ad-hoc runs don't need inline env. Flags override env; env (pm2/.env) stays the fallback.
Flags
--hoses <list>/--hoses=<list>— comma list of hose names (overridesHOSES)--no-legacy— disable the raw-upsert fallback (INDEX_LEGACY_KINDS=0)--legacy— force it on-h/--help— usage, then exit (no DB connection)How
parseArgs(argv)→ env-overlay with only the keys the user passed.runIndexermerges{ ...process.env, ...parseArgs() }and hands it toplanIngest— flags win, env is the fallback,planIngeststays pure.--helphandled at both entry points (index.js,src/indexer.js).Verification
npm test— 48/48 (newparseArgstests: all flag forms + the flags-override-env merge contract).node index.js --helpprints usage without connecting to Mongo.--hoses profiles --no-legacy→hoses: [profiles] legacy kinds: off subscribing kinds 0; andHOSES=follows … --hoses=profiles→[profiles](flag beat env).