study_area_run.sh: --schema= override for side-by-side bundle compares (v0.41.1)#209
Merged
Merged
Conversation
…s (v0.41.1) Adds --schema=<persist-schema> flag that overrides cfg$pipeline$schema at runtime via the LNK_SCHEMA env var. Propagates to local Rscript invocations (via export) and to cypher SSH invocations (each remote shell exports it before its WSG loop). All four scripts (wsg_run_one, wsg_recompute_one, study_area_compare, study_area_run) honour LNK_SCHEMA. Without the flag, behaviour is unchanged (YAML default). With it, e.g. `--config=default --schema=fresh_default` keeps a default-config run from clobbering an earlier `--config=bcfishpass` baseline sitting in `fresh`. Empty --schema= value errors loudly (not silent fallthrough). Live-validated: ADMS / default config / fresh_default — 2.2 min, 11 species habitat tables in fresh_default, fresh untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
--schema=<persist-schema>flag todata-raw/study_area_run.shfor side-by-side bundle comparespipeline$schemadefault)LNK_SCHEMA; all per-WSG R scripts (wsg_run_one.R,wsg_recompute_one.R,study_area_compare.R) overridecfg$pipeline$schemaat runtimeLNK_SCHEMAbefore its WSG loop)--schema=value errors loudly rather than silently falling through to the YAML default (caught in/code-check)Use case:
--config=default --schema=fresh_defaultkeeps a default-config run from clobbering an earlier--config=bcfishpassbaseline infresh. Unblocks the default-vs-bcfp config comparison run.Related Issues
Test plan
LNK_SCHEMA=fresh_default Rscript data-raw/wsg_run_one.R ADMS defaultran end-to-end in 2.2 min; 11 species habitat tables landed infresh_default;freshschema untouched (baseline preserved)--schema=value errors with"FATAL: --schema= requires a non-empty value"/code-checkRound 1: 1 MEDIUM (empty-value silent fallthrough) fixed; 3 LOW findings accepted as design tradeoffs (SSH single-quote injection theoretical given schema-name conventions; LNK_SCHEMA env leaks to child processes — intentional propagation contract; future-proof flag for study_area_wsgs.R)Notes
The override threads via env var rather than a script param so the four R scripts share one contract (read
Sys.getenv("LNK_SCHEMA"); if non-empty, mutatecfg$pipeline$schemabefore any pipeline call). Same pattern in all three R scripts — easy to extend to future scripts.🤖 Generated with Claude Code