Skip to content

Dataclass-based config#396

Closed
tony wants to merge 1 commit into
masterfrom
dataclass-config
Closed

Dataclass-based config#396
tony wants to merge 1 commit into
masterfrom
dataclass-config

Conversation

@tony

@tony tony commented Sep 25, 2022

Copy link
Copy Markdown
Member

Changes

  • New config object: Config
    • Raw config from yaml: from_yaml_file(file_path: pathlib.Path, cwd=pathlib.Path.cwd())
    • repo_dict_map: Internal mapping of configs after expansion and processing in environment
    • repos: A list of GitSync, SvnSync, HgSync objects

@codecov

codecov Bot commented Sep 25, 2022

Copy link
Copy Markdown

Codecov Report

Merging #396 (a2e5a2b) into master (2654f9f) will increase coverage by 0.00%.
The diff coverage is 72.60%.

❗ Current head a2e5a2b differs from pull request most recent head bd8b741. Consider uploading reports for the commit bd8b741 to get more accurate results

@@           Coverage Diff           @@
##           master     #396   +/-   ##
=======================================
  Coverage   84.00%   84.01%           
=======================================
  Files          17       16    -1     
  Lines         938      926   -12     
  Branches      168      166    -2     
=======================================
- Hits          788      778   -10     
- Misses        100      101    +1     
+ Partials       50       47    -3     
Impacted Files Coverage Δ
src/vcspull/config.py 79.03% <60.00%> (-5.64%) ⬇️
tests/test_config_object.py 100.00% <100.00%> (ø)
tests/test_config_file.py 95.32% <0.00%> (-0.11%) ⬇️
conftest.py 78.04% <0.00%> (ø)
src/vcspull/log.py 68.42% <0.00%> (ø)
src/vcspull/util.py 100.00% <0.00%> (ø)
src/vcspull/types.py 100.00% <0.00%> (ø)
src/vcspull/_internal/config_reader.py
src/vcspull/validator.py
tests/test_sync.py 91.30% <0.00%> (+1.02%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tony tony force-pushed the dataclass-config branch 2 times, most recently from 962c71c to 73f14f0 Compare September 26, 2022 02:33
@tony tony force-pushed the master branch 2 times, most recently from 54b2d28 to b9c0aa1 Compare October 1, 2022 16:00
@tony tony force-pushed the dataclass-config branch from e5a4d29 to b385e9e Compare October 8, 2022 11:31
@tony tony force-pushed the dataclass-config branch from b385e9e to 702d2b7 Compare October 13, 2022 01:18
@tony tony force-pushed the dataclass-config branch from 702d2b7 to ca81ced Compare October 23, 2022 15:45
@tony tony force-pushed the dataclass-config branch from ca81ced to 96caed1 Compare November 1, 2022 10:51
@tony tony force-pushed the dataclass-config branch 2 times, most recently from 0308d56 to 0659189 Compare December 31, 2022 15:28
@tony

tony commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

Closing. Re-authoring this onto current master would land a second, feature-regressing config loader: its from_yaml_file re-implements a yaml.load(open(...)) path that drops workspace_root, options/pin, rev/shallow/depth, worktrees, JSON support, and duplicate-workspace merging — all of which master's load_configs/ConfigReader pipeline handles.

Its two stated goals are already met on master:

  • Type safety — the vcspull.types TypedDict graph (ConfigDict, RawConfigDict, RepoOptionsDict, RepoPinDict, …) gives mypy-checked config shapes with far more fidelity than the proposed dataclass.
  • Filteringvcspull.config.filter_repos already exists, and libvcs QueryList is usable directly.

The one genuinely novel idea — an eager object graph where Config.repos holds live GitSync/HgSync/SvnSync handles — is a real direction, but it belongs in a fresh proposal designed on top of today's load_configs/ConfigDict/update_repo pipeline (a migration touching ~10 consumer modules), not a rebase of a 2022 patch. Happy to revisit as a design doc.

@tony tony closed this Jul 5, 2026
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