Skip to content

Legacy shallow fails migrate on hg/svn/git:// configs #598

Done

Description

@tony

Summary

Upgrading from vcspull 1.68.0 to 1.70.0 on a multi-hundred-repository manifest with legacy options: {shallow: true} entries exposes three migration and diagnostic defects: load_configs() concatenates every affected 'workspace' -> 'repo' pair onto a single unbounded stderr warning line, validate_legacy_options() rejects legacy shallow: true on hg+ and svn+ entries (with a misleading .options.git error path) in both load_configs() and vcspull migrate, and match_vcs_url() returns () (VCS (unknown)) for unprefixed git:// and svn:// URLs. Together, a single legacy hg+, svn+, or git:// entry with options: {shallow: true} aborts unrelated vcspull sync <repo> commands and prevents vcspull migrate from rewriting the file.

Reproduction

  1. Write a minimal legacy configuration file (legacy.yaml) containing multiple options: {shallow: true} entries, a Mercurial repository with options: {shallow: true} (previously ignored as a no-op in vcspull 1.68.0), and an unprefixed git:// repository:

    ./c/:
      bash:
        options:
          shallow: true
        repo: git://git.savannah.gnu.org/bash.git
      sdl:
        options:
          shallow: true
        repo: hg+https://hg.libsdl.org/SDL
    ./python/:
      click:
        options:
          shallow: true
        repo: git+https://github.com/pallets/click.git
  2. Run vcspull sync targeting only click:

    $ vcspull -f legacy.yaml sync click
  3. Run vcspull migrate on the file:

    $ vcspull migrate -f legacy.yaml

Expected

  • load_configs() caps the Affected: list in the legacy-options deprecation warning (for example, showing the first few entries plus (+N more)) instead of emitting thousands of repository names on one line, and vcspull migrate bounds per-entry log lines on large manifests.
  • match_vcs_url() and scripts/generate_schema.py recognize unprefixed git:// and svn:// URLs as git and svn, matching their explicit daemon protocol schemes.
  • Legacy shallow: true / depth validation errors name the offending legacy key (options.shallow or options.depth, not options.git), and vcspull migrate strips no-op legacy shallow: true from hg and svn entries with a warning instead of aborting the migration of the entire file.

Actual

  • On a large manifest, load_configs() prints every legacy 'workspace' -> 'repo' pair onto a single multi-kilobyte stderr line before validation runs.
  • Both vcspull -f legacy.yaml sync click and vcspull migrate -f legacy.yaml fail without migrating any entry:
    • bash (git://git.savannah.gnu.org/bash.git) fails with options.git: options do not match the repository VCS (unknown).
    • sdl (hg+https://hg.libsdl.org/SDL) fails with options.git: options do not match the repository VCS (hg).

Environment

Versions
  • vcspull: 1.70.0 (upgraded from 1.68.0)
  • libvcs: 0.48.0
  • Python: 3.14
  • OS: Linux

Proposal

  • Cap Affected: in src/vcspull/config.py at a small preview count (such as 5 entries followed by (+N more)) while preserving vcspull_legacy_count on the log record, and summarize remaining entries in src/vcspull/cli/migrate.py when rewriting large files.
  • Recognize git:// and svn:// URLs in match_vcs_url() (src/vcspull/validator.py) and url_predicates() (scripts/generate_schema.py), and regenerate docs/_static/schemas/vcspull.schema.json.
  • Report the real legacy field path (shallow / options.shallow / depth / options.depth) in validate_legacy_options() instead of synthesizing .git, and teach vcspull migrate to drop unsupported legacy shallow: true on hg and svn entries with a warning so <=1.68.0 manifests migrate cleanly in one pass.

References

Activity

  1. added a commit that references this issue on Nov 29, 2026
    135da2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions