Skip to content

feat(review): config-as-code enable/disable for review.visual capture #4083

Description

@JSONbored

Problem

Visual-capture (before/after screenshot) rollout today is controlled only by two blunt env vars: GITTENSORY_REVIEW_SCREENSHOTS (single global on/off for the whole instance) and GITTENSORY_REVIEW_REPOS (a shared allowlist used by every gated capability, not visual-specific). There is no way to turn visual capture on for one self-hosted repo and off for another without giving them different env vars entirely (i.e. different deployments).

The review.visual .gittensory.yml namespace already exists (preview.url_template / routes.paths / routes.max_routes / themes / gif, #3609/#3610/#3678/#3612) and is resolved through the standard 3-layer config-as-code precedence (per-repo file > global-default file > _shared file). Capability enablement should live in that same layer, not bolt on a third env var.

Fix

Add review.visual.enabled (boolean, default unset/null) to the existing VisualConfig type, parsed/overlaid/serialized through the same machinery as gif/themes/etc. Semantics:

  • Unset at every layer (default) ⇒ defers entirely to the existing GITTENSORY_REVIEW_SCREENSHOTS + GITTENSORY_REVIEW_REPOS gate — byte-identical to today.
  • Explicit enabled: false (set globally or overridden per-repo) ⇒ forces capture off for that repo even if the env-var gate would otherwise allow it.
  • Explicit enabled: true ⇒ no additional restriction beyond the existing gate (does NOT bypass it — the env vars remain the outer infra-availability gate).

This lets an operator set a global default in the dir-root .gittensory.yml and override it per-repo in {owner}__{repo}/.gittensory.yml, entirely through config, no redeploy needed.

Deliverables

  • VisualConfig.enabled: boolean | null in packages/gittensory-engine/src/focus-manifest.ts (type, EMPTY_VISUAL_CONFIG, parseVisualConfig, overlayVisualConfig, visualConfigPresent, reviewConfigToJson)
  • src/queue/processors.ts: gate the capture call on reviewVisualConfig.enabled !== false
  • .gittensory.yml.example documents the new key
  • Tests: parse true/false/absent/non-boolean, overlay precedence (per-repo wins when set, else falls back), present-check, round-trip, the new processors.ts gating branch

Effort

S — one new nullable field following an established pattern (mirrors gif's parse/overlay/present/serialize shape), plus one new conditional in the capture call site.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions