Skip to content

feat(t3-3): SourceFactory.collect_config() — spec-driven, no per-source branching - #193

Open
JesuFemi-O wants to merge 4 commits into
feat/m3-t3-2from
feat/m3-t3-3
Open

feat(t3-3): SourceFactory.collect_config() — spec-driven, no per-source branching#193
JesuFemi-O wants to merge 4 commits into
feat/m3-t3-2from
feat/m3-t3-3

Conversation

@JesuFemi-O

@JesuFemi-O JesuFemi-O commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds src/tycoon/ingestion/factory.py with SourceFactory.collect_config() — produces a flat config dict for any source via its SourceSpec, with no if self.spec.id == "github" branching
  • Interactive mode: credentials (hidden input, env-var default) then config fields (required always prompted, optional marked (optional) and excluded if left blank); section headers Credentials / Configuration when both blocks are non-empty; informational message when source has no fields
  • Non-interactive mode (--no-prompt): credentials default to ${ENV_VAR}; required config_fields raise typer.Exit(1) with error() (stderr) after reporting all missing flags at once; optional fields use their non-empty default or are omitted
  • 20 tests in tests/test_factory.py: non-interactive (credential defaults, flag overrides, required/optional paths, multi-missing report, rest_api real defaults, None/empty defaults) and interactive (credential default, explicit value, required field, optional blank/filled, no-fields)

Test plan

  • uv run pytest tests/test_factory.py — all 20 pass
  • uv run pytest — full suite 743 passed, 3 skipped

Closes #102


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

…ce branching

Interactive mode: prompts credentials with hide_input and env-var default;
prompts config_fields respecting required/optional. Non-interactive: reads
from flags dict, falls back to env-var refs for credentials, raises
SystemExit(1) for missing required config fields.

Closes #102
…l defaults on real manifest entry, cover default=None path, use explicit None-check instead of or-empty
- error() instead of info() for missing required field — writes to stderr
  with red prefix, correct for fatal failures
- Collect all missing required fields before exiting so --no-prompt users
  see every missing flag in one run instead of one per re-run
- raise typer.Exit(1) instead of SystemExit(1) — consistent with the rest
  of the Typer command layer; update tests accordingly
- Section headers (Credentials / Configuration) in interactive mode when
  both blocks are non-empty, matching _prompt_catalog_config style
- Append '(optional)' to non-required field prompts — system-level cue
  rather than relying on label wording alone
- Print explanatory message when source has no fields (interactive path)
  so users don't see an abrupt silence after source selection
- Single-line module docstring (4-line block condensed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant